-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace VirtualiZarr.ZArray with zarr ArrayMetadata #175
base: main
Are you sure you want to change the base?
Changes from all commits
5e12b88
92a7e81
42b3f3a
c8c9020
5fa1dea
cea2214
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,11 @@ | |
import numpy as np | ||
import pytest | ||
from packaging.version import Version | ||
from zarr.array import ArrayV2Metadata | ||
|
||
from virtualizarr.manifests import ChunkManifest, ManifestArray | ||
from virtualizarr.manifests.manifest import join | ||
from virtualizarr.zarr import ZArray, ceildiv | ||
from virtualizarr.zarr import ceildiv | ||
|
||
network = pytest.mark.network | ||
|
||
|
@@ -46,15 +47,14 @@ def create_manifestarray( | |
The manifest is populated with a (somewhat) unique path, offset, and length for each key. | ||
""" | ||
|
||
zarray = ZArray( | ||
zarray = ArrayV2Metadata( | ||
chunks=chunks, | ||
compressor="zlib", | ||
compressor={"id": "zlib"}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the presence of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In V3, the Actually please ignore any of the changes in |
||
dtype=np.dtype("float32"), | ||
fill_value=0.0, # TODO change this to NaN? | ||
filters=None, | ||
order="C", | ||
shape=shape, | ||
zarr_format=2, | ||
) | ||
|
||
chunk_grid_shape = tuple( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to prefer this
match...case
over a standardif isinstance()...else
syntax?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly a style preference coming from languages with discriminated unions and compilers, but if you'd like the whole code base to be consistent I can rewrite it with
isinstance
.