Skip to content

Commit

Permalink
use module_available instead of eagerly importing
Browse files Browse the repository at this point in the history
  • Loading branch information
keewis committed Jan 12, 2024
1 parent 25f8e3b commit b4e126d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xarray/core/duck_array_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
from xarray.core.utils import is_duck_array, module_available

# remove once numpy 2.0 is the oldest supported version
try:
if module_available("numpy", minversion="2.0.0.dev0"):
from numpy.lib.array_utils import normalize_axis_index
except ImportError:
else:
from numpy.core.multiarray import normalize_axis_index # type: ignore[attr-defined]


Expand Down

0 comments on commit b4e126d

Please sign in to comment.