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

Method test_getitem_with_mask_2d_input

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

Source from the content-addressed store, hash-verified

1447 assert_array_equal(v_new, v._data[0, 0])
1448
1449 def test_getitem_with_mask_2d_input(self):
1450 v = Variable(("x", "y"), [[0, 1, 2], [3, 4, 5]])
1451 assert_identical(
1452 v._getitem_with_mask(([-1, 0], [1, -1])),
1453 Variable(("x", "y"), [[np.nan, np.nan], [1, np.nan]]),
1454 )
1455 assert_identical(v._getitem_with_mask((slice(2), [0, 1, 2])), v)
1456
1457 def test_isel(self):
1458 v = Variable(["time", "x"], self.d)

Callers

nothing calls this directly

Calls 3

_getitem_with_maskMethod · 0.95
VariableClass · 0.90
assert_identicalFunction · 0.90

Tested by

no test coverage detected