zarrs 0.2.0__cp311-abi3-musllinux_1_2_aarch64.whl → 0.2.1__cp311-abi3-musllinux_1_2_aarch64.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 zarrs might be problematic. Click here for more details.
- zarrs/__init__.py +0 -4
- zarrs/_internal.abi3.so +0 -0
- zarrs/_internal.pyi +4 -13
- zarrs/pipeline.py +10 -29
- zarrs/utils.py +1 -1
- {zarrs-0.2.0.dist-info → zarrs-0.2.1.dist-info}/METADATA +10 -7
- zarrs-0.2.1.dist-info/RECORD +13 -0
- {zarrs-0.2.0.dist-info → zarrs-0.2.1.dist-info}/WHEEL +1 -1
- zarrs-0.2.1.dist-info/entry_points.txt +2 -0
- zarrs.libs/{libgcc_s-e52197c3.so.1 → libgcc_s-39080030.so.1} +0 -0
- zarrs.libs/{libstdc++-405035b3.so.6 → libstdc++-cedf4250.so.6} +0 -0
- zarrs-0.2.0.dist-info/RECORD +0 -12
- {zarrs-0.2.0.dist-info → zarrs-0.2.1.dist-info}/licenses/LICENSE +0 -0
zarrs/__init__.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from zarr.registry import register_pipeline
|
|
2
|
-
|
|
3
1
|
from ._internal import __version__
|
|
4
2
|
from .pipeline import ZarrsCodecPipeline as _ZarrsCodecPipeline
|
|
5
3
|
from .utils import CollapsedDimensionError, DiscontiguousArrayError
|
|
@@ -10,8 +8,6 @@ class ZarrsCodecPipeline(_ZarrsCodecPipeline):
|
|
|
10
8
|
pass
|
|
11
9
|
|
|
12
10
|
|
|
13
|
-
register_pipeline(ZarrsCodecPipeline)
|
|
14
|
-
|
|
15
11
|
__all__ = [
|
|
16
12
|
"ZarrsCodecPipeline",
|
|
17
13
|
"DiscontiguousArrayError",
|
zarrs/_internal.abi3.so
CHANGED
|
Binary file
|
zarrs/_internal.pyi
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
import builtins
|
|
5
5
|
import typing
|
|
6
|
-
from enum import Enum
|
|
7
6
|
|
|
8
7
|
import numpy.typing
|
|
8
|
+
import zarr.abc.store
|
|
9
9
|
|
|
10
10
|
class Basic:
|
|
11
11
|
def __new__(cls, byte_interface: typing.Any, chunk_spec: typing.Any) -> Basic: ...
|
|
@@ -14,12 +14,13 @@ class CodecPipelineImpl:
|
|
|
14
14
|
def __new__(
|
|
15
15
|
cls,
|
|
16
16
|
array_metadata: builtins.str,
|
|
17
|
-
store_config:
|
|
17
|
+
store_config: zarr.abc.store.Store,
|
|
18
18
|
*,
|
|
19
|
-
validate_checksums: builtins.bool
|
|
19
|
+
validate_checksums: builtins.bool = False,
|
|
20
20
|
chunk_concurrent_minimum: builtins.int | None = None,
|
|
21
21
|
chunk_concurrent_maximum: builtins.int | None = None,
|
|
22
22
|
num_threads: builtins.int | None = None,
|
|
23
|
+
direct_io: builtins.bool = False,
|
|
23
24
|
) -> CodecPipelineImpl: ...
|
|
24
25
|
def retrieve_chunks_and_apply_index(
|
|
25
26
|
self,
|
|
@@ -33,12 +34,6 @@ class CodecPipelineImpl:
|
|
|
33
34
|
write_empty_chunks: builtins.bool,
|
|
34
35
|
) -> None: ...
|
|
35
36
|
|
|
36
|
-
class FilesystemStoreConfig:
|
|
37
|
-
root: builtins.str
|
|
38
|
-
|
|
39
|
-
class HttpStoreConfig:
|
|
40
|
-
endpoint: builtins.str
|
|
41
|
-
|
|
42
37
|
class WithSubset:
|
|
43
38
|
def __new__(
|
|
44
39
|
cls,
|
|
@@ -47,7 +42,3 @@ class WithSubset:
|
|
|
47
42
|
subset: typing.Sequence[slice],
|
|
48
43
|
shape: typing.Sequence[builtins.int],
|
|
49
44
|
) -> WithSubset: ...
|
|
50
|
-
|
|
51
|
-
class StoreConfig(Enum):
|
|
52
|
-
Filesystem = ...
|
|
53
|
-
Http = ...
|
zarrs/pipeline.py
CHANGED
|
@@ -14,18 +14,17 @@ from zarr.core.config import config
|
|
|
14
14
|
from zarr.core.metadata import ArrayMetadata, ArrayV2Metadata, ArrayV3Metadata
|
|
15
15
|
|
|
16
16
|
if TYPE_CHECKING:
|
|
17
|
-
from collections.abc import
|
|
18
|
-
from typing import
|
|
17
|
+
from collections.abc import Iterable, Iterator
|
|
18
|
+
from typing import Self
|
|
19
19
|
|
|
20
20
|
from zarr.abc.store import ByteGetter, ByteSetter, Store
|
|
21
21
|
from zarr.core.array_spec import ArraySpec
|
|
22
22
|
from zarr.core.buffer import Buffer, NDArrayLike, NDBuffer
|
|
23
23
|
from zarr.core.chunk_grids import ChunkGrid
|
|
24
|
-
from zarr.core.common import ChunkCoords
|
|
25
24
|
from zarr.core.indexing import SelectorTuple
|
|
26
25
|
from zarr.dtype import ZDType
|
|
27
26
|
|
|
28
|
-
from ._internal import CodecPipelineImpl
|
|
27
|
+
from ._internal import CodecPipelineImpl
|
|
29
28
|
from .utils import (
|
|
30
29
|
CollapsedDimensionError,
|
|
31
30
|
DiscontiguousArrayError,
|
|
@@ -47,10 +46,14 @@ def get_codec_pipeline_impl(
|
|
|
47
46
|
) -> CodecPipelineImpl | None:
|
|
48
47
|
try:
|
|
49
48
|
array_metadata_json = json.dumps(metadata.to_dict())
|
|
49
|
+
# Maintain old behavior: https://github.com/zarrs/zarrs-python/tree/b36ba797cafec77f5f41a25316be02c718a2b4f8?tab=readme-ov-file#configuration
|
|
50
|
+
validate_checksums = config.get("codec_pipeline.validate_checksums", True)
|
|
51
|
+
if validate_checksums is None:
|
|
52
|
+
validate_checksums = True
|
|
50
53
|
return CodecPipelineImpl(
|
|
51
54
|
array_metadata_json,
|
|
52
55
|
store_config=store,
|
|
53
|
-
validate_checksums=
|
|
56
|
+
validate_checksums=validate_checksums,
|
|
54
57
|
chunk_concurrent_minimum=config.get(
|
|
55
58
|
"codec_pipeline.chunk_concurrent_minimum", None
|
|
56
59
|
),
|
|
@@ -58,6 +61,7 @@ def get_codec_pipeline_impl(
|
|
|
58
61
|
"codec_pipeline.chunk_concurrent_maximum", None
|
|
59
62
|
),
|
|
60
63
|
num_threads=config.get("threading.max_workers", None),
|
|
64
|
+
direct_io=config.get("codec_pipeline.direct_io", False),
|
|
61
65
|
)
|
|
62
66
|
except TypeError as e:
|
|
63
67
|
warn(
|
|
@@ -67,29 +71,6 @@ def get_codec_pipeline_impl(
|
|
|
67
71
|
return None
|
|
68
72
|
|
|
69
73
|
|
|
70
|
-
def codecs_to_dict(codecs: Iterable[Codec]) -> Generator[dict[str, Any], None, None]:
|
|
71
|
-
for codec in codecs:
|
|
72
|
-
if codec.__class__.__name__ == "V2Codec":
|
|
73
|
-
codec_dict = codec.to_dict()
|
|
74
|
-
if codec_dict.get("filters", None) is not None:
|
|
75
|
-
filters = [
|
|
76
|
-
json.dumps(filter.get_config())
|
|
77
|
-
for filter in codec_dict.get("filters")
|
|
78
|
-
]
|
|
79
|
-
else:
|
|
80
|
-
filters = None
|
|
81
|
-
if codec_dict.get("compressor", None) is not None:
|
|
82
|
-
compressor_json = codec_dict.get("compressor").get_config()
|
|
83
|
-
compressor = json.dumps(compressor_json)
|
|
84
|
-
else:
|
|
85
|
-
compressor = None
|
|
86
|
-
codecs_v3 = codec_metadata_v2_to_v3(filters, compressor)
|
|
87
|
-
for codec in codecs_v3:
|
|
88
|
-
yield json.loads(codec)
|
|
89
|
-
else:
|
|
90
|
-
yield codec.to_dict()
|
|
91
|
-
|
|
92
|
-
|
|
93
74
|
class ZarrsCodecPipelineState(TypedDict):
|
|
94
75
|
codec_metadata_json: str
|
|
95
76
|
codecs: tuple[Codec, ...]
|
|
@@ -151,7 +132,7 @@ class ZarrsCodecPipeline(CodecPipeline):
|
|
|
151
132
|
yield from self.codecs
|
|
152
133
|
|
|
153
134
|
def validate(
|
|
154
|
-
self, *, shape:
|
|
135
|
+
self, *, shape: tuple[int, ...], dtype: ZDType, chunk_grid: ChunkGrid
|
|
155
136
|
) -> None:
|
|
156
137
|
raise NotImplementedError("validate")
|
|
157
138
|
|
zarrs/utils.py
CHANGED
|
@@ -158,7 +158,7 @@ def make_chunk_info_for_rust_with_indices(
|
|
|
158
158
|
],
|
|
159
159
|
drop_axes: tuple[int, ...],
|
|
160
160
|
shape: tuple[int, ...],
|
|
161
|
-
) ->
|
|
161
|
+
) -> RustChunkInfo:
|
|
162
162
|
shape = shape if shape else (1,) # constant array
|
|
163
163
|
chunk_info_with_indices: list[WithSubset] = []
|
|
164
164
|
write_empty_chunks: bool = True
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: zarrs
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
7
|
Classifier: Typing :: Typed
|
|
8
|
-
Requires-Dist: numpy
|
|
9
|
-
Requires-Dist: zarr
|
|
8
|
+
Requires-Dist: numpy>=1.24
|
|
9
|
+
Requires-Dist: zarr>=3.1
|
|
10
10
|
License-File: LICENSE
|
|
11
|
+
Summary: A CodecPipeline for zarr-python backed by the zarrs Rust crate
|
|
11
12
|
Author: Ilan Gold, Lachlan Deakin, Philipp Angerer
|
|
12
|
-
License: MIT
|
|
13
|
+
License-Expression: MIT
|
|
13
14
|
Requires-Python: >=3.11
|
|
14
15
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
15
16
|
|
|
@@ -28,7 +29,6 @@ To use the project, simply install our package (which depends on `zarr-python>=3
|
|
|
28
29
|
|
|
29
30
|
```python
|
|
30
31
|
import zarr
|
|
31
|
-
import zarrs
|
|
32
32
|
zarr.config.set({"codec_pipeline.path": "zarrs.ZarrsCodecPipeline"})
|
|
33
33
|
```
|
|
34
34
|
|
|
@@ -63,7 +63,9 @@ The `ZarrsCodecPipeline` specific options are:
|
|
|
63
63
|
- `codec_pipeline.chunk_concurrent_minimum`: the minimum number of chunks retrieved/stored concurrently when balancing chunk/codec concurrency.
|
|
64
64
|
- Defaults to 4 if `None`. See [here](https://docs.rs/zarrs/latest/zarrs/config/struct.Config.html#chunk-concurrent-minimum) for more info.
|
|
65
65
|
- `codec_pipeline.validate_checksums`: enable checksum validation (e.g. with the CRC32C codec).
|
|
66
|
-
- Defaults to
|
|
66
|
+
- Defaults to `True`. See [here](https://docs.rs/zarrs/latest/zarrs/config/struct.Config.html#validate-checksums) for more info.
|
|
67
|
+
- `codec_pipeline.direct_io`: enable `O_DIRECT` read/write, needs support from the operating system (currently only Linux) and file system.
|
|
68
|
+
- Defaults to `False`.
|
|
67
69
|
|
|
68
70
|
For example:
|
|
69
71
|
```python
|
|
@@ -75,6 +77,7 @@ zarr.config.set({
|
|
|
75
77
|
"validate_checksums": True,
|
|
76
78
|
"chunk_concurrent_maximum": None,
|
|
77
79
|
"chunk_concurrent_minimum": 4,
|
|
80
|
+
"direct_io": False
|
|
78
81
|
}
|
|
79
82
|
})
|
|
80
83
|
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
zarrs-0.2.1.dist-info/METADATA,sha256=8Y8S6VPAKwydDwl2oSRsMQlD_VSVUCtbfdm78FM4LZs,7878
|
|
2
|
+
zarrs-0.2.1.dist-info/WHEEL,sha256=j6FOuxwT6CKQM0u5qX1thXGZmEEfmaSnivgZjWdBOSo,107
|
|
3
|
+
zarrs-0.2.1.dist-info/entry_points.txt,sha256=EzI6yCIUPDHBHzjDdexuGGYbOLXf8x2ICokOJXnuX3k,68
|
|
4
|
+
zarrs-0.2.1.dist-info/licenses/LICENSE,sha256=vwIsJjEfVFehyyqcb7B3dAXAniaFMmk8u7IoiJAfBJ4,1099
|
|
5
|
+
zarrs.libs/libgcc_s-39080030.so.1,sha256=fIO6GHOh8Ft9CR0Geu7wSUb9Xnl122iTtrxQQ9TAkTQ,789673
|
|
6
|
+
zarrs.libs/libstdc++-cedf4250.so.6,sha256=ahluTdjW3ViH_6W4-dRp01QgMtKg6f8XkwQdWeci4q8,22443689
|
|
7
|
+
zarrs/__init__.py,sha256=lRVtAPzCzJkGs4vQrW4UgANq-pC-khS0ZF7HTj4__Hg,489
|
|
8
|
+
zarrs/_internal.abi3.so,sha256=nxe0x3Z-DAdy3i4ZBvUlwT5pYYOAsO7BYkhD48il6qM,10883449
|
|
9
|
+
zarrs/_internal.pyi,sha256=D_sHSSWGoVWLBS3q0dPE3pPJULZZ7cxV-9CErqGp8Z8,1327
|
|
10
|
+
zarrs/pipeline.py,sha256=Ihc-RkEOqDTQvUtuwSJf8TBDVZMn2kYYH2_yATjydTI,8449
|
|
11
|
+
zarrs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
zarrs/utils.py,sha256=mGFsSnYU_jt4QJtlvr2JfxoBDZLe8V3Y8DbVfZSUpmA,7027
|
|
13
|
+
zarrs-0.2.1.dist-info/RECORD,,
|
|
Binary file
|
|
Binary file
|
zarrs-0.2.0.dist-info/RECORD
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
zarrs-0.2.0.dist-info/METADATA,sha256=XxZ7DwO-fwgs0UKqvISPYRv2C58rtWNZTFnUlQ4GN0M,7626
|
|
2
|
-
zarrs-0.2.0.dist-info/WHEEL,sha256=vxpafWho8X9SrLM7wh4rSbKXqwEIG8s7R5rKYxiTM_Q,107
|
|
3
|
-
zarrs-0.2.0.dist-info/licenses/LICENSE,sha256=vwIsJjEfVFehyyqcb7B3dAXAniaFMmk8u7IoiJAfBJ4,1099
|
|
4
|
-
zarrs.libs/libgcc_s-e52197c3.so.1,sha256=vkPW1Auw6CH9Bjk7frmX3hry_1H9c0tRI0Ncyg71WUI,724137
|
|
5
|
-
zarrs.libs/libstdc++-405035b3.so.6,sha256=dhdlt148awG0mZDLGM8wZy1R4PeU5HXvi8l9pgv4DiY,22443689
|
|
6
|
-
zarrs/__init__.py,sha256=4oWtWDZO8r7z4Uh7Fy_brmkxXDpULQdgjlA0iFw98eA,573
|
|
7
|
-
zarrs/pipeline.py,sha256=9cog6mm1BMwxgRsKyO67mn_DyRdqsDrxykrTpyMyclo,9099
|
|
8
|
-
zarrs/_internal.pyi,sha256=4WAVy2Upg3y_DX0j8AvdAr0_FAMeReDkS57XFc3Y9xE,1448
|
|
9
|
-
zarrs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
zarrs/utils.py,sha256=My01lFsg9ZFxkMajbTKHz7audaSxHJW6CviDjqo2tDs,7030
|
|
11
|
-
zarrs/_internal.abi3.so,sha256=PHO2SOloRBaz2c82pGUbgCMBAgkrPSUSWiKyxRFMErM,10096777
|
|
12
|
-
zarrs-0.2.0.dist-info/RECORD,,
|
|
File without changes
|