Skip to content

Commit fe07eff

Browse files
committed
apply MemoryOrder type to ArrayV2Metadata
1 parent 150d557 commit fe07eff

File tree

1 file changed

+4
-4
lines changed
  • src/zarr/core/metadata

1 file changed

+4
-4
lines changed

src/zarr/core/metadata/v2.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from zarr.core.array_spec import ArraySpec
2626
from zarr.core.chunk_grids import RegularChunkGrid
2727
from zarr.core.chunk_key_encodings import parse_separator
28-
from zarr.core.common import ZARRAY_JSON, ZATTRS_JSON, parse_shapelike
28+
from zarr.core.common import ZARRAY_JSON, ZATTRS_JSON, MemoryOrder, parse_shapelike
2929
from zarr.core.config import config, parse_indexing_order
3030
from zarr.core.metadata.common import parse_attributes
3131

@@ -45,7 +45,7 @@ class ArrayV2Metadata(Metadata):
4545
chunks: tuple[int, ...]
4646
dtype: np.dtype[Any]
4747
fill_value: None | int | float | str | bytes = 0
48-
order: Literal["C", "F"] = "C"
48+
order: MemoryOrder = "C"
4949
filters: tuple[numcodecs.abc.Codec, ...] | None = None
5050
dimension_separator: Literal[".", "/"] = "."
5151
compressor: numcodecs.abc.Codec | None = None
@@ -59,7 +59,7 @@ def __init__(
5959
dtype: npt.DTypeLike,
6060
chunks: ChunkCoords,
6161
fill_value: Any,
62-
order: Literal["C", "F"],
62+
order: MemoryOrder,
6363
dimension_separator: Literal[".", "/"] = ".",
6464
compressor: numcodecs.abc.Codec | dict[str, JSON] | None = None,
6565
filters: Iterable[numcodecs.abc.Codec | dict[str, JSON]] | None = None,
@@ -185,7 +185,7 @@ def to_dict(self) -> dict[str, JSON]:
185185
return zarray_dict
186186

187187
def get_chunk_spec(
188-
self, _chunk_coords: ChunkCoords, order: Literal["C", "F"], prototype: BufferPrototype
188+
self, _chunk_coords: ChunkCoords, order: MemoryOrder, prototype: BufferPrototype
189189
) -> ArraySpec:
190190
return ArraySpec(
191191
shape=self.chunks,

0 commit comments

Comments
 (0)