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

Method test_dataset_compute

xarray/tests/test_backends.py:613–630  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

611 assert_identical(expected, actual)
612
613 def test_dataset_compute(self) -> None:
614 expected = create_test_data()
615
616 with self.roundtrip(expected) as actual:
617 # Test Dataset.compute()
618 for k, v in actual.variables.items():
619 # IndexVariables are eagerly cached
620 assert v._in_memory == (k in actual.dims)
621
622 computed = actual.compute()
623
624 for k, v in actual.variables.items():
625 assert v._in_memory == (k in actual.dims)
626 for v in computed.variables.values():
627 assert v._in_memory
628
629 assert_identical(expected, actual)
630 assert_identical(expected, computed)
631
632 def test_pickle(self) -> None:
633 expected = Dataset({"foo": ("x", [42])})

Callers

nothing calls this directly

Calls 6

roundtripMethod · 0.95
assert_identicalFunction · 0.90
create_test_dataFunction · 0.85
itemsMethod · 0.80
computeMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected