Skip to content

Commit

Permalink
Revert "style: add ruff and black to pre-commit (#1459)"
Browse files Browse the repository at this point in the history
This reverts commit 9043fb7.
  • Loading branch information
rabernat authored Jul 18, 2023
1 parent 9043fb7 commit fb190b4
Show file tree
Hide file tree
Showing 41 changed files with 4,967 additions and 5,401 deletions.
2 changes: 0 additions & 2 deletions .git-blame-ignore-revs

This file was deleted.

21 changes: 9 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,20 @@ default_stages: [commit, push]
default_language_version:
python: python3
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.0.224'
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: ruff
# Respect `exclude` and `extend-exclude` settings.
args: ["--force-exclude"]
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
language_version: python3.8
- id: flake8
args: [
--max-line-length=100
]
exclude: ^(venv/|docs/)
types: ['python']
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell
args: ["-L", "ba,ihs,kake,nd,noe,nwo,te,fo,zar", "-S", "fixture"]
args: ["-L", "ba,ihs,kake,nd,noe,nwo,te,fo", "-S", "fixture"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
Expand Down
25 changes: 11 additions & 14 deletions bench/compress_normal.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,36 @@

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()
Loading

0 comments on commit fb190b4

Please sign in to comment.