(self, func, dtype)
| 4266 | @pytest.mark.xfail(reason="ffill and bfill lose the unit") |
| 4267 | @pytest.mark.parametrize("func", (method("ffill"), method("bfill")), ids=repr) |
| 4268 | def test_missing_value_filling(self, func, dtype): |
| 4269 | array1 = ( |
| 4270 | create_nan_array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1], dtype) |
| 4271 | * unit_registry.degK |
| 4272 | ) |
| 4273 | array2 = ( |
| 4274 | create_nan_array([4.3, 9.8, 7.5, np.nan, 8.2, np.nan], dtype) |
| 4275 | * unit_registry.Pa |
| 4276 | ) |
| 4277 | |
| 4278 | ds = xr.Dataset({"a": ("x", array1), "b": ("y", array2)}) |
| 4279 | units = extract_units(ds) |
| 4280 | |
| 4281 | expected = attach_units(func(strip_units(ds), dim="x"), units) |
| 4282 | actual = func(ds, dim="x") |
| 4283 | |
| 4284 | assert_units_equal(expected, actual) |
| 4285 | assert_equal(expected, actual) |
| 4286 | |
| 4287 | @pytest.mark.parametrize( |
| 4288 | "unit,error", |
nothing calls this directly
no test coverage detected