Skip to content
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

Add Array metadata strategy #2813

Merged
merged 3 commits into from
Feb 13, 2025

Conversation

dcherian
Copy link
Contributor

@dcherian dcherian commented Feb 10, 2025

Found this useful for icechunk and presumably will be useful in virtualizarr (zarr-developers/VirtualiZarr#429 (review))

cc @TomNicholas @AimeeB @moradology

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/user-guide/*.rst
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@dcherian dcherian changed the title Add array_metadata strategy Add Array metadata strategy Feb 10, 2025
@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label Feb 10, 2025
@@ -85,12 +91,64 @@ def safe_unicode_for_dtype(dtype: np.dtype[np.str_]) -> st.SearchStrategy[str]:
# st.builds will only call a new store constructor for different keyword arguments
# i.e. stores.examples() will always return the same object per Store class.
# So we map a clear to reset the store.
stores = st.builds(MemoryStore, st.just({})).map(lambda x: sync(x.clear()))
stores = st.builds(MemoryStore, st.just({})).map(clear_store)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@maxrjones apparently this is only returning None today 🤦🏾‍♂️

@dcherian dcherian force-pushed the array-metadata-strategy branch from 67d4521 to 01dbceb Compare February 10, 2025 19:18
@github-actions github-actions bot removed the needs release notes Automatically applied to PRs which haven't added release notes label Feb 10, 2025
@dcherian dcherian force-pushed the array-metadata-strategy branch from 01dbceb to f9a3492 Compare February 10, 2025 19:20
@TomNicholas
Copy link
Member

Thanks @dcherian ! This looks potentially very useful for zarr-developers/VirtualiZarr#9

@dcherian dcherian closed this Feb 13, 2025
@dcherian dcherian reopened this Feb 13, 2025
@dcherian dcherian enabled auto-merge (squash) February 13, 2025 16:23
@dcherian dcherian merged commit 99621ec into zarr-developers:main Feb 13, 2025
45 of 56 checks passed
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.

3 participants