numcodecs 0.13.0__cp312-cp312-win_amd64.whl → 0.13.1__cp312-cp312-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of numcodecs might be problematic. Click here for more details.

Files changed (68) hide show
  1. numcodecs/__init__.py +4 -6
  2. numcodecs/_shuffle.cp312-win_amd64.pyd +0 -0
  3. numcodecs/abc.py +2 -4
  4. numcodecs/astype.py +2 -4
  5. numcodecs/bitround.py +0 -1
  6. numcodecs/blosc.cp312-win_amd64.pyd +0 -0
  7. numcodecs/bz2.py +1 -2
  8. numcodecs/categorize.py +5 -12
  9. numcodecs/checksum32.py +1 -3
  10. numcodecs/compat.py +4 -6
  11. numcodecs/compat_ext.cp312-win_amd64.pyd +0 -0
  12. numcodecs/delta.py +2 -3
  13. numcodecs/fixedscaleoffset.py +3 -9
  14. numcodecs/fletcher32.cp312-win_amd64.pyd +0 -0
  15. numcodecs/jenkins.cp312-win_amd64.pyd +0 -0
  16. numcodecs/json.py +7 -8
  17. numcodecs/lz4.cp312-win_amd64.pyd +0 -0
  18. numcodecs/lzma.py +2 -9
  19. numcodecs/msgpacks.py +2 -5
  20. numcodecs/ndarray_like.py +4 -4
  21. numcodecs/packbits.py +0 -1
  22. numcodecs/pcodec.py +2 -2
  23. numcodecs/pickles.py +1 -1
  24. numcodecs/quantize.py +4 -10
  25. numcodecs/registry.py +2 -2
  26. numcodecs/shuffle.py +4 -4
  27. numcodecs/tests/common.py +7 -11
  28. numcodecs/tests/test_astype.py +2 -4
  29. numcodecs/tests/test_base64.py +2 -5
  30. numcodecs/tests/test_bitround.py +0 -1
  31. numcodecs/tests/test_blosc.py +2 -5
  32. numcodecs/tests/test_bz2.py +3 -6
  33. numcodecs/tests/test_categorize.py +3 -5
  34. numcodecs/tests/test_checksum32.py +3 -6
  35. numcodecs/tests/test_compat.py +1 -3
  36. numcodecs/tests/test_delta.py +3 -5
  37. numcodecs/tests/test_entrypoints.py +0 -1
  38. numcodecs/tests/test_entrypoints_backport.py +3 -4
  39. numcodecs/tests/test_fixedscaleoffset.py +3 -6
  40. numcodecs/tests/test_gzip.py +3 -6
  41. numcodecs/tests/test_jenkins.py +33 -33
  42. numcodecs/tests/test_json.py +2 -2
  43. numcodecs/tests/test_lz4.py +3 -6
  44. numcodecs/tests/test_lzma.py +5 -8
  45. numcodecs/tests/test_msgpacks.py +4 -7
  46. numcodecs/tests/test_packbits.py +2 -4
  47. numcodecs/tests/test_pcodec.py +4 -5
  48. numcodecs/tests/test_pickles.py +2 -3
  49. numcodecs/tests/test_quantize.py +3 -6
  50. numcodecs/tests/test_registry.py +4 -4
  51. numcodecs/tests/test_shuffle.py +2 -5
  52. numcodecs/tests/test_vlen_array.py +5 -6
  53. numcodecs/tests/test_vlen_bytes.py +5 -6
  54. numcodecs/tests/test_vlen_utf8.py +5 -8
  55. numcodecs/tests/test_zfpy.py +4 -8
  56. numcodecs/tests/test_zlib.py +4 -7
  57. numcodecs/tests/test_zstd.py +6 -9
  58. numcodecs/version.py +2 -2
  59. numcodecs/vlen.cp312-win_amd64.pyd +0 -0
  60. numcodecs/zfpy.py +9 -10
  61. numcodecs/zlib.py +1 -2
  62. numcodecs/zstd.cp312-win_amd64.pyd +0 -0
  63. {numcodecs-0.13.0.dist-info → numcodecs-0.13.1.dist-info}/METADATA +3 -3
  64. numcodecs-0.13.1.dist-info/RECORD +74 -0
  65. {numcodecs-0.13.0.dist-info → numcodecs-0.13.1.dist-info}/WHEEL +1 -1
  66. numcodecs-0.13.0.dist-info/RECORD +0 -74
  67. {numcodecs-0.13.0.dist-info → numcodecs-0.13.1.dist-info}/LICENSE.txt +0 -0
  68. {numcodecs-0.13.0.dist-info → numcodecs-0.13.1.dist-info}/top_level.txt +0 -0
@@ -5,7 +5,6 @@ import pytest
5
5
 
6
6
  import numcodecs.registry
7
7
 
8
-
9
8
  here = os.path.abspath(os.path.dirname(__file__))
10
9
 
11
10
 
@@ -1,14 +1,13 @@
1
+ import importlib
1
2
  import os.path
2
- import pkgutil
3
3
  import sys
4
+ from multiprocessing import Process
4
5
 
5
6
  import pytest
6
7
 
7
- from multiprocessing import Process
8
-
9
8
  import numcodecs.registry
10
9
 
11
- if not pkgutil.find_loader("importlib_metadata"): # pragma: no cover
10
+ if not importlib.util.find_spec("importlib_metadata").loader: # pragma: no cover
12
11
  pytest.skip(
13
12
  "This test module requires importlib_metadata to be installed",
14
13
  allow_module_level=True,
@@ -1,20 +1,17 @@
1
1
  import itertools
2
2
 
3
-
4
3
  import numpy as np
5
- from numpy.testing import assert_array_equal
6
4
  import pytest
7
-
5
+ from numpy.testing import assert_array_equal
8
6
 
9
7
  from numcodecs.fixedscaleoffset import FixedScaleOffset
10
8
  from numcodecs.tests.common import (
11
- check_encode_decode,
9
+ check_backwards_compatibility,
12
10
  check_config,
11
+ check_encode_decode,
13
12
  check_repr,
14
- check_backwards_compatibility,
15
13
  )
16
14
 
17
-
18
15
  arrays = [
19
16
  np.linspace(1000, 1001, 1000, dtype='<f8'),
20
17
  np.random.normal(loc=1000, scale=1, size=1000).astype('<f8'),
@@ -1,21 +1,18 @@
1
1
  import itertools
2
2
 
3
-
4
3
  import numpy as np
5
4
  import pytest
6
5
 
7
-
8
6
  from numcodecs.gzip import GZip
9
7
  from numcodecs.tests.common import (
10
- check_encode_decode,
11
- check_config,
12
- check_repr,
13
8
  check_backwards_compatibility,
9
+ check_config,
10
+ check_encode_decode,
14
11
  check_err_decode_object_buffer,
15
12
  check_err_encode_object_buffer,
13
+ check_repr,
16
14
  )
17
15
 
18
-
19
16
  codecs = [
20
17
  GZip(),
21
18
  GZip(level=-1),
@@ -1,8 +1,8 @@
1
1
  import numpy as np
2
2
  import pytest
3
3
 
4
- from numcodecs.jenkins import jenkins_lookup3
5
4
  from numcodecs.checksum32 import JenkinsLookup3
5
+ from numcodecs.jenkins import jenkins_lookup3
6
6
 
7
7
 
8
8
  def test_jenkins_lookup3():
@@ -84,38 +84,38 @@ def test_jenkins_lookup3_codec():
84
84
 
85
85
  chunk_index = (
86
86
  b"\x00\x08\x00\x00\x00\x00\x00\x00"
87
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
88
- + b"\xf7\x17\x00\x00\x00\x00\x00\x00"
89
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
90
- + b"\xee'\x00\x00\x00\x00\x00\x00"
91
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
92
- + b"\xe57\x00\x00\x00\x00\x00\x00"
93
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
94
- + b"\xdcG\x00\x00\x00\x00\x00\x00"
95
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
96
- + b"\xd3W\x00\x00\x00\x00\x00\x00"
97
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
98
- + b"\xcag\x00\x00\x00\x00\x00\x00"
99
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
100
- + b"\xc1w\x00\x00\x00\x00\x00\x00"
101
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
102
- + b"\xb8\x87\x00\x00\x00\x00\x00\x00"
103
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
104
- + b"\xaf\x97\x00\x00\x00\x00\x00\x00"
105
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
106
- + b"\xa6\xa7\x00\x00\x00\x00\x00\x00"
107
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
108
- + b"\x9d\xb7\x00\x00\x00\x00\x00\x00"
109
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
110
- + b"\x94\xc7\x00\x00\x00\x00\x00\x00"
111
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
112
- + b"\x8b\xd7\x00\x00\x00\x00\x00\x00"
113
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
114
- + b"\x82\xe7\x00\x00\x00\x00\x00\x00"
115
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
116
- + b"y\xf7\x00\x00\x00\x00\x00\x00"
117
- + b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
118
- + b"n\x96\x07\x85"
87
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
88
+ b"\xf7\x17\x00\x00\x00\x00\x00\x00"
89
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
90
+ b"\xee'\x00\x00\x00\x00\x00\x00"
91
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
92
+ b"\xe57\x00\x00\x00\x00\x00\x00"
93
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
94
+ b"\xdcG\x00\x00\x00\x00\x00\x00"
95
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
96
+ b"\xd3W\x00\x00\x00\x00\x00\x00"
97
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
98
+ b"\xcag\x00\x00\x00\x00\x00\x00"
99
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
100
+ b"\xc1w\x00\x00\x00\x00\x00\x00"
101
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
102
+ b"\xb8\x87\x00\x00\x00\x00\x00\x00"
103
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
104
+ b"\xaf\x97\x00\x00\x00\x00\x00\x00"
105
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
106
+ b"\xa6\xa7\x00\x00\x00\x00\x00\x00"
107
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
108
+ b"\x9d\xb7\x00\x00\x00\x00\x00\x00"
109
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
110
+ b"\x94\xc7\x00\x00\x00\x00\x00\x00"
111
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
112
+ b"\x8b\xd7\x00\x00\x00\x00\x00\x00"
113
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
114
+ b"\x82\xe7\x00\x00\x00\x00\x00\x00"
115
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
116
+ b"y\xf7\x00\x00\x00\x00\x00\x00"
117
+ b"\xf7\x0f\x00\x00\x00\x00\x00\x00"
118
+ b"n\x96\x07\x85"
119
119
  )
120
120
  hdf5_fadb_prefix = b'FADB\x00\x01\xcf\x01\x00\x00\x00\x00\x00\x00'
121
121
  j = JenkinsLookup3(prefix=hdf5_fadb_prefix)
@@ -5,10 +5,10 @@ import pytest
5
5
 
6
6
  from numcodecs.json import JSON
7
7
  from numcodecs.tests.common import (
8
+ check_backwards_compatibility,
8
9
  check_config,
9
- check_repr,
10
10
  check_encode_decode_array,
11
- check_backwards_compatibility,
11
+ check_repr,
12
12
  greetings,
13
13
  )
14
14
 
@@ -1,10 +1,8 @@
1
1
  import itertools
2
2
 
3
-
4
3
  import numpy as np
5
4
  import pytest
6
5
 
7
-
8
6
  try:
9
7
  from numcodecs.lz4 import LZ4
10
8
  except ImportError: # pragma: no cover
@@ -12,16 +10,15 @@ except ImportError: # pragma: no cover
12
10
 
13
11
 
14
12
  from numcodecs.tests.common import (
15
- check_encode_decode,
16
- check_config,
17
- check_repr,
18
13
  check_backwards_compatibility,
14
+ check_config,
15
+ check_encode_decode,
19
16
  check_err_decode_object_buffer,
20
17
  check_err_encode_object_buffer,
21
18
  check_max_buffer_size,
19
+ check_repr,
22
20
  )
23
21
 
24
-
25
22
  codecs = [
26
23
  LZ4(),
27
24
  LZ4(acceleration=-1),
@@ -1,28 +1,25 @@
1
1
  import itertools
2
2
  import unittest
3
3
 
4
-
5
4
  import numpy as np
6
5
  import pytest
7
6
 
8
-
9
7
  try:
10
8
  # noinspection PyProtectedMember
11
9
  from numcodecs.lzma import LZMA, _lzma
12
- except ImportError: # pragma: no cover
13
- raise unittest.SkipTest("LZMA not available")
10
+ except ImportError as e: # pragma: no cover
11
+ raise unittest.SkipTest("LZMA not available") from e
14
12
 
15
13
 
16
14
  from numcodecs.tests.common import (
17
- check_encode_decode,
18
- check_config,
19
- check_repr,
20
15
  check_backwards_compatibility,
16
+ check_config,
17
+ check_encode_decode,
21
18
  check_err_decode_object_buffer,
22
19
  check_err_encode_object_buffer,
20
+ check_repr,
23
21
  )
24
22
 
25
-
26
23
  codecs = [
27
24
  LZMA(),
28
25
  LZMA(preset=1),
@@ -1,25 +1,22 @@
1
1
  import unittest
2
2
 
3
-
4
3
  import numpy as np
5
4
  import pytest
6
5
 
7
-
8
6
  try:
9
7
  from numcodecs.msgpacks import MsgPack
10
- except ImportError: # pragma: no cover
11
- raise unittest.SkipTest("msgpack not available")
8
+ except ImportError as e: # pragma: no cover
9
+ raise unittest.SkipTest("msgpack not available") from e
12
10
 
13
11
 
14
12
  from numcodecs.tests.common import (
13
+ check_backwards_compatibility,
15
14
  check_config,
16
- check_repr,
17
15
  check_encode_decode_array,
18
- check_backwards_compatibility,
16
+ check_repr,
19
17
  greetings,
20
18
  )
21
19
 
22
-
23
20
  # object array with strings
24
21
  # object array with mix strings / nans
25
22
  # object array with mix of string, int, float
@@ -1,15 +1,13 @@
1
1
  import numpy as np
2
2
 
3
-
4
3
  from numcodecs.packbits import PackBits
5
4
  from numcodecs.tests.common import (
6
- check_encode_decode,
5
+ check_backwards_compatibility,
7
6
  check_config,
7
+ check_encode_decode,
8
8
  check_repr,
9
- check_backwards_compatibility,
10
9
  )
11
10
 
12
-
13
11
  arrays = [
14
12
  np.random.randint(0, 2, size=1000, dtype=bool),
15
13
  np.random.randint(0, 2, size=(100, 10), dtype=bool),
@@ -1,5 +1,5 @@
1
- import pytest
2
1
  import numpy as np
2
+ import pytest
3
3
 
4
4
  from numcodecs.pcodec import PCodec
5
5
 
@@ -10,15 +10,14 @@ except ImportError: # pragma: no cover
10
10
  pytest.skip("pcodec not available", allow_module_level=True)
11
11
 
12
12
  from numcodecs.tests.common import (
13
- check_encode_decode_array_to_bytes,
14
- check_config,
15
- check_repr,
16
13
  check_backwards_compatibility,
14
+ check_config,
15
+ check_encode_decode_array_to_bytes,
17
16
  check_err_decode_object_buffer,
18
17
  check_err_encode_object_buffer,
18
+ check_repr,
19
19
  )
20
20
 
21
-
22
21
  codecs = [
23
22
  PCodec(),
24
23
  PCodec(level=1),
@@ -6,14 +6,13 @@ import pytest
6
6
 
7
7
  from numcodecs.pickles import Pickle
8
8
  from numcodecs.tests.common import (
9
+ check_backwards_compatibility,
9
10
  check_config,
10
- check_repr,
11
11
  check_encode_decode_array,
12
- check_backwards_compatibility,
12
+ check_repr,
13
13
  greetings,
14
14
  )
15
15
 
16
-
17
16
  codecs = [Pickle(protocol=i) for i in range(5)]
18
17
 
19
18
  # object array with strings
@@ -1,20 +1,17 @@
1
1
  import itertools
2
2
 
3
-
4
3
  import numpy as np
5
- from numpy.testing import assert_array_equal, assert_array_almost_equal
6
4
  import pytest
7
-
5
+ from numpy.testing import assert_array_almost_equal, assert_array_equal
8
6
 
9
7
  from numcodecs.quantize import Quantize
10
8
  from numcodecs.tests.common import (
11
- check_encode_decode,
9
+ check_backwards_compatibility,
12
10
  check_config,
11
+ check_encode_decode,
13
12
  check_repr,
14
- check_backwards_compatibility,
15
13
  )
16
14
 
17
-
18
15
  arrays = [
19
16
  np.linspace(100, 200, 1000, dtype='<f8'),
20
17
  np.random.normal(loc=0, scale=1, size=1000).astype('<f8'),
@@ -1,7 +1,7 @@
1
- import pytest
2
-
3
1
  import inspect
4
2
 
3
+ import pytest
4
+
5
5
  import numcodecs
6
6
  from numcodecs.registry import get_codec
7
7
 
@@ -27,8 +27,8 @@ def test_all_classes_registered():
27
27
  see #346 for more info
28
28
  """
29
29
  missing = set()
30
- for name, submod in inspect.getmembers(numcodecs, inspect.ismodule):
31
- for name, obj in inspect.getmembers(submod):
30
+ for _name, submod in inspect.getmembers(numcodecs, inspect.ismodule):
31
+ for _name, obj in inspect.getmembers(submod):
32
32
  if inspect.isclass(obj):
33
33
  if issubclass(obj, numcodecs.abc.Codec):
34
34
  if obj.codec_id not in numcodecs.registry.codec_registry:
@@ -1,11 +1,9 @@
1
1
  from multiprocessing import Pool
2
2
  from multiprocessing.pool import ThreadPool
3
3
 
4
-
5
4
  import numpy as np
6
5
  import pytest
7
6
 
8
-
9
7
  try:
10
8
  from numcodecs.shuffle import Shuffle
11
9
  except ImportError: # pragma: no cover
@@ -13,12 +11,11 @@ except ImportError: # pragma: no cover
13
11
 
14
12
 
15
13
  from numcodecs.tests.common import (
16
- check_encode_decode,
17
- check_config,
18
14
  check_backwards_compatibility,
15
+ check_config,
16
+ check_encode_decode,
19
17
  )
20
18
 
21
-
22
19
  codecs = [
23
20
  Shuffle(),
24
21
  Shuffle(elementsize=0),
@@ -5,17 +5,16 @@ import pytest
5
5
 
6
6
  try:
7
7
  from numcodecs.vlen import VLenArray
8
- except ImportError: # pragma: no cover
9
- raise unittest.SkipTest("vlen-array not available")
8
+ except ImportError as e: # pragma: no cover
9
+ raise unittest.SkipTest("vlen-array not available") from e
10
10
  from numcodecs.tests.common import (
11
+ assert_array_items_equal,
12
+ check_backwards_compatibility,
11
13
  check_config,
12
- check_repr,
13
14
  check_encode_decode_array,
14
- check_backwards_compatibility,
15
- assert_array_items_equal,
15
+ check_repr,
16
16
  )
17
17
 
18
-
19
18
  arrays = [
20
19
  np.array([np.array([1, 2, 3]), np.array([4]), np.array([5, 6])] * 300, dtype=object),
21
20
  np.array([np.array([1, 2, 3]), np.array([4]), np.array([5, 6])] * 300, dtype=object).reshape(
@@ -5,18 +5,17 @@ import pytest
5
5
 
6
6
  try:
7
7
  from numcodecs.vlen import VLenBytes
8
- except ImportError: # pragma: no cover
9
- raise unittest.SkipTest("vlen-bytes not available")
8
+ except ImportError as e: # pragma: no cover
9
+ raise unittest.SkipTest("vlen-bytes not available") from e
10
10
  from numcodecs.tests.common import (
11
+ assert_array_items_equal,
12
+ check_backwards_compatibility,
11
13
  check_config,
12
- check_repr,
13
14
  check_encode_decode_array,
14
- check_backwards_compatibility,
15
+ check_repr,
15
16
  greetings,
16
- assert_array_items_equal,
17
17
  )
18
18
 
19
-
20
19
  greetings_bytes = [g.encode('utf-8') for g in greetings]
21
20
 
22
21
 
@@ -1,24 +1,21 @@
1
1
  import unittest
2
2
 
3
-
4
3
  import numpy as np
5
4
  import pytest
6
5
 
7
-
8
6
  try:
9
7
  from numcodecs.vlen import VLenUTF8
10
- except ImportError: # pragma: no cover
11
- raise unittest.SkipTest("vlen-utf8 not available")
8
+ except ImportError as e: # pragma: no cover
9
+ raise unittest.SkipTest("vlen-utf8 not available") from e
12
10
  from numcodecs.tests.common import (
11
+ assert_array_items_equal,
12
+ check_backwards_compatibility,
13
13
  check_config,
14
- check_repr,
15
14
  check_encode_decode_array,
16
- check_backwards_compatibility,
15
+ check_repr,
17
16
  greetings,
18
- assert_array_items_equal,
19
17
  )
20
18
 
21
-
22
19
  arrays = [
23
20
  np.array(['foo', 'bar', 'baz'] * 300, dtype=object),
24
21
  np.array(greetings * 100, dtype=object),
@@ -1,8 +1,5 @@
1
- import pytest
2
-
3
-
4
1
  import numpy as np
5
-
2
+ import pytest
6
3
 
7
4
  try:
8
5
  # noinspection PyProtectedMember
@@ -12,15 +9,14 @@ except ImportError: # pragma: no cover
12
9
 
13
10
 
14
11
  from numcodecs.tests.common import (
15
- check_encode_decode_array,
16
- check_config,
17
- check_repr,
18
12
  check_backwards_compatibility,
13
+ check_config,
14
+ check_encode_decode_array,
19
15
  check_err_decode_object_buffer,
20
16
  check_err_encode_object_buffer,
17
+ check_repr,
21
18
  )
22
19
 
23
-
24
20
  codecs = [
25
21
  ZFPY(mode=_zfpy.mode_fixed_rate, rate=-1),
26
22
  ZFPY(),
@@ -1,20 +1,17 @@
1
1
  import itertools
2
2
 
3
-
4
3
  import numpy as np
5
4
  import pytest
6
5
 
7
-
8
- from numcodecs.zlib import Zlib
9
6
  from numcodecs.tests.common import (
10
- check_encode_decode,
11
- check_config,
12
- check_repr,
13
7
  check_backwards_compatibility,
8
+ check_config,
9
+ check_encode_decode,
14
10
  check_err_decode_object_buffer,
15
11
  check_err_encode_object_buffer,
12
+ check_repr,
16
13
  )
17
-
14
+ from numcodecs.zlib import Zlib
18
15
 
19
16
  codecs = [
20
17
  Zlib(),
@@ -1,10 +1,8 @@
1
1
  import itertools
2
2
 
3
-
4
3
  import numpy as np
5
4
  import pytest
6
5
 
7
-
8
6
  try:
9
7
  from numcodecs.zstd import Zstd
10
8
  except ImportError: # pragma: no cover
@@ -12,15 +10,14 @@ except ImportError: # pragma: no cover
12
10
 
13
11
 
14
12
  from numcodecs.tests.common import (
15
- check_encode_decode,
16
- check_config,
17
- check_repr,
18
13
  check_backwards_compatibility,
14
+ check_config,
15
+ check_encode_decode,
19
16
  check_err_decode_object_buffer,
20
17
  check_err_encode_object_buffer,
18
+ check_repr,
21
19
  )
22
20
 
23
-
24
21
  codecs = [
25
22
  Zstd(),
26
23
  Zstd(level=-1),
@@ -90,6 +87,6 @@ def test_checksum():
90
87
 
91
88
  def test_native_functions():
92
89
  # Note, these assertions might need to be changed for new versions of zstd
93
- assert Zstd.default_level == 3
94
- assert Zstd.min_level == -131072
95
- assert Zstd.max_level == 22
90
+ assert Zstd.default_level() == 3
91
+ assert Zstd.min_level() == -131072
92
+ assert Zstd.max_level() == 22
numcodecs/version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.13.0'
16
- __version_tuple__ = version_tuple = (0, 13, 0)
15
+ __version__ = version = '0.13.1'
16
+ __version_tuple__ = version_tuple = (0, 13, 1)
Binary file
numcodecs/zfpy.py CHANGED
@@ -1,6 +1,6 @@
1
+ import warnings
1
2
  from contextlib import suppress
2
3
  from importlib.metadata import PackageNotFoundError, version
3
- import warnings
4
4
 
5
5
  _zfpy = None
6
6
 
@@ -17,16 +17,18 @@ if _zfpy_version:
17
17
  "NumPy version >= 2.0.0 detected. The zfpy library is incompatible with this version of NumPy. "
18
18
  "Please downgrade to NumPy < 2.0.0 or wait for an update from zfpy.",
19
19
  UserWarning,
20
+ stacklevel=2,
20
21
  )
21
22
  else:
22
23
  with suppress(ImportError):
23
24
  import zfpy as _zfpy
24
25
 
25
26
  if _zfpy:
26
- from .abc import Codec
27
- from .compat import ndarray_copy, ensure_contiguous_ndarray, ensure_bytes
28
27
  import numpy as np
29
28
 
29
+ from .abc import Codec
30
+ from .compat import ensure_bytes, ensure_contiguous_ndarray, ndarray_copy
31
+
30
32
  # noinspection PyShadowingBuiltins
31
33
  class ZFPY(Codec):
32
34
  """Codec providing compression using zfpy via the Python standard
@@ -102,11 +104,8 @@ if _zfpy:
102
104
  return dec
103
105
 
104
106
  def __repr__(self):
105
- r = "%s(mode=%r, tolerance=%s, rate=%s, precision=%s)" % (
106
- type(self).__name__,
107
- self.mode,
108
- self.tolerance,
109
- self.rate,
110
- self.precision,
107
+ return (
108
+ f"{type(self).__name__}(mode={self.mode!r}, "
109
+ f"tolerance={self.tolerance}, rate={self.rate}, "
110
+ f"precision={self.precision})"
111
111
  )
112
- return r
numcodecs/zlib.py CHANGED
@@ -1,8 +1,7 @@
1
1
  import zlib as _zlib
2
2
 
3
-
4
3
  from .abc import Codec
5
- from .compat import ndarray_copy, ensure_contiguous_ndarray
4
+ from .compat import ensure_contiguous_ndarray, ndarray_copy
6
5
 
7
6
 
8
7
  class Zlib(Codec):
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: numcodecs
3
- Version: 0.13.0
3
+ Version: 0.13.1
4
4
  Summary: A Python package providing buffer compression and transformation codecs for use in data storage and communication applications.
5
5
  Maintainer-email: Alistair Miles <alimanfoo@googlemail.com>
6
6
  License: MIT
@@ -23,7 +23,7 @@ Description-Content-Type: text/x-rst
23
23
  License-File: LICENSE.txt
24
24
  Requires-Dist: numpy >=1.7
25
25
  Provides-Extra: docs
26
- Requires-Dist: sphinx <7.0.0 ; extra == 'docs'
26
+ Requires-Dist: sphinx ; extra == 'docs'
27
27
  Requires-Dist: sphinx-issues ; extra == 'docs'
28
28
  Requires-Dist: pydata-sphinx-theme ; extra == 'docs'
29
29
  Requires-Dist: numpydoc ; extra == 'docs'
@@ -45,7 +45,7 @@ Requires-Dist: numpy <2.0.0 ; extra == 'zfpy'
45
45
  Numcodecs
46
46
  =========
47
47
 
48
- Numcodecs is a Python package providing buffer compression and transformation
48
+ Numcodecs is a Python package providing buffer compression and transformation
49
49
  codecs for use in data storage and communication applications.
50
50
 
51
51
  .. image:: https://readthedocs.org/projects/numcodecs/badge/?version=latest