Skip to content

Commit

Permalink
ruff checks on bench
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescAlted committed Nov 26, 2024
1 parent dabb829 commit eff98ee
Show file tree
Hide file tree
Showing 10 changed files with 789 additions and 783 deletions.
14 changes: 8 additions & 6 deletions bench/encode-itrunc-Linux-i13900K.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@
}
],
"source": [
"import h5py\n",
"import blosc2\n",
"from time import time\n",
"\n",
"import blosc2_grok\n",
"import h5py\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from skimage.metrics import structural_similarity as ssim\n",
"from tqdm import tqdm\n",
"import matplotlib.pyplot as plt\n",
"from time import time\n",
"import itertools\n",
"\n",
"import blosc2\n",
"\n",
"print(f\"Blosc2 version: {blosc2.__version__}\")\n",
"print(f\"blosc2_grok version: {blosc2_grok.__version__}\")"
]
Expand Down Expand Up @@ -205,7 +207,7 @@
],
"source": [
"# Compress the dataset with different compression ratios\n",
"quality_mode = f\"grok-rates\"\n",
"quality_mode = \"grok-rates\"\n",
"print(f\"Quality mode: {quality_mode}\")\n",
"ssims = []\n",
"cratios = []\n",
Expand Down
14 changes: 8 additions & 6 deletions bench/encode-itrunc-MacOS-M1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@
}
],
"source": [
"import h5py\n",
"import blosc2\n",
"from time import time\n",
"\n",
"import blosc2_grok\n",
"import h5py\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from skimage.metrics import structural_similarity as ssim\n",
"from tqdm import tqdm\n",
"import matplotlib.pyplot as plt\n",
"from time import time\n",
"import itertools\n",
"\n",
"import blosc2\n",
"\n",
"print(f\"Blosc2 version: {blosc2.__version__}\")\n",
"print(f\"blosc2_grok version: {blosc2_grok.__version__}\")"
]
Expand Down Expand Up @@ -205,7 +207,7 @@
],
"source": [
"# Compress the dataset with different compression ratios\n",
"quality_mode = f\"grok-rates\"\n",
"quality_mode = \"grok-rates\"\n",
"print(f\"Quality mode: {quality_mode}\")\n",
"ssims = []\n",
"cratios = []\n",
Expand Down
95 changes: 48 additions & 47 deletions bench/encode-sparse-MacOS-Intel.ipynb

Large diffs are not rendered by default.

88 changes: 44 additions & 44 deletions bench/lazyarray-expr-small-dask.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"outputs": [],
"source": [
"%load_ext memprofiler\n",
"import numpy as np\n",
"import blosc2\n",
"import numexpr as ne\n",
"import dask.array as da\n",
"import numba\n",
"import numexpr as ne\n",
"import numpy as np\n",
"import zarr\n",
"from numcodecs import Blosc\n",
"import dask\n",
"import dask.array as da"
"\n",
"import blosc2"
]
},
{
Expand Down Expand Up @@ -597,7 +597,7 @@
"type": "scatter",
"x": [
0.0002837181091308594,
0.011114358901977539,
0.01111435890197754,
0.02131819725036621,
0.0314943790435791,
0.04323077201843262,
Expand All @@ -607,7 +607,7 @@
0.08914041519165039,
0.09985661506652832,
0.11005163192749023,
0.12187695503234863,
0.12187695503234865,
0.13492608070373535,
0.1477348804473877,
0.16048049926757812,
Expand All @@ -617,8 +617,8 @@
0.2014014720916748,
0.21347618103027344,
0.22661614418029785,
0.23679137229919434,
0.24904751777648926,
0.2367913722991943,
0.24904751777648929,
0.2608022689819336,
0.2728755474090576,
0.2838931083679199,
Expand All @@ -628,15 +628,15 @@
0.32914257049560547,
0.34191060066223145,
0.35471343994140625,
0.36774778366088867,
0.3677477836608886,
0.3807382583618164,
0.3937718868255615,
0.40668535232543945,
0.4198181629180908,
0.43257904052734375,
0.44516491889953613,
0.4581873416900635,
0.47049474716186523,
0.4704947471618652,
0.4836850166320801,
0.4963371753692627,
0.5088844299316406,
Expand Down Expand Up @@ -717,17 +717,17 @@
0.06640982627868652,
0.07699370384216309,
0.08754611015319824,
0.10047388076782227,
0.10047388076782228,
0.11143112182617188,
0.12172842025756836,
0.13201594352722168,
0.14218950271606445,
0.15480542182922363,
0.1654813289642334,
0.1759328842163086,
0.18896198272705078,
0.19989609718322754,
0.21044540405273438,
0.1889619827270508,
0.1998960971832275,
0.2104454040527344,
0.2232210636138916,
0.23411178588867188,
0.2445390224456787,
Expand Down Expand Up @@ -851,14 +851,14 @@
0.08430290222167969,
0.0950784683227539,
0.10566425323486328,
0.11629557609558105,
0.11629557609558104,
0.1269209384918213,
0.13837337493896484,
0.14878416061401367,
0.1596052646636963,
0.17035484313964844,
0.18114805221557617,
0.19153213500976562,
0.1915321350097656,
0.20187854766845703,
0.21274471282958984,
0.22314858436584473,
Expand All @@ -875,15 +875,15 @@
0.33939456939697266,
0.3498687744140625,
0.3602886199951172,
0.37125563621520996,
0.38179826736450195,
0.39285898208618164,
0.3712556362152099,
0.3817982673645019,
0.3928589820861816,
0.4038271903991699,
0.41455769538879395,
0.4254329204559326,
0.4361095428466797,
0.44675612449645996,
0.45778679847717285,
0.44675612449646,
0.4577867984771729,
0.4683072566986084,
0.47884535789489746,
0.4895167350769043,
Expand Down Expand Up @@ -926,13 +926,13 @@
0.8843100070953369,
0.8953275680541992,
0.9058616161346436,
0.9164721965789795,
0.9272551536560059,
0.9164721965789796,
0.927255153656006,
0.9380323886871338,
0.9486777782440186,
0.9591240882873535,
0.9699661731719971,
0.9796788692474365
0.9591240882873536,
0.9699661731719972,
0.9796788692474364
],
"y": [
0,
Expand Down Expand Up @@ -1043,7 +1043,7 @@
"type": "scatter",
"x": [
0.0003025531768798828,
0.014232397079467773,
0.014232397079467772,
0.024410486221313477,
0.035106658935546875,
0.04565620422363281,
Expand All @@ -1060,7 +1060,7 @@
0.16350483894348145,
0.17420101165771484,
0.18544292449951172,
0.19642853736877441,
0.1964285373687744,
0.20993614196777344,
0.22124934196472168,
0.23414063453674316,
Expand All @@ -1076,7 +1076,7 @@
0.3462512493133545,
0.3566145896911621,
0.3669450283050537,
0.37722063064575195,
0.3772206306457519,
0.38745927810668945,
0.3980906009674072,
0.4083995819091797,
Expand Down Expand Up @@ -1124,19 +1124,19 @@
0.8838129043579102,
0.8945891857147217,
0.9052753448486328,
0.9159970283508301,
0.91599702835083,
0.92655348777771,
0.9373867511749268,
0.9482722282409668,
0.9592154026031494,
0.9698488712310791,
0.9698488712310792,
0.9801256656646729,
0.9903028011322021,
0.990302801132202,
1.0006070137023926,
1.0111253261566162,
1.0216898918151855,
1.0319859981536865,
1.0422143936157227,
1.0319859981536863,
1.0422143936157229,
1.0524842739105225,
1.0627877712249756,
1.0730435848236084,
Expand Down Expand Up @@ -1274,7 +1274,7 @@
0.1569690704345703,
0.1671760082244873,
0.17739152908325195,
0.18764090538024902,
0.18764090538024905,
0.1978740692138672,
0.20811128616333008,
0.21875500679016113,
Expand All @@ -1292,7 +1292,7 @@
0.34496331214904785,
0.35517001152038574,
0.3653838634490967,
0.37560248374938965,
0.3756024837493897,
0.38578176498413086,
0.3908987045288086
],
Expand Down Expand Up @@ -1350,7 +1350,7 @@
"name": "6.Numba",
"type": "scatter",
"x": [
0.00022649765014648438,
0.0002264976501464844,
0.010453462600708008,
0.0206146240234375,
0.030779600143432617,
Expand All @@ -1368,10 +1368,10 @@
0.15265607833862305,
0.1628098487854004,
0.17296266555786133,
0.18311548233032227,
0.1831154823303223,
0.1932680606842041,
0.20342111587524414,
0.21357417106628418,
0.20342111587524417,
0.21357417106628415,
0.22372698783874512,
0.23384690284729004,
0.24399900436401367,
Expand All @@ -1389,13 +1389,13 @@
0.3658630847930908,
0.37601709365844727,
0.3861703872680664,
0.39632344245910645,
0.3963234424591065,
0.4064815044403076,
0.4166450500488281,
0.4267995357513428,
0.43695974349975586,
0.4471137523651123,
0.45726752281188965,
0.4572675228118897,
0.4674208164215088,
0.47757506370544434,
0.4877288341522217,
Expand Down Expand Up @@ -2350,7 +2350,7 @@
"xaxis": {
"autorange": true,
"range": [
0.00022649765014648438,
0.0002264976501464844,
1.0736732482910156
],
"title": {
Expand Down
2 changes: 1 addition & 1 deletion bench/ndarray/compare_getslice.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
planes_idx = np.random.randint(0, min(shape), 100) # noqa: NPY002


def time_slices(dset, idx):
def time_slices(dset, idx): # noqa: C901
r = None
if dset.ndim == 3:
t0 = time()
Expand Down
1 change: 0 additions & 1 deletion bench/ndarray/compute_expr_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import blosc2


shape = (5000, 10_000)
chunks = [500, 10_000]
blocks = [4, 10_000]
Expand Down
Loading

0 comments on commit eff98ee

Please sign in to comment.