Skip to content

Commit 4d84823

Browse files
authored
Merge branch 'main' into pre-commit-ci-update-config
2 parents 44d6ba9 + 13cdbff commit 4d84823

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+6202
-5562
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# lint codebase with black and ruff
2+
4e348d6b80c96da461fd866576c971b8a659ba15

.github/workflows/releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
with:
6565
name: releases
6666
path: dist
67-
- uses: pypa/[email protected].6
67+
- uses: pypa/[email protected].7
6868
with:
6969
user: __token__
7070
password: ${{ secrets.pypi_password }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ __pycache__/
88
# Distribution / packaging
99
.Python
1010
env/
11+
.venv/
1112
build/
1213
develop-eggs/
1314
dist/

.pre-commit-config.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@ default_stages: [commit, push]
55
default_language_version:
66
python: python3
77
repos:
8-
- repo: https://github.com/PyCQA/flake8
9-
rev: 6.0.0
8+
- repo: https://github.com/charliermarsh/ruff-pre-commit
9+
# Ruff version.
10+
rev: 'v0.0.224'
1011
hooks:
11-
- id: flake8
12-
args: [
13-
--max-line-length=100
14-
]
15-
exclude: ^(venv/|docs/)
16-
types: ['python']
12+
- id: ruff
13+
# Respect `exclude` and `extend-exclude` settings.
14+
args: ["--force-exclude"]
15+
- repo: https://github.com/psf/black
16+
rev: 22.12.0
17+
hooks:
18+
- id: black
19+
language_version: python3.8
1720
- repo: https://github.com/codespell-project/codespell
1821
rev: v2.2.5
1922
hooks:
2023
- id: codespell
21-
args: ["-L", "ba,ihs,kake,nd,noe,nwo,te,fo", "-S", "fixture"]
24+
args: ["-L", "ba,ihs,kake,nd,noe,nwo,te,fo,zar", "-S", "fixture"]
2225
- repo: https://github.com/pre-commit/pre-commit-hooks
2326
rev: v4.4.0
2427
hooks:

bench/compress_normal.py

Lines changed: 14 additions & 11 deletions
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()

docs/api/core.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ The Array class (``zarr.core``)
1010
.. automethod:: set_basic_selection
1111
.. automethod:: get_mask_selection
1212
.. automethod:: set_mask_selection
13+
.. automethod:: get_block_selection
14+
.. automethod:: set_block_selection
1315
.. automethod:: get_coordinate_selection
1416
.. automethod:: set_coordinate_selection
1517
.. automethod:: get_orthogonal_selection

0 commit comments

Comments
 (0)