Skip to content

Commit

Permalink
remove the compatibility code in duck_array_ops.allclose_or_equiv (py…
Browse files Browse the repository at this point in the history
  • Loading branch information
keewis authored Jul 26, 2020
1 parent 50dcdac commit 9d6b174
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions xarray/core/duck_array_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import contextlib
import inspect
import warnings
from distutils.version import LooseVersion
from functools import partial

import numpy as np
Expand All @@ -21,14 +20,6 @@
except ImportError:
dask_array = None # type: ignore

# TODO: remove after we stop supporting dask < 2.9.1
try:
import dask

dask_version = dask.__version__
except ImportError:
dask_version = None


def _dask_or_eager_func(
name,
Expand Down Expand Up @@ -217,16 +208,6 @@ def allclose_or_equiv(arr1, arr2, rtol=1e-5, atol=1e-8):

lazy_equiv = lazy_array_equiv(arr1, arr2)
if lazy_equiv is None:
# TODO: remove after we require dask >= 2.9.1
sufficient_dask_version = (
dask_version is not None and LooseVersion(dask_version) >= "2.9.1"
)
if not sufficient_dask_version and any(
isinstance(arr, dask_array_type) for arr in [arr1, arr2]
):
arr1 = np.array(arr1)
arr2 = np.array(arr2)

return bool(isclose(arr1, arr2, rtol=rtol, atol=atol, equal_nan=True).all())
else:
return lazy_equiv
Expand Down

0 comments on commit 9d6b174

Please sign in to comment.