Skip to content

Commit 2ff320d

Browse files
style: pre-commit fixes
1 parent 3051b39 commit 2ff320d

File tree

2 files changed

+99
-97
lines changed

2 files changed

+99
-97
lines changed

bench/compress_normal.py

+14-11
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,39 @@
99

1010
if __name__ == "__main__":
1111

12-
sys.path.insert(0, '..')
12+
sys.path.insert(0, "..")
1313

1414
# setup
15-
a = np.random.normal(2000, 1000, size=200000000).astype('u2')
16-
z = zarr.empty_like(a, chunks=1000000,
17-
compression='blosc',
18-
compression_opts=dict(cname='lz4', clevel=5, shuffle=2))
15+
a = np.random.normal(2000, 1000, size=200000000).astype("u2")
16+
z = zarr.empty_like(
17+
a,
18+
chunks=1000000,
19+
compression="blosc",
20+
compression_opts=dict(cname="lz4", clevel=5, shuffle=2),
21+
)
1922
print(z)
2023

21-
print('*' * 79)
24+
print("*" * 79)
2225

2326
# time
24-
t = timeit.repeat('z[:] = a', repeat=10, number=1, globals=globals())
27+
t = timeit.repeat("z[:] = a", repeat=10, number=1, globals=globals())
2528
print(t)
2629
print(min(t))
2730
print(z)
2831

2932
# profile
3033
profile = line_profiler.LineProfiler(blosc.compress)
31-
profile.run('z[:] = a')
34+
profile.run("z[:] = a")
3235
profile.print_stats()
3336

34-
print('*' * 79)
37+
print("*" * 79)
3538

3639
# time
37-
t = timeit.repeat('z[:]', repeat=10, number=1, globals=globals())
40+
t = timeit.repeat("z[:]", repeat=10, number=1, globals=globals())
3841
print(t)
3942
print(min(t))
4043

4144
# profile
4245
profile = line_profiler.LineProfiler(blosc.decompress)
43-
profile.run('z[:]')
46+
profile.run("z[:]")
4447
profile.print_stats()

0 commit comments

Comments
 (0)