Skip to content

Commit b284631

Browse files
Apply ruff/pygrep-hooks rule PGH004
PGH004 Use specific rule codes when using `noqa`
1 parent 602dca9 commit b284631

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

src/zarr/api/asynchronous.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import asyncio
44
import warnings
5-
from typing import TYPE_CHECKING, Any, Literal, Union, cast
5+
from typing import TYPE_CHECKING, Any, Literal, cast
66

77
import numpy as np
88
import numpy.typing as npt
@@ -25,6 +25,10 @@
2525
from zarr.core.buffer import NDArrayLike
2626
from zarr.core.chunk_key_encodings import ChunkKeyEncoding
2727

28+
# TODO: this type could use some more thought
29+
ArrayLike = AsyncArray | Array | npt.NDArray[Any]
30+
PathLike = str
31+
2832
__all__ = [
2933
"consolidate_metadata",
3034
"copy",
@@ -53,10 +57,6 @@
5357
"zeros_like",
5458
]
5559

56-
# TODO: this type could use some more thought, noqa to avoid "Variable "asynchronous.ArrayLike" is not valid as a type"
57-
ArrayLike = Union[AsyncArray | Array | npt.NDArray[Any]] # noqa
58-
PathLike = str
59-
6060

6161
def _get_shape_chunks(a: ArrayLike | Any) -> tuple[ChunkCoords | None, ChunkCoords | None]:
6262
"""helper function to get the shape and chunks from an array-like object"""

src/zarr/testing/strategies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import hypothesis.extra.numpy as npst
55
import hypothesis.strategies as st
66
import numpy as np
7-
from hypothesis import given, settings # noqa
7+
from hypothesis import given, settings # noqa: F401
88
from hypothesis.strategies import SearchStrategy
99

1010
from zarr.core.array import Array

tests/v3/test_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ async def test_asyncgroup_attrs(store: Store, zarr_format: ZarrFormat) -> None:
550550

551551

552552
async def test_asyncgroup_info(store: Store, zarr_format: ZarrFormat) -> None:
553-
agroup = await AsyncGroup.from_store( # noqa
553+
agroup = await AsyncGroup.from_store( # noqa: F841
554554
store,
555555
zarr_format=zarr_format,
556556
)

tests/v3/test_properties.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
pytest.importorskip("hypothesis")
66

7-
import hypothesis.extra.numpy as npst # noqa
8-
import hypothesis.strategies as st # noqa
9-
from hypothesis import given, settings # noqa
10-
from zarr.testing.strategies import arrays, np_arrays, basic_indices # noqa
7+
import hypothesis.extra.numpy as npst # noqa: E402
8+
import hypothesis.strategies as st # noqa: E402
9+
from hypothesis import given # noqa: E402
10+
11+
from zarr.testing.strategies import arrays, basic_indices, np_arrays # noqa: E402
1112

1213

1314
@given(st.data())

0 commit comments

Comments
 (0)