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

Function test_explicitly_indexed_array_preserved

xarray/tests/test_variable.py:3274–3283  ·  view source on GitHub ↗

Test that methods using ._data preserve ExplicitlyIndexed arrays. Regression test for methods that should use ._data instead of .data to avoid loading lazy arrays into memory.

()

Source from the content-addressed store, hash-verified

3272
3273
3274def test_explicitly_indexed_array_preserved() -> None:
3275 """Test that methods using ._data preserve ExplicitlyIndexed arrays.
3276
3277 Regression test for methods that should use ._data instead of .data
3278 to avoid loading lazy arrays into memory.
3279 """
3280 arr = IndexableArray(np.array([1, 2, 3]))
3281 var = Variable(["x"], arr)
3282 result = var.drop_encoding()
3283 assert isinstance(result._data, indexing.ExplicitlyIndexed)

Callers

nothing calls this directly

Calls 3

drop_encodingMethod · 0.95
IndexableArrayClass · 0.90
VariableClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…