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

[v3] Implement Group methods for empty, full, ones, and zeros #2210

Merged
merged 11 commits into from
Sep 19, 2024

Conversation

lindseynield
Copy link
Contributor

This PR implements Group.{empty,zeros,ones,full,empty_like, zeros_like,onest_like,full_like} for V3. Here we simply call the top-level functions from zarr.api.asynchronous to accomplish this.

Closes #2125

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/tutorial.rst
  • Changes documented in docs/release.rst
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

empty_array = group.empty(shape=shape)
assert isinstance(empty_array, Array)
assert empty_array.fill_value == 0
assert empty_array.shape == shape
Copy link
Contributor Author

Choose a reason for hiding this comment

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

src/zarr/core/group.py Outdated Show resolved Hide resolved
@jhamman
Copy link
Member

jhamman commented Sep 19, 2024

Thanks @lindseynield and welcome to the Zarr project!

@jhamman jhamman merged commit 54060d3 into zarr-developers:v3 Sep 19, 2024
26 checks passed
dcherian added a commit to dcherian/zarr-python that referenced this pull request Sep 24, 2024
* v3:
  chore: update pre-commit hooks (zarr-developers#2222)
  fix: validate v3 dtypes when loading/creating v3 metadata (zarr-developers#2209)
  fix typo in store integration test (zarr-developers#2223)
  Basic Zarr-python 2.x compatibility changes (zarr-developers#2098)
  Make Group.arrays, groups compatible with v2 (zarr-developers#2213)
  Typing fixes to test_indexing (zarr-developers#2193)
  Default to RemoteStore for fsspec URIs (zarr-developers#2198)
  Make MemoryStore serialiazable (zarr-developers#2204)
  [v3] Implement Group methods for empty, full, ones, and zeros (zarr-developers#2210)
  implement `store.list_prefix` and `store._set_many` (zarr-developers#2064)
  Fixed codec for v2 data with no fill value (zarr-developers#2207)
@jhamman jhamman mentioned this pull request Oct 7, 2024
6 tasks
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.

[v3] implement Group.{empty,zeros,ones,full,empty_like, zeros_like,onest_like,full_like}
2 participants