Skip to content

Commit

Permalink
Remove version checks for older versions than the min deps (pydata#5311)
Browse files Browse the repository at this point in the history
  • Loading branch information
Illviljan authored May 15, 2021
1 parent c6f2cf0 commit 08955e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
3 changes: 0 additions & 3 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sys
import warnings
from collections import defaultdict
from distutils.version import LooseVersion
from html import escape
from numbers import Number
from operator import methodcaller
Expand Down Expand Up @@ -4043,8 +4042,6 @@ def unstack(
for v in self.variables.values()
)
or sparse
# numpy full_like only added `shape` in 1.17
or LooseVersion(np.__version__) < LooseVersion("1.17")
# Until https://github.com/pydata/xarray/pull/4751 is resolved,
# we check explicitly whether it's a numpy array. Once that is
# resolved, explicitly exclude pint arrays.
Expand Down
12 changes: 4 additions & 8 deletions xarray/core/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import warnings
from collections import defaultdict
from datetime import timedelta
from distutils.version import LooseVersion
from typing import (
Any,
Dict,
Expand Down Expand Up @@ -1027,7 +1026,6 @@ def chunk(self, chunks={}, name=None, lock=False):
-------
chunked : xarray.Variable
"""
import dask
import dask.array as da

if chunks is None:
Expand Down Expand Up @@ -1057,12 +1055,10 @@ def chunk(self, chunks={}, name=None, lock=False):
data = indexing.ImplicitToExplicitIndexingAdapter(
data, indexing.OuterIndexer
)
if LooseVersion(dask.__version__) < "2.0.0":
kwargs = {}
else:
# All of our lazily loaded backend array classes should use NumPy
# array operations.
kwargs = {"meta": np.ndarray}

# All of our lazily loaded backend array classes should use NumPy
# array operations.
kwargs = {"meta": np.ndarray}
else:
kwargs = {}

Expand Down

0 comments on commit 08955e2

Please sign in to comment.