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

Method test_drop_vars

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

Source from the content-addressed store, hash-verified

214 assert ds.coords["x"].dims == ("x", "y")
215
216 def test_drop_vars(self):
217 coords = Coordinates(
218 coords={
219 "x": Variable("x", range(3)),
220 "y": Variable("y", list("ab")),
221 "a": Variable(["x", "y"], np.arange(6).reshape(3, 2)),
222 },
223 indexes={},
224 )
225
226 actual = coords.drop_vars("x")
227 assert isinstance(actual, Coordinates)
228 assert set(actual.variables) == {"a", "y"}
229
230 actual = coords.drop_vars(["x", "y"])
231 assert isinstance(actual, Coordinates)
232 assert set(actual.variables) == {"a"}
233
234 def test_drop_dims(self) -> None:
235 coords = Coordinates(

Callers

nothing calls this directly

Calls 4

drop_varsMethod · 0.95
CoordinatesClass · 0.90
VariableClass · 0.90
arangeMethod · 0.80

Tested by

no test coverage detected