Skip to content

Conversation

shoyer
Copy link
Member

@shoyer shoyer commented Oct 15, 2025

This PR adds support for indexing with multiple items as a list of paths in DataTree.__getitem__, e.g., tree[['first', 'second']].

It also includes internal improvements to NodePath (now renamed to TreePath):

  • Rename NodePath to TreePath to make its name slightly more obvious
  • Automatically normalize paths in the TreePath constructor
  • Use joinpath() and normalized tree paths to simplify implementations of _get_item and _set_item.

- Rename `NodePath` to `TreePath` to make its name slightly more obvious
- Automatically normalize paths in the `TreePath` constructor
- Use `joinpath()` and normalized tree paths to simplify implementations
  of `_get_item` and `_set_item`.

None of these changes are user facing.
@shoyer shoyer requested a review from TomNicholas October 15, 2025 00:04
@github-actions github-actions bot added topic-backends topic-zarr Related to zarr storage library topic-DataTree Related to the implementation of a DataTree class io labels Oct 15, 2025
@shoyer shoyer changed the title Internal improvements to NodePath (renamed to TreePath) Support multiple items in DataTree.__getitem__ and improve NodePath (renamed to TreePath) Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

io topic-backends topic-DataTree Related to the implementation of a DataTree class topic-zarr Related to zarr storage library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant