From 8357fea9f57524eb4d69c456b34521d958c04ffa Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 12 Jun 2026 10:23:23 -0700 Subject: [PATCH] Avoid the dep warning for reproject.wcs_utils --- ndcube/ndcube.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ndcube/ndcube.py b/ndcube/ndcube.py index a9bcbb0ed..ee1b0909a 100644 --- a/ndcube/ndcube.py +++ b/ndcube/ndcube.py @@ -801,7 +801,12 @@ def reproject_to(self, """ try: from reproject import reproject_adaptive, reproject_exact, reproject_interp # noqa: PLC0415 - from reproject.wcs_utils import has_celestial # noqa: PLC0415 + try: + # Latest version of reproject has made this private + # but until we pin on that version, we need a fallback for older versions. + from reproject._wcs_utils import has_celestial # noqa: PLC0415 + except ImportError: + from reproject.wcs_utils import has_celestial # noqa: PLC0415 except ModuleNotFoundError: raise ImportError(f"The {type(self).__name__}.reproject_to method requires " f"the `reproject` library to be installed.")