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

Method test_rolling_properties

xarray/tests/test_rolling.py:93–109  ·  view source on GitHub ↗
(self, da)

Source from the content-addressed store, hash-verified

91 assert "`mean`" in rolling_obj.mean.__doc__
92
93 def test_rolling_properties(self, da) -> None:
94 rolling_obj = da.rolling(time=4)
95
96 assert rolling_obj.obj.get_axis_num("time") == 1
97
98 # catching invalid args
99 with pytest.raises(ValueError, match="window must be > 0"):
100 da.rolling(time=-2)
101
102 with pytest.raises(ValueError, match="min_periods must be greater than zero"):
103 da.rolling(time=2, min_periods=0)
104
105 with pytest.raises(
106 KeyError,
107 match=r"\('foo',\) not found in DataArray dimensions",
108 ):
109 da.rolling(foo=2)
110
111 @requires_dask
112 @pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

rollingMethod · 0.45
get_axis_numMethod · 0.45

Tested by

no test coverage detected