Skip to content

Feature: group and array name properties - #1940

Merged
jhamman merged 4 commits into
zarr-developers:v3from
jhamman:feature/group-and-array-name-properties
Jun 3, 2024
Merged

Feature: group and array name properties#1940
jhamman merged 4 commits into
zarr-developers:v3from
jhamman:feature/group-and-array-name-properties

Conversation

@jhamman

@jhamman jhamman commented Jun 1, 2024

Copy link
Copy Markdown
Member

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
…nto feature/group-and-array-name-properties
@jhamman jhamman changed the title Feature/group and array name properties Feature: group and array name properties Jun 2, 2024
Comment thread src/zarr/array.py
def name(self) -> str | None:
"""Array name following h5py convention."""
if self.path:
# follow h5py convention: add leading slash

@rabernat rabernat Jun 3, 2024

Copy link
Copy Markdown
Contributor

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
@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