Skip to content

Precommit formatting #1321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/needs_release_notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:

jobs:
triage:
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }} && ${{ github.event.pull_request.user.login != 'pre-commit-ci[bot]' }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this get dropped?

runs-on: ubuntu-latest
steps:
- uses: actions/labeler@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
with:
name: releases
path: dist
- uses: pypa/gh-action-pypi-publish@v1.6.4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I think this is reverting things that have hit the mainline.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, and I'm not sure why this is happening -- possibly we've reached the limits of my experience with git. When I run git pull upstream main, git claims everything is up to date, but clearly there's lots of recent commits on mainline that are missing from this PR. Any advice?

- uses: pypa/gh-action-pypi-publish@v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
Expand Down
22 changes: 13 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,24 @@ default_stages: [commit, push]
default_language_version:
python: python3
repos:
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.0.223'
hooks:
- id: flake8
args: [
--max-line-length=100
]
exclude: ^(venv/|docs/)
types: ['python']
- 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.9
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: codespell
args: ["-L", "ba,ihs,kake,nd,noe,nwo,te", "-S", "fixture"]
additional_dependencies:
- tomli
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
Expand Down
25 changes: 14 additions & 11 deletions bench/compress_normal.py
Original file line number Diff line number Diff line change
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()
Loading