Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix requiring newer numpy just for typing annotations #1649

Merged
merged 2 commits into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions satpy/_compat.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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