(self, dtype)
| 2092 | np.testing.assert_allclose(expected, actual) |
| 2093 | |
| 2094 | def test_stack(self, dtype): |
| 2095 | array = np.linspace(0, 5, 3 * 10).reshape(3, 10).astype(dtype) * unit_registry.m |
| 2096 | variable = xr.Variable(("x", "y"), array) |
| 2097 | |
| 2098 | expected = attach_units( |
| 2099 | strip_units(variable).stack(z=("x", "y")), extract_units(variable) |
| 2100 | ) |
| 2101 | actual = variable.stack(z=("x", "y")) |
| 2102 | |
| 2103 | assert_units_equal(expected, actual) |
| 2104 | assert_identical(expected, actual) |
| 2105 | |
| 2106 | def test_unstack(self, dtype): |
| 2107 | array = np.linspace(0, 5, 3 * 10).astype(dtype) * unit_registry.m |
nothing calls this directly
no test coverage detected