(self)
| 3150 | |
| 3151 | @requires_bottleneck |
| 3152 | def test_reduce_keepdims_bottleneck(self) -> None: |
| 3153 | import bottleneck |
| 3154 | |
| 3155 | coords = { |
| 3156 | "x": [-1, -2], |
| 3157 | "y": ["ab", "cd", "ef"], |
| 3158 | "lat": (["x", "y"], [[1, 2, 3], [-1, -2, -3]]), |
| 3159 | "c": -999, |
| 3160 | } |
| 3161 | orig = DataArray([[-1, 0, 1], [-3, 0, 3]], coords, dims=["x", "y"]) |
| 3162 | |
| 3163 | # Bottleneck does not have its own keepdims implementation |
| 3164 | actual = orig.reduce(bottleneck.nanmean, keepdims=True) |
| 3165 | expected = orig.mean(keepdims=True) |
| 3166 | assert_equal(actual, expected) |
| 3167 | |
| 3168 | def test_reduce_dtype(self) -> None: |
| 3169 | coords = { |
nothing calls this directly
no test coverage detected