Skip to content

Commit 4e37337

Browse files
committed
(chore) lint
1 parent 1c66455 commit 4e37337

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

numcodecs/tests/common.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
from __future__ import annotations
2+
23
import array
34
import json as _json
45
import os
56
from glob import glob
67
from typing import TYPE_CHECKING
8+
79
if TYPE_CHECKING:
8-
from typing import Sequence
10+
from collections.abc import Sequence
911

1012
import numpy as np
11-
from numcodecs.abc import Codec
1213
import pytest
1314
from numpy.testing import assert_array_almost_equal, assert_array_equal
1415

1516
from numcodecs import * # noqa: F403 # for eval to find names in repr tests
17+
from numcodecs.abc import Codec
1618
from numcodecs.compat import ensure_bytes, ensure_ndarray
1719
from numcodecs.registry import get_codec
1820

@@ -120,7 +122,9 @@ def check_encode_decode(arr: np.ndarray, codec: Codec, precision: int | None = N
120122
compare_arrays(arr, out, precision=precision)
121123

122124

123-
def check_encode_decode_partial(arr: np.ndarray, codec: Codec, precision: int | None = None) -> None:
125+
def check_encode_decode_partial(
126+
arr: np.ndarray, codec: Codec, precision: int | None = None
127+
) -> None:
124128
# N.B., watch out here with blosc compressor, if the itemsize of
125129
# the source buffer is different then the results of encoding
126130
# (i.e., compression) may be different. Hence we *do not* require that
@@ -247,7 +251,13 @@ def check_repr(stmt: str) -> None:
247251
assert stmt == actual
248252

249253

250-
def check_backwards_compatibility(codec_id: str, arrays: Sequence[np.ndarray], codecs: Sequence[Codec], precision: Sequence[int | None] | None = None, prefix: str | None = None) -> None:
254+
def check_backwards_compatibility(
255+
codec_id: str,
256+
arrays: Sequence[np.ndarray],
257+
codecs: Sequence[Codec],
258+
precision: Sequence[int | None] | None = None,
259+
prefix: str | None = None,
260+
) -> None:
251261
# setup directory to hold data fixture
252262
if prefix:
253263
fixture_dir = os.path.join('fixture', codec_id, prefix)

numcodecs/tests/test_checksum32.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
from contextlib import suppress
33

44
import numpy as np
5-
from numcodecs.abc import Codec
65
import pytest
76

7+
from numcodecs.abc import Codec
88
from numcodecs.checksum32 import CRC32, Adler32
99
from numcodecs.tests.common import (
1010
check_backwards_compatibility,

numcodecs/tests/test_shuffle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
2-
from multiprocessing.pool import ThreadPool, Pool
2+
3+
from multiprocessing.pool import Pool, ThreadPool
34
from typing import Literal
45

56
import numpy as np

numcodecs/tests/test_vlen_array.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def test_encode_decode() -> None:
4040
for codec in codecs:
4141
check_encode_decode_array(arr, codec)
4242

43+
4344
def test_config() -> None:
4445
codec = VLenArray('<i8')
4546
check_config(codec)

0 commit comments

Comments
 (0)