Skip to content

Commit 7a4041a

Browse files
authored
Avoid the dep warning for reproject.wcs_utils (#943)
1 parent 685c1f7 commit 7a4041a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

ndcube/ndcube.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,12 @@ def reproject_to(self,
801801
"""
802802
try:
803803
from reproject import reproject_adaptive, reproject_exact, reproject_interp # noqa: PLC0415
804-
from reproject.wcs_utils import has_celestial # noqa: PLC0415
804+
try:
805+
# Latest version of reproject has made this private
806+
# but until we pin on that version, we need a fallback for older versions.
807+
from reproject._wcs_utils import has_celestial # noqa: PLC0415
808+
except ImportError:
809+
from reproject.wcs_utils import has_celestial # noqa: PLC0415
805810
except ModuleNotFoundError:
806811
raise ImportError(f"The {type(self).__name__}.reproject_to method requires "
807812
f"the `reproject` library to be installed.")

0 commit comments

Comments
 (0)