()
| 107 | |
| 108 | |
| 109 | def 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 | |
| 125 | def add(a, b): |
nothing calls this directly
no test coverage detected
searching dependent graphs…