Implement from_array for v3 - #53
Merged
Merged
Conversation
dstansby
force-pushed
the
v3-from-array
branch
3 times, most recently
from
May 25, 2025 17:18
62d1820 to
b19f10e
Compare
d-v-b
reviewed
Jul 8, 2025
d-v-b
reviewed
Jul 8, 2025
Comment on lines
+23
to
+39
| def stringify_dtype(value: npt.DTypeLike) -> str: | ||
| """ | ||
| Convert a `numpy.dtype` object into a `str`. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| value : `npt.DTypeLike` | ||
| Some object that can be coerced to a numpy dtype | ||
|
|
||
| Returns | ||
| ------- | ||
|
|
||
| A numpy dtype string representation of `value`. | ||
| """ | ||
| return np.dtype(value).str | ||
|
|
||
|
|
Collaborator
There was a problem hiding this comment.
this function is incorrect for zarr v3 but we can fix that later
d-v-b
reviewed
Jul 8, 2025
|
|
||
| return cls( | ||
| shape=array.shape, | ||
| data_type=str(array.dtype), |
Collaborator
There was a problem hiding this comment.
flagging this as something to fix, because it won't in general be valid for all instances of array.dtype
d-v-b
approved these changes
Jul 8, 2025
d-v-b
left a comment
Collaborator
There was a problem hiding this comment.
looks good! we will have to revisit some of this stuff but in the interest of moving forward I'm happy to merge
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #53 +/- ##
==========================
==========================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.