Skip to content

Implement from_array for v3 - #53

Merged
d-v-b merged 3 commits into
zarr-developers:mainfrom
dstansby:v3-from-array
Jul 8, 2025
Merged

Implement from_array for v3#53
d-v-b merged 3 commits into
zarr-developers:mainfrom
dstansby:v3-from-array

Conversation

@dstansby

@dstansby dstansby commented May 18, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

@dstansby
dstansby force-pushed the v3-from-array branch 3 times, most recently from 62d1820 to b19f10e Compare May 25, 2025 17:18
@dstansby
dstansby marked this pull request as ready for review June 12, 2025 15:08
@dstansby
dstansby requested a review from d-v-b June 12, 2025 15:08
Comment thread docs/usage_zarr_v3.md Outdated
Comment thread src/pydantic_zarr/core.py
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


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is incorrect for zarr v3 but we can fix that later

Comment thread src/pydantic_zarr/v3.py

return cls(
shape=array.shape,
data_type=str(array.dtype),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flagging this as something to fix, because it won't in general be valid for all instances of array.dtype

@d-v-b d-v-b left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! we will have to revisit some of this stuff but in the interest of moving forward I'm happy to merge

@d-v-b
d-v-b merged commit d21c040 into zarr-developers:main Jul 8, 2025
18 checks passed
@codecov

codecov Bot commented Jul 8, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (9170673) to head (d7240c1).
Report is 7 commits behind head on main.

Additional details and impacted files
@@    Coverage Diff     @@
##   main   #53   +/-   ##
==========================
==========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants