MCPcopy Index your code
hub / github.com/pydata/xarray / test_reindex_attrs_encoding

Method test_reindex_attrs_encoding

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

Source from the content-addressed store, hash-verified

2396 assert_identical(expected, actual)
2397
2398 def test_reindex_attrs_encoding(self) -> None:
2399 ds = Dataset(
2400 {"data": ("x", [1, 2, 3])},
2401 {"x": ("x", [0, 1, 2], {"foo": "bar"}, {"bar": "baz"})},
2402 )
2403 actual = ds.reindex(x=[0, 1])
2404 expected = Dataset(
2405 {"data": ("x", [1, 2])},
2406 {"x": ("x", [0, 1], {"foo": "bar"}, {"bar": "baz"})},
2407 )
2408 assert_identical(actual, expected)
2409 assert actual.x.encoding == expected.x.encoding
2410
2411 def test_reindex_warning(self) -> None:
2412 data = create_test_data()

Callers

nothing calls this directly

Calls 3

reindexMethod · 0.95
DatasetClass · 0.90
assert_identicalFunction · 0.90

Tested by

no test coverage detected