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

Feature: group and array name properties #1940

Merged

Conversation

jhamman
Copy link
Member

@jhamman jhamman commented Jun 1, 2024

closes #1924

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)

@jhamman jhamman added the V3 label Jun 1, 2024
@jhamman jhamman added this to the 3.0.0.alpha milestone Jun 1, 2024
@jhamman jhamman changed the title Feature/group and array name properties Feature: group and array name properties Jun 2, 2024
def name(self) -> str | None:
"""Array name following h5py convention."""
if self.path:
# follow h5py convention: add leading slash
Copy link
Contributor

@rabernat rabernat Jun 3, 2024

Choose a reason for hiding this comment

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

Is this backwards compatible with V2?

Edit, yes it is. I just tried this:

import zarr
group = zarr.group(store={})
a = group.create('foo')
a = group.create('foo', shape=(1,))
assert a.name == '/foo'

@jhamman jhamman merged commit 72005d7 into zarr-developers:v3 Jun 3, 2024
18 checks passed
@jhamman jhamman deleted the feature/group-and-array-name-properties branch June 3, 2024 14:35
d-v-b pushed a commit to d-v-b/zarr-python that referenced this pull request Jun 4, 2024
* feature: group and array path/name/basename properties

* tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

v3 arrays have no .name attribute
3 participants