Skip to content

Commit bd426e7

Browse files
committed
Merge remote-tracking branch 'origin/main' into zarr3-codecs
2 parents 20aa698 + 88464f6 commit bd426e7

File tree

10 files changed

+31
-21
lines changed

10 files changed

+31
-21
lines changed

.pep8speaks.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.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"]

docs/release.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ Release notes
88
99
.. _unreleased:
1010

11+
Unreleased
12+
----------
13+
14+
Fix
15+
~~~
16+
* Fix in-place mutation of input array in `BitRound`.
17+
By :user:`Sam Levang <slevang>`, :issue:`608`
18+
19+
20+
.. _release_0.13.1:
21+
1122
0.13.1
1223
------
1324

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: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,22 +162,29 @@ line-length = 100
162162
[tool.ruff.lint]
163163
extend-select = [
164164
"B",
165+
"FLY",
166+
"FURB",
167+
"G",
165168
"I",
169+
"PERF",
166170
"PGH",
167171
"PIE",
168172
"PT",
173+
"PYI",
169174
"RSE",
170175
"RUF",
171176
"UP",
177+
# "W", https://github.com/astral-sh/ruff/issues/13763
172178
]
173179
ignore = [
174180
"B028",
175181
"B904",
182+
"FURB101",
183+
"FURB103",
176184
"PT001",
177185
"PT004", # deprecated
178186
"PT005", # deprecated
179187
"PT011",
180-
"PT012",
181188
"RUF001",
182189
"UP007",
183190
"UP027", # deprecated

0 commit comments

Comments
 (0)