(self)
| 270 | assert set(actual.variables) == {"a", "x", "y"} |
| 271 | |
| 272 | def test_rename_vars(self) -> None: |
| 273 | coords = Coordinates( |
| 274 | coords={ |
| 275 | "x": Variable("x", range(3)), |
| 276 | "y": Variable("y", list("ab")), |
| 277 | "a": Variable(["x", "y"], np.arange(6).reshape(3, 2)), |
| 278 | }, |
| 279 | indexes={}, |
| 280 | ) |
| 281 | |
| 282 | actual = coords.rename_vars({"x": "X"}) |
| 283 | assert isinstance(actual, Coordinates) |
| 284 | assert set(actual.dims) == {"x", "y"} |
| 285 | assert set(actual.variables) == {"a", "X", "y"} |
| 286 | |
| 287 | actual = coords.rename_vars({"x": "u", "y": "v"}) |
| 288 | assert isinstance(actual, Coordinates) |
| 289 | assert set(actual.dims) == {"x", "y"} |
| 290 | assert set(actual.variables) == {"a", "u", "v"} |
| 291 | |
| 292 | def test_operator_merge(self) -> None: |
| 293 | coords1 = Coordinates({"x": ("x", [0, 1, 2])}) |
nothing calls this directly
no test coverage detected