Skip to content

Comments

Support glob patterns in open_datatree(group=...) for selective group loading#3

Closed
aladinor wants to merge 1 commit intoasync-dtreecfrom
glob-group-filtering
Closed

Support glob patterns in open_datatree(group=...) for selective group loading#3
aladinor wants to merge 1 commit intoasync-dtreecfrom
glob-group-filtering

Conversation

@aladinor
Copy link
Owner

When the group parameter contains glob metacharacters (*, ?, [), filter which groups are opened instead of re-rooting the tree. This avoids loading the entire hierarchy when only a subset is needed — useful for radar data (*/sweep_0) and CMIP archives (*/historical/tas).

Adds shared utilities _is_glob_pattern, _filter_group_paths, and _resolve_group_and_filter in common.py. Updates NetCDF4, H5NetCDF, and Zarr backends to use a discover → filter → open pipeline. Uses the same matching engine as DataTree.match().

Stacked on pydata#10742

… loading

When the group parameter contains glob metacharacters (*, ?, [), filter
which groups are opened instead of re-rooting the tree. This avoids
loading the entire hierarchy when only a subset is needed.

Adds shared utilities _is_glob_pattern, _filter_group_paths, and
_resolve_group_and_filter in common.py. Updates NetCDF4, H5NetCDF, and
Zarr backends to use the discover-filter-open pipeline. Includes unit
tests for the utilities and integration tests across all backends.

Closes pydata#11196
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant