(self, func, dtype)
| 4172 | ids=repr, |
| 4173 | ) |
| 4174 | def test_numpy_methods(self, func, dtype): |
| 4175 | a = np.linspace(1, -1, 10) * unit_registry.Pa |
| 4176 | b = np.linspace(-1, 1, 15) * unit_registry.degK |
| 4177 | ds = xr.Dataset({"a": ("x", a), "b": ("y", b)}) |
| 4178 | |
| 4179 | units_a = array_extract_units(func(a)) |
| 4180 | units_b = array_extract_units(func(b)) |
| 4181 | units = {"a": units_a, "b": units_b} |
| 4182 | |
| 4183 | actual = func(ds) |
| 4184 | expected = attach_units(func(strip_units(ds)), units) |
| 4185 | |
| 4186 | assert_units_equal(expected, actual) |
| 4187 | assert_equal(expected, actual) |
| 4188 | |
| 4189 | @pytest.mark.parametrize("func", (method("clip", min=3, max=8),), ids=repr) |
| 4190 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected