Skip to content

Commit 1cf11f6

Browse files
committed
Fixed precommit
1 parent c0e7d98 commit 1cf11f6

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

examples/ndarray/blosc2_3_10_demo.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import blosc2
21
import time
32

3+
import blosc2
4+
45
N, M = 5_000, 10_000
56
dtype = blosc2.float64
6-
working_set = dtype().itemsize * (2 * N * M + N * N) / 2 ** 30
7+
working_set = dtype().itemsize * (2 * N * M + N * N) / 2**30
78
print(f"Working set size of {round(working_set, 2)} GB")
89
shape1 = (N, M)
910
shape2 = (M, N)
10-
a = blosc2.ones(shape=shape1, urlpath="a.b2nd", mode='w', dtype=dtype)
11-
b = blosc2.full(fill_value=2., shape=shape2, urlpath="b.b2nd", mode='w', dtype=dtype)
11+
a = blosc2.ones(shape=shape1, urlpath="a.b2nd", mode="w", dtype=dtype)
12+
b = blosc2.full(fill_value=2.0, shape=shape2, urlpath="b.b2nd", mode="w", dtype=dtype)
1213

1314
# Expression
1415
t0 = time.time()
@@ -27,8 +28,8 @@
2728
t0 = time.time()
2829
lexpr = blosc2.open(urlpath=url_path)
2930
dt = time.time() - t0
30-
print(f"In {round(dt*1000, 3)} ms opened lazy expression: shape = {lexpr.shape}, dtype = {lexpr.dtype}")
31+
print(f"In {round(dt * 1000, 3)} ms opened lazy expression: shape = {lexpr.shape}, dtype = {lexpr.dtype}")
3132
t1 = time.time()
32-
result1 = lexpr.compute(urlpath="result.b2nd", mode='w')
33+
result1 = lexpr.compute(urlpath="result.b2nd", mode="w")
3334
t2 = time.time()
3435
print(f"blosc2 fetched operands from disk, computed {expression}, wrote to disk in: {t2 - t1:.3f} s")

0 commit comments

Comments
 (0)