Skip to content

Commit 29aa8eb

Browse files
authored
Merge branch 'main' into update-2874-release-note
2 parents 9bf0d14 + af76fba commit 29aa8eb

File tree

15 files changed

+143
-61
lines changed

15 files changed

+143
-61
lines changed

.github/workflows/hypothesis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
&& steps.status.outcome == 'failure'
8888
&& github.event_name == 'schedule'
8989
&& github.repository_owner == 'zarr-developers'
90-
uses: xarray-contrib/issue-from-pytest-log@v1
90+
uses: scientific-python/issue-from-pytest-log-action@v1
9191
with:
9292
log-path: output-${{ matrix.python-version }}-log.jsonl
9393
issue-title: "Nightly Hypothesis tests failed"

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ repos:
4949
- id: rst-directive-colons
5050
- id: rst-inline-touching-normal
5151
- repo: https://github.com/numpy/numpydoc
52-
rev: v1.8.0
52+
rev: v1.9.0
5353
hooks:
5454
- id: numpydoc-validation
5555
- repo: https://github.com/twisted/towncrier

changes/3138.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changes/3140.bugfix.rst

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

changes/3156.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changes/3193.bugfix.rst

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

changes/3195.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changes/3232.bugfix.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix the type of ``ArrayV2Metadata.codec`` to constrain it to ``numcodecs.abc.Codec | None``.
2+
Previously the type was more permissive, allowing objects that can be parsed into Codecs (e.g., the codec name).
3+
The constructor of ``ArrayV2Metadata`` still allows the permissive input when creating new objects.

changes/3233.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add an alternate `from_array_metadata_and_store` constructor to `CodecPipeline`.

src/zarr/abc/codec.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
from collections.abc import Awaitable, Callable, Iterable
1313
from typing import Self
1414

15-
from zarr.abc.store import ByteGetter, ByteSetter
15+
from zarr.abc.store import ByteGetter, ByteSetter, Store
1616
from zarr.core.array_spec import ArraySpec
1717
from zarr.core.chunk_grids import ChunkGrid
1818
from zarr.core.dtype.wrapper import TBaseDType, TBaseScalar, ZDType
1919
from zarr.core.indexing import SelectorTuple
20+
from zarr.core.metadata import ArrayMetadata
2021

2122
__all__ = [
2223
"ArrayArrayCodec",
@@ -281,6 +282,25 @@ def from_codecs(cls, codecs: Iterable[Codec]) -> Self:
281282
"""
282283
...
283284

285+
@classmethod
286+
def from_array_metadata_and_store(cls, array_metadata: ArrayMetadata, store: Store) -> Self:
287+
"""Creates a codec pipeline from array metadata and a store path.
288+
289+
Raises NotImplementedError by default, indicating the CodecPipeline must be created with from_codecs instead.
290+
291+
Parameters
292+
----------
293+
array_metadata : ArrayMetadata
294+
store : Store
295+
296+
Returns
297+
-------
298+
Self
299+
"""
300+
raise NotImplementedError(
301+
f"'{type(cls).__name__}' does not implement CodecPipeline.from_array_metadata_and_store."
302+
)
303+
284304
@property
285305
@abstractmethod
286306
def supports_partial_decode(self) -> bool: ...

0 commit comments

Comments
 (0)