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

Method test_roll_consistency

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

Source from the content-addressed store, hash-verified

1550 v.roll(z=0)
1551
1552 def test_roll_consistency(self):
1553 v = Variable(("x", "y"), np.random.randn(5, 6))
1554
1555 for axis, dim in [(0, "x"), (1, "y")]:
1556 for shift in [-3, 0, 1, 7, 11]:
1557 expected = np.roll(v.values, shift, axis=axis)
1558 actual = v.roll(**{dim: shift}).values
1559 assert_array_equal(expected, actual)
1560
1561 def test_transpose(self):
1562 v = Variable(["time", "x"], self.d)

Callers

nothing calls this directly

Calls 3

rollMethod · 0.95
VariableClass · 0.90
rollMethod · 0.45

Tested by

no test coverage detected