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

Method test_as_sparse

xarray/tests/test_variable.py:2555–2559  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2553 # TODO inherit VariableSubclassobjects to cover more tests
2554
2555 def test_as_sparse(self):
2556 data = np.arange(12).reshape(3, 4)
2557 var = Variable(("x", "y"), data)._as_sparse(fill_value=-1)
2558 actual = var._to_dense()
2559 assert_identical(var, actual)
2560
2561
2562class TestIndexVariable(VariableSubclassobjects):

Callers

nothing calls this directly

Calls 5

VariableClass · 0.90
assert_identicalFunction · 0.90
arangeMethod · 0.80
_as_sparseMethod · 0.45
_to_denseMethod · 0.45

Tested by

no test coverage detected