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

Function test_apply_identity

xarray/tests/test_computation.py:109–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107
108
109def test_apply_identity() -> None:
110 array = np.arange(10)
111 variable = xr.Variable("x", array)
112 data_array = xr.DataArray(variable, [("x", -array)])
113 dataset = xr.Dataset({"y": variable}, {"x": -array})
114
115 apply_identity = functools.partial(apply_ufunc, identity)
116
117 assert_identical(array, apply_identity(array))
118 assert_identical(variable, apply_identity(variable))
119 assert_identical(data_array, apply_identity(data_array))
120 assert_identical(data_array, apply_identity(data_array.groupby("x")))
121 assert_identical(dataset, apply_identity(dataset))
122 assert_identical(dataset, apply_identity(dataset.groupby("x")))
123
124
125def add(a, b):

Callers

nothing calls this directly

Calls 4

groupbyMethod · 0.95
groupbyMethod · 0.95
arangeMethod · 0.80
assert_identicalFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…