Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 450
(fix): structured arrays for v2#2681
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
d46de842090b98f3e2e2da8d473b7898ef891204259c2efdd647868c0b207a7b2071a7d19e968ff730a389cc8d99c591677f64babb67acb93e050e77141de5File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -193,7 +193,14 @@ def to_dict(self) -> dict[str, JSON]: | ||
| zarray_dict["fill_value"] = fill_value | ||
| _ = zarray_dict.pop("dtype") | ||
| zarray_dict["dtype"] = self.dtype.str | ||
| dtype_json: JSON | ||
| # In the case of zarr v2, the simplest i.e., '|VXX' dtype is represented as a string | ||
| dtype_descr = self.dtype.descr | ||
| if self.dtype.kind == "V" and dtype_descr[0][0] != "" and len(dtype_descr) != 0: | ||
| dtype_json = tuple(self.dtype.descr) | ||
| else: | ||
| dtype_json = self.dtype.str | ||
Comment on lines
+197
to
+202
ContributorAuthor 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. This is my attempt to match the old behavior. I didn't look back at the old code yet, but if someone knows this to be wrong, would be great to know. Member 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. Looks right to me | ||
| zarray_dict["dtype"] = dtype_json | ||
| return zarray_dict | ||
| @@ -220,6 +227,8 @@ def update_attributes(self, attributes: dict[str, JSON]) -> Self: | ||
| def parse_dtype(data: npt.DTypeLike) -> np.dtype[Any]: | ||
| if isinstance(data, list): # this is a valid _VoidDTypeLike check | ||
Member 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. Any iterable?
| ||
| data = [tuple(d) for d in data] | ||
| return np.dtype(data) | ||
| @@ -376,8 +385,10 @@ def _default_filters( | ||
| dtype_key = "numeric" | ||
| elif dtype.kind in "U": | ||
| dtype_key = "string" | ||
| elif dtype.kind in "OSV": | ||
| elif dtype.kind in "OS": | ||
| dtype_key = "bytes" | ||
| elif dtype.kind == "V": | ||
| dtype_key = "raw" | ||
| else: | ||
| raise ValueError(f"Unsupported dtype kind {dtype.kind}") | ||

Uh oh!
There was an error while loading. Please reload this page.