(self, use_cftime: bool)
| 1943 | reverse.resample(time=resample_freq).mean() |
| 1944 | |
| 1945 | def test_resample_doctest(self, use_cftime: bool) -> None: |
| 1946 | # run the doctest example here so we are not surprised |
| 1947 | da = xr.DataArray( |
| 1948 | np.array([1, 2, 3, 1, 2, np.nan]), |
| 1949 | dims="time", |
| 1950 | coords=dict( |
| 1951 | time=( |
| 1952 | "time", |
| 1953 | xr.date_range( |
| 1954 | "2001-01-01", freq="ME", periods=6, use_cftime=use_cftime |
| 1955 | ), |
| 1956 | ), |
| 1957 | labels=("time", np.array(["a", "b", "c", "c", "b", "a"])), |
| 1958 | ), |
| 1959 | ) |
| 1960 | actual = da.resample(time="3ME").count() |
| 1961 | expected = DataArray( |
| 1962 | [1, 3, 1], |
| 1963 | dims="time", |
| 1964 | coords={ |
| 1965 | "time": xr.date_range( |
| 1966 | "2001-01-01", freq="3ME", periods=3, use_cftime=use_cftime |
| 1967 | ) |
| 1968 | }, |
| 1969 | ) |
| 1970 | assert_identical(actual, expected) |
| 1971 | |
| 1972 | def test_da_resample_func_args(self) -> None: |
| 1973 | def func(arg1, arg2, arg3=0.0): |
nothing calls this directly
no test coverage detected