MCPcopy
hub / github.com/pydata/xarray / coordinates_from_variable

Function coordinates_from_variable

xarray/core/coordinates.py:1353–1359  ·  view source on GitHub ↗
(variable: Variable)

Source from the content-addressed store, hash-verified

1351
1352
1353def coordinates_from_variable(variable: Variable) -> Coordinates:
1354 (name,) = variable.dims
1355 new_index, index_vars = create_default_index_implicit(variable)
1356 indexes = dict.fromkeys(index_vars, new_index)
1357 new_vars = new_index.create_variables()
1358 new_vars[name].attrs = variable.attrs
1359 return Coordinates(new_vars, indexes)

Callers 6

__init__Method · 0.90
_factorize_uniqueMethod · 0.90
_factorize_dummyMethod · 0.90
factorizeMethod · 0.90
factorizeMethod · 0.90
_flox_reduceMethod · 0.90

Calls 3

CoordinatesClass · 0.85
create_variablesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…