Skip to content

Commit

Permalink
Merge pull request #1649 from djhoese/bugfix-numpy-typing
Browse files Browse the repository at this point in the history
Fix requiring newer numpy just for typing annotations
  • Loading branch information
djhoese committed Apr 22, 2021
2 parents 9257378 + 8a7f333 commit b564e0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions satpy/_compat.py
Expand Up @@ -26,3 +26,10 @@
def cached_property(func):
"""Port back functools.cached_property."""
return property(lru_cache(maxsize=None)(func))


try:
from numpy.typing import ArrayLike # noqa
except ImportError:
# numpy <1.20
from numpy import ndarray as ArrayLike # noqa
2 changes: 1 addition & 1 deletion satpy/enhancements/__init__.py
Expand Up @@ -17,7 +17,6 @@
"""Enhancements."""

import numpy as np
from numpy.typing import ArrayLike
import xarray as xr
import dask
import dask.array as da
Expand All @@ -26,6 +25,7 @@
import logging
import warnings
from functools import partial
from satpy._compat import ArrayLike

LOG = logging.getLogger(__name__)

Expand Down

0 comments on commit b564e0c

Please sign in to comment.