MCPcopy Index your code
hub / github.com/pydata/xarray / find_root_and_group

Function find_root_and_group

xarray/backends/common.py:252–259  ·  view source on GitHub ↗

Find the root and group name of a netCDF4/h5netcdf dataset.

(ds)

Source from the content-addressed store, hash-verified

250
251
252def find_root_and_group(ds):
253 """Find the root and group name of a netCDF4/h5netcdf dataset."""
254 hierarchy = ()
255 while ds.parent is not None:
256 hierarchy = (ds.name.split("/")[-1],) + hierarchy
257 ds = ds.parent
258 group = "/" + "/".join(hierarchy)
259 return ds, group
260
261
262def collect_ancestor_dimensions(group) -> dict[str, int]:

Callers 2

__init__Method · 0.90
__init__Method · 0.90

Calls 2

splitMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…