Skip to content

Commit 3d8d9e2

Browse files
committed
Merge remote-tracking branch 'origin/main' into crc32c
2 parents 5a6891d + 88464f6 commit 3d8d9e2

File tree

8 files changed

+12
-17
lines changed

8 files changed

+12
-17
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repos:
1515
- id: debug-statements
1616

1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.6.9
18+
rev: v0.7.0
1919
hooks:
2020
- id: ruff
2121
args: ["--fix", "--show-fixes"]

numcodecs/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ruff: noqa: E402,F401
1+
# ruff: noqa: E402
22
"""Numcodecs is a Python package providing buffer compression and
33
transformation codecs for use in data storage and communication
44
applications. These include:
@@ -21,8 +21,9 @@
2121
import multiprocessing
2222
from contextlib import suppress
2323

24-
from numcodecs.registry import get_codec, register_codec
25-
from numcodecs.version import version as __version__
24+
from numcodecs.registry import get_codec as get_codec
25+
from numcodecs.registry import register_codec
26+
from numcodecs.version import version as __version__ # noqa: F401
2627
from numcodecs.zlib import Zlib
2728

2829
register_codec(Zlib)
@@ -55,13 +56,13 @@
5556
atexit.register(blosc.destroy)
5657

5758
with suppress(ImportError):
58-
from numcodecs import zstd
59+
from numcodecs import zstd as zstd
5960
from numcodecs.zstd import Zstd
6061

6162
register_codec(Zstd)
6263

6364
with suppress(ImportError):
64-
from numcodecs import lz4
65+
from numcodecs import lz4 as lz4
6566
from numcodecs.lz4 import LZ4
6667

6768
register_codec(LZ4)
@@ -127,7 +128,7 @@
127128
register_codec(JSON)
128129

129130
with suppress(ImportError):
130-
from numcodecs import vlen
131+
from numcodecs import vlen as vlen
131132
from numcodecs.vlen import VLenArray, VLenBytes, VLenUTF8
132133

133134
register_codec(VLenUTF8)

numcodecs/compat.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
# ruff: noqa: F401
21
import array
32
import codecs
4-
import functools
53

64
import numpy as np
75

numcodecs/packbits.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ class PackBits(Codec):
2929

3030
codec_id = 'packbits'
3131

32-
def __init__(self):
33-
pass
34-
3532
def encode(self, buf):
3633
# normalise input
3734
arr = ensure_ndarray(buf).view(bool)

numcodecs/tests/test_entrypoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
here = os.path.abspath(os.path.dirname(__file__))
99

1010

11-
@pytest.fixture()
11+
@pytest.fixture
1212
def set_path():
1313
sys.path.append(here)
1414
numcodecs.registry.run_entrypoints()

numcodecs/tests/test_pcodec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def test_config():
5757

5858

5959
def test_invalid_config_error():
60+
codec = PCodec(mode_spec='bogus')
6061
with pytest.raises(ValueError):
61-
codec = PCodec(mode_spec='bogus')
6262
check_encode_decode_array_to_bytes(arrays[0], codec)
6363

6464

numcodecs/tests/test_shuffle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def test_expected_result():
162162

163163

164164
def test_incompatible_elementsize():
165+
arr = np.arange(1001, dtype='u1')
166+
codec = Shuffle(elementsize=4)
165167
with pytest.raises(ValueError):
166-
arr = np.arange(1001, dtype='u1')
167-
codec = Shuffle(elementsize=4)
168168
codec.encode(arr)

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ ignore = [
163163
"PT004", # deprecated
164164
"PT005", # deprecated
165165
"PT011",
166-
"PT012",
167166
"RUF001",
168167
"UP007",
169168
"UP027", # deprecated

0 commit comments

Comments
 (0)