Skip to content

Commit

Permalink
chore: update pre-commit hooks (#1642)
Browse files Browse the repository at this point in the history
* chore: update pre-commit hooks

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.14 → v0.2.1](astral-sh/ruff-pre-commit@v0.1.14...v0.2.1)
- [github.com/psf/black: 23.12.1 → 24.2.0](psf/black@23.12.1...24.2.0)

* run black incl. comments for '...'

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Josh Moore <josh@openmicroscopy.org>
  • Loading branch information
pre-commit-ci[bot] and joshmoore committed Feb 14, 2024
1 parent e50b471 commit 81bbb2e
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ default_language_version:
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.1.14'
rev: 'v0.2.1'
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.2.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
Expand Down
1 change: 1 addition & 0 deletions zarr/convenience.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Convenience functions for storing and loading data."""

import itertools
import os
import re
Expand Down
8 changes: 5 additions & 3 deletions zarr/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2060,9 +2060,11 @@ def _process_chunk(
index_selection = PartialChunkIterator(chunk_selection, self.chunks)
for start, nitems, partial_out_selection in index_selection:
expected_shape = [
len(range(*partial_out_selection[i].indices(self.chunks[0] + 1)))
if i < len(partial_out_selection)
else dim
(
len(range(*partial_out_selection[i].indices(self.chunks[0] + 1)))
if i < len(partial_out_selection)
else dim
)
for i, dim in enumerate(self.chunks)
]
if isinstance(cdata, UncompressedPartialReadBufferV3):
Expand Down
10 changes: 5 additions & 5 deletions zarr/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,11 +545,11 @@ def ix_(selection, shape):

# replace slice and int as these are not supported by numpy.ix_
selection = [
slice_to_range(dim_sel, dim_len)
if isinstance(dim_sel, slice)
else [dim_sel]
if is_integer(dim_sel)
else dim_sel
(
slice_to_range(dim_sel, dim_len)
if isinstance(dim_sel, slice)
else [dim_sel] if is_integer(dim_sel) else dim_sel
)
for dim_sel, dim_len in zip(selection, shape)
]

Expand Down
1 change: 1 addition & 0 deletions zarr/n5.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""This module contains a storage class and codec to support the N5 format.
"""

import os
import struct
import sys
Expand Down
1 change: 1 addition & 0 deletions zarr/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
path) and a `getsize` method (return the size in bytes of a given value).
"""

import atexit
import errno
import glob
Expand Down
1 change: 1 addition & 0 deletions zarr/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class Synchronizer(Protocol):
"""Base class for synchronizers."""

def __getitem__(self, item):
# see subclasses
...


Expand Down
1 change: 1 addition & 0 deletions zarr/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@

class MetaArray(Protocol):
def __array_function__(self, func, types, args, kwargs):
# To be extended
...

0 comments on commit 81bbb2e

Please sign in to comment.