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
@keewis
Copy link
Collaborator

keewis commented Oct 22, 2025

looks like there was a similar attempt in #10400, in case it helps

According to our policy, we can drop python=3.11 from 2026-04-04 onwards – you can simulate this by passing today to minimum_versions:

python minimum_versions.py --policy ci/policy.yaml --today 2026-04-04 ci/requirements/min-all-deps.yml

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.

2 participants