-
-
Notifications
You must be signed in to change notification settings - Fork 349
Narrow JSON type, ensure that to_dict
always returns a dict, and v2 filter / compressor parsing
#2179
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
Narrow JSON type, ensure that to_dict
always returns a dict, and v2 filter / compressor parsing
#2179
Changes from 2 commits
6096a51
7984ea7
fdffbb8
14db760
cf287e6
e53ebab
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 |
---|---|---|
|
@@ -90,7 +90,7 @@ def create_codec_pipeline(metadata: ArrayV2Metadata | ArrayV3Metadata) -> CodecP | |
return get_pipeline_class().from_list(metadata.codecs) | ||
elif isinstance(metadata, ArrayV2Metadata): | ||
return get_pipeline_class().from_list( | ||
[V2Filters(metadata.filters or []), V2Compressor(metadata.compressor)] | ||
[V2Filters(metadata.filters), V2Compressor(metadata.compressor)] | ||
) | ||
else: | ||
raise TypeError | ||
|
@@ -299,8 +299,6 @@ async def _create_v2( | |
attributes: dict[str, JSON] | None = None, | ||
exists_ok: bool = False, | ||
) -> AsyncArray: | ||
import numcodecs | ||
|
||
if not exists_ok: | ||
await ensure_no_existing_node(store_path, zarr_format=2) | ||
if order is None: | ||
|
@@ -315,15 +313,9 @@ async def _create_v2( | |
chunks=chunks, | ||
order=order, | ||
dimension_separator=dimension_separator, | ||
fill_value=0 if fill_value is None else fill_value, | ||
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. Restoring the But that said, I like the change here... Setting a default fill value here seems wrong. 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. Oh, but this is just for |
||
compressor=( | ||
numcodecs.get_codec(compressor).get_config() if compressor is not None else None | ||
), | ||
filters=( | ||
[numcodecs.get_codec(filter).get_config() for filter in filters] | ||
if filters is not None | ||
else None | ||
), | ||
fill_value=fill_value, | ||
compressor=compressor, | ||
filters=filters, | ||
attributes=attributes, | ||
) | ||
array = cls(metadata=metadata, store_path=store_path) | ||
|
Uh oh!
There was an error while loading. Please reload this page.