MCPcopy
hub / github.com/pydata/xarray / test_drop_dims

Method test_drop_dims

xarray/tests/test_coordinates.py:234–250  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

232 assert set(actual.variables) == {"a"}
233
234 def test_drop_dims(self) -> None:
235 coords = Coordinates(
236 coords={
237 "x": Variable("x", range(3)),
238 "y": Variable("y", list("ab")),
239 "a": Variable(["x", "y"], np.arange(6).reshape(3, 2)),
240 },
241 indexes={},
242 )
243
244 actual = coords.drop_dims("x")
245 assert isinstance(actual, Coordinates)
246 assert set(actual.variables) == {"y"}
247
248 actual = coords.drop_dims(["x", "y"])
249 assert isinstance(actual, Coordinates)
250 assert set(actual.variables) == set()
251
252 def test_rename_dims(self) -> None:
253 coords = Coordinates(

Callers

nothing calls this directly

Calls 4

drop_dimsMethod · 0.95
CoordinatesClass · 0.90
VariableClass · 0.90
arangeMethod · 0.80

Tested by

no test coverage detected