Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jul 12, 2023
1 parent 9c8137a commit 499f45e
Show file tree
Hide file tree
Showing 37 changed files with 5,855 additions and 5,287 deletions.
25 changes: 14 additions & 11 deletions bench/compress_normal.py
Expand Up @@ -9,36 +9,39 @@

if __name__ == "__main__":

sys.path.insert(0, '..')
sys.path.insert(0, "..")

# setup
a = np.random.normal(2000, 1000, size=200000000).astype('u2')
z = zarr.empty_like(a, chunks=1000000,
compression='blosc',
compression_opts=dict(cname='lz4', clevel=5, shuffle=2))
a = np.random.normal(2000, 1000, size=200000000).astype("u2")
z = zarr.empty_like(
a,
chunks=1000000,
compression="blosc",
compression_opts=dict(cname="lz4", clevel=5, shuffle=2),
)
print(z)

print('*' * 79)
print("*" * 79)

# time
t = timeit.repeat('z[:] = a', repeat=10, number=1, globals=globals())
t = timeit.repeat("z[:] = a", repeat=10, number=1, globals=globals())
print(t)
print(min(t))
print(z)

# profile
profile = line_profiler.LineProfiler(blosc.compress)
profile.run('z[:] = a')
profile.run("z[:] = a")
profile.print_stats()

print('*' * 79)
print("*" * 79)

# time
t = timeit.repeat('z[:]', repeat=10, number=1, globals=globals())
t = timeit.repeat("z[:]", repeat=10, number=1, globals=globals())
print(t)
print(min(t))

# profile
profile = line_profiler.LineProfiler(blosc.decompress)
profile.run('z[:]')
profile.run("z[:]")
profile.print_stats()

0 comments on commit 499f45e

Please sign in to comment.