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

Method test_expand_dims_coords

xarray/tests/test_dataset.py:3732–3739  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3730 assert_identical(original, roundtripped)
3731
3732 def test_expand_dims_coords(self) -> None:
3733 original = Dataset({"x": ("a", np.array([1, 2, 3]))})
3734 expected = Dataset(
3735 {"x": (("b", "a"), np.array([[1, 2, 3], [1, 2, 3]]))}, coords={"b": [1, 2]}
3736 )
3737 actual = original.expand_dims(dict(b=[1, 2]))
3738 assert_identical(expected, actual)
3739 assert "b" not in original._coord_names
3740
3741 def test_expand_dims_existing_scalar_coord(self) -> None:
3742 original = Dataset({"x": 1}, {"a": 2})

Callers

nothing calls this directly

Calls 3

expand_dimsMethod · 0.95
DatasetClass · 0.90
assert_identicalFunction · 0.90

Tested by

no test coverage detected