Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Zarr data types refactor compatibility#618

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@TomNicholas
Copy link
Member

Supercedes#545 now thatzarr-developers/zarr-python#2874 has been merged upstream.

The upstream changes are already being tested (and unsurprisingly causing some issues - see also#617) in our upstream dev CI tests. But here we will x-fail stuff, start trying to fix things, and bump required dependencies.

  • Closes #xxxx
  • Tests added
  • Tests passing
  • Full type hint coverage
  • Changes are documented indocs/releases.rst
  • New functions/methods are listed inapi.rst
  • New functionality has documentation

FYI@d-v-b

@TomNicholasTomNicholas added the zarr-pythonRelevant to zarr-python upstream labelJun 17, 2025
@TomNicholasTomNicholas added test-upstreamRun the upstream tests on this PR and removed test-upstreamRun the upstream tests on this PR labelsJun 17, 2025
@TomNicholas
Copy link
MemberAuthor

@d-v-b what would be the preferred way to replace the usage ofV3JsonEncoder (and the olderdict_to_buffer that we apparently vendored inhttps://github.com/zarr-developers/VirtualiZarr/blob/develop/virtualizarr/vendor/zarr/core/metadata.py?

@d-v-b
Copy link

The functionality for serializing Nan / Inf / -Inf to a fill value now sits instand-alone functions . The inverse functions arehere.

A few things to keep in mind:

  • Zarr v3 float serialization is a little different from v2. Zarr v3 allows floats to use a hex string to represent the float value, which is necessary for supporting different types of nans. In zarr-python, we only care about this on the from-json side, because as long as we are using numpy, we can't tell the difference between these different nan values, so there's no need for serialization logic to handle that.
  • Because yourV3JSONEncoder is used as a json encoder, it's applied to the entirezarr.json document, which is not in general correct. The zarr specs only define special JSON encoding in the context of the fill_value field. There is no expectation that the same special encoding applies to user-defined attributes.
  • Instead of using a special JSON encoder to transform a potentially malformed dict, you could just create JSON-serializable, spec-compliant dict in advance. This is whatArrayV3Metadata.to_dict now does in zarr python, thanks to smarter dtypes. So I would just do that instead of using a custom JSON encoder that's potentially going to mangle the contents of user attributes.
TomNicholas reacted with thumbs up emoji

@maxrjones
Copy link
Member

@TomNicholas are you confident these are all changes we can handle internally? I'm asking since 3.1.0 will hopefully come out tomorrow -zarr-developers/zarr-python#3219. Would you like any help wrapping this up?

@TomNicholas
Copy link
MemberAuthor

I think this shouldn't present a blocker but I would definitely appreciate help getting it over the finish line!

@maxrjones
Copy link
Member

I think this shouldn't present a blocker but I would definitely appreciate help getting it over the finish line!

FYI I think this is good now - the failures should all relate to#673

@maxrjonesmaxrjones added this to thev2.0.0 milestoneJul 13, 2025
Copy link
MemberAuthor

@TomNicholasTomNicholas left a comment

Choose a reason for hiding this comment

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

Nice, thank you! The final changes are surprisingly small. I can't approve my own PR, but I think we should add a release note for this one and merge.

@maxrjones
Copy link
Member

Nice, thank you! The final changes are surprisingly small. I can't approve my own PR, but I think we should add a release note for this one and merge.

This doesn't touch anything that's been released (😞) so IMO we don't need a release note.

TomNicholas reacted with thumbs up emoji

@TomNicholasTomNicholas merged commit8128451 intozarr-developers:developJul 14, 2025
11 checks passed
@TomNicholasTomNicholas deleted the zarr-data-types-refactor-compat branchJuly 14, 2025 15:52
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@maxrjonesmaxrjonesmaxrjones approved these changes

Assignees

No one assigned

Labels

test-upstreamRun the upstream tests on this PRzarr-pythonRelevant to zarr-python upstream

Projects

None yet

Milestone

v2.0.0

Development

Successfully merging this pull request may close these issues.

3 participants

@TomNicholas@d-v-b@maxrjones

[8]ページ先頭

©2009-2025 Movatter.jp