|
4 | 4 | from typing import Any, Generic
|
5 | 5 |
|
6 | 6 | import numpy as np
|
7 |
| -from packaging.version import Version |
8 | 7 |
|
9 | 8 | from xarray.core.computation import apply_ufunc
|
10 | 9 | from xarray.core.options import _get_keep_attrs
|
11 | 10 | from xarray.core.pdcompat import count_not_none
|
12 | 11 | from xarray.core.types import T_DataWithCoords
|
13 | 12 | from xarray.core.utils import module_available
|
14 |
| -from xarray.namedarray import pycompat |
15 | 13 |
|
16 | 14 |
|
17 | 15 | def _get_alpha(
|
@@ -81,14 +79,6 @@ def __init__(
|
81 | 79 | raise ImportError(
|
82 | 80 | "numbagg >= 0.2.1 is required for rolling_exp but currently numbagg is not installed"
|
83 | 81 | )
|
84 |
| - elif pycompat.mod_version("numbagg") < Version("0.2.1"): |
85 |
| - raise ImportError( |
86 |
| - f"numbagg >= 0.2.1 is required for rolling_exp but currently version {pycompat.mod_version('numbagg')} is installed" |
87 |
| - ) |
88 |
| - elif pycompat.mod_version("numbagg") < Version("0.3.1") and min_weight > 0: |
89 |
| - raise ImportError( |
90 |
| - f"numbagg >= 0.3.1 is required for `min_weight > 0` within `.rolling_exp` but currently version {pycompat.mod_version('numbagg')} is installed" |
91 |
| - ) |
92 | 82 |
|
93 | 83 | self.obj: T_DataWithCoords = obj
|
94 | 84 | dim, window = next(iter(windows.items()))
|
@@ -192,10 +182,6 @@ def std(self) -> T_DataWithCoords:
|
192 | 182 | Dimensions without coordinates: x
|
193 | 183 | """
|
194 | 184 |
|
195 |
| - if pycompat.mod_version("numbagg") < Version("0.4.0"): |
196 |
| - raise ImportError( |
197 |
| - f"numbagg >= 0.4.0 is required for rolling_exp().std(), currently {pycompat.mod_version('numbagg')} is installed" |
198 |
| - ) |
199 | 185 | import numbagg
|
200 | 186 |
|
201 | 187 | dim_order = self.obj.dims
|
@@ -225,10 +211,6 @@ def var(self) -> T_DataWithCoords:
|
225 | 211 | array([ nan, 0. , 0.46153846, 0.18461538, 0.06446281])
|
226 | 212 | Dimensions without coordinates: x
|
227 | 213 | """
|
228 |
| - if pycompat.mod_version("numbagg") < Version("0.4.0"): |
229 |
| - raise ImportError( |
230 |
| - f"numbagg >= 0.4.0 is required for rolling_exp().var(), currently {pycompat.mod_version('numbagg')} is installed" |
231 |
| - ) |
232 | 214 | dim_order = self.obj.dims
|
233 | 215 | import numbagg
|
234 | 216 |
|
@@ -258,10 +240,6 @@ def cov(self, other: T_DataWithCoords) -> T_DataWithCoords:
|
258 | 240 | Dimensions without coordinates: x
|
259 | 241 | """
|
260 | 242 |
|
261 |
| - if pycompat.mod_version("numbagg") < Version("0.4.0"): |
262 |
| - raise ImportError( |
263 |
| - f"numbagg >= 0.4.0 is required for rolling_exp().cov(), currently {pycompat.mod_version('numbagg')} is installed" |
264 |
| - ) |
265 | 243 | dim_order = self.obj.dims
|
266 | 244 | import numbagg
|
267 | 245 |
|
@@ -292,10 +270,6 @@ def corr(self, other: T_DataWithCoords) -> T_DataWithCoords:
|
292 | 270 | Dimensions without coordinates: x
|
293 | 271 | """
|
294 | 272 |
|
295 |
| - if pycompat.mod_version("numbagg") < Version("0.4.0"): |
296 |
| - raise ImportError( |
297 |
| - f"numbagg >= 0.4.0 is required for rolling_exp().corr(), currently {pycompat.mod_version('numbagg')} is installed" |
298 |
| - ) |
299 | 273 | dim_order = self.obj.dims
|
300 | 274 | import numbagg
|
301 | 275 |
|
|
0 commit comments