(self)
| 250 | assert set(actual.variables) == set() |
| 251 | |
| 252 | def test_rename_dims(self) -> None: |
| 253 | coords = Coordinates( |
| 254 | coords={ |
| 255 | "x": Variable("x", range(3)), |
| 256 | "y": Variable("y", list("ab")), |
| 257 | "a": Variable(["x", "y"], np.arange(6).reshape(3, 2)), |
| 258 | }, |
| 259 | indexes={}, |
| 260 | ) |
| 261 | |
| 262 | actual = coords.rename_dims({"x": "X"}) |
| 263 | assert isinstance(actual, Coordinates) |
| 264 | assert set(actual.dims) == {"X", "y"} |
| 265 | assert set(actual.variables) == {"a", "x", "y"} |
| 266 | |
| 267 | actual = coords.rename_dims({"x": "u", "y": "v"}) |
| 268 | assert isinstance(actual, Coordinates) |
| 269 | assert set(actual.dims) == {"u", "v"} |
| 270 | assert set(actual.variables) == {"a", "x", "y"} |
| 271 | |
| 272 | def test_rename_vars(self) -> None: |
| 273 | coords = Coordinates( |
nothing calls this directly
no test coverage detected