From a0c807b3cecf724b51972d38c6acd33ae96028d5 Mon Sep 17 00:00:00 2001
From: "P. L. Lim" <2090236+pllim@users.noreply.github.com>
Date: Tue, 21 Nov 2023 10:04:59 -0500
Subject: [PATCH 1/5] TST: Add pyerfa-dev to devdeps
---
tox.ini | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tox.ini b/tox.ini
index b859d32..a3e4dde 100644
--- a/tox.ini
+++ b/tox.ini
@@ -11,7 +11,7 @@ envlist =
passenv = HOME,CI,jref
setenv =
- devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
+ devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
# Run the tests in a temporary directory to make sure that we don't import
# package from the source tree
@@ -38,6 +38,7 @@ deps =
devdeps: scipy>=0.0.dev0
devdeps: matplotlib>=0.0.dev0
devdeps: scikit-image>=0.0.dev0
+ devdeps: pyerfa>=0.0.dev0
devdeps: astropy>=0.0.dev0
devdeps: git+https://github.com/astropy/photutils.git
devdeps: git+https://github.com/spacetelescope/ci_watson.git
From d4ba51e5c125a372532e03424fc90beac08ef60f Mon Sep 17 00:00:00 2001
From: "P. L. Lim" <2090236+pllim@users.noreply.github.com>
Date: Tue, 21 Nov 2023 10:22:43 -0500
Subject: [PATCH 2/5] Add error message to skimage import warning
---
acstools/utils_findsat_mrt.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/acstools/utils_findsat_mrt.py b/acstools/utils_findsat_mrt.py
index cdaa87a..51637cd 100644
--- a/acstools/utils_findsat_mrt.py
+++ b/acstools/utils_findsat_mrt.py
@@ -20,8 +20,8 @@
from skimage import transform
from skimage.transform._warps import warp
from skimage._shared.utils import convert_to_float
-except ImportError:
- warnings.warn('skimage not installed. MRT calculation will not work.')
+except ImportError as e:
+ warnings.warn(f'skimage not installed. MRT calculation will not work: {repr(e)}')
# check for scipy
try:
From 25021656793e9e3145c439ad24c2e1ceaa890f14 Mon Sep 17 00:00:00 2001
From: "P. L. Lim" <2090236+pllim@users.noreply.github.com>
Date: Thu, 7 Dec 2023 20:28:40 -0500
Subject: [PATCH 3/5] Handle destripe diff due to numpy 2.0 see
spacetelescope/acstools#184
---
acstools/tests/test_wfc_destripe.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/acstools/tests/test_wfc_destripe.py b/acstools/tests/test_wfc_destripe.py
index 67e08e3..533fb73 100644
--- a/acstools/tests/test_wfc_destripe.py
+++ b/acstools/tests/test_wfc_destripe.py
@@ -26,7 +26,9 @@ def _destripe_one(self, inputfile, outsuffix, outputfile, truthfile,
mask1=masks[0], mask2=masks[1])
# Compare results
- self.compare_outputs([(outputfile, truthfile)], rtol=1e-6)
+ # NOTE: atol instead of rtol was set due to numpy 2.0,
+ # see https://github.com/spacetelescope/acstools/issues/184
+ self.compare_outputs([(outputfile, truthfile)], atol=0.01)
# jb5g05ubq = calibrated post-SM4 WFC full-frame exposures without masks
# ja0x03ojq = calibrated polarizer WFC subarray exposures
From 8a8c39120bf5c68278ad73572f3df614ae33bc4e Mon Sep 17 00:00:00 2001
From: "P. L. Lim" <2090236+pllim@users.noreply.github.com>
Date: Thu, 7 Dec 2023 20:40:49 -0500
Subject: [PATCH 4/5] Let CI run without scikit-image by skipping
test_wfc_findsat_mrt and test_wfc_satdet
---
acstools/tests/test_wfc_findsat_mrt.py | 3 +++
acstools/tests/test_wfc_satdet.py | 4 ++++
setup.cfg | 2 ++
3 files changed, 9 insertions(+)
diff --git a/acstools/tests/test_wfc_findsat_mrt.py b/acstools/tests/test_wfc_findsat_mrt.py
index e7045f7..743908b 100644
--- a/acstools/tests/test_wfc_findsat_mrt.py
+++ b/acstools/tests/test_wfc_findsat_mrt.py
@@ -1,11 +1,14 @@
'''Test satellite trail detection and masking using findsat_mrt.'''
import os
+import pytest
from astropy.io.fits import FITSDiff
from astropy.utils.data import get_pkg_data_filename
from acstools.findsat_mrt import WfcWrapper
+pytest.importorskip("skimage")
+
def test_WfcWrapper(tmp_path):
"""Identify and mask trails in WFC extension 4."""
diff --git a/acstools/tests/test_wfc_satdet.py b/acstools/tests/test_wfc_satdet.py
index 90d7264..1434095 100644
--- a/acstools/tests/test_wfc_satdet.py
+++ b/acstools/tests/test_wfc_satdet.py
@@ -3,10 +3,14 @@
.. note:: Cannot test ``detsat()`` because PHT results change from run to run!
"""
+import pytest
+
from acstools import satdet
from acstools.utils_findsat_mrt import update_dq
from acstools.tests.helpers import BaseACSTOOLS
+pytest.importorskip("skimage")
+
class TestSatDet(BaseACSTOOLS):
detector = 'wfc'
diff --git a/setup.cfg b/setup.cfg
index 555a365..5cb1674 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -87,6 +87,8 @@ filterwarnings =
# Ignore numpy 2.0 warning, see https://github.com/astropy/astropy/pull/15495
# and https://github.com/scipy/scipy/pull/19275
ignore:.*numpy\.core.*:DeprecationWarning
+ # Do not let broken scikit-image block the rest of test suite
+ ignore:skimage not installed
[flake8]
# Ignoring these for now:
From 6d1e3105cf18a086002e8822522b8e571f6a9262 Mon Sep 17 00:00:00 2001
From: "P. L. Lim" <2090236+pllim@users.noreply.github.com>
Date: Fri, 8 Dec 2023 10:37:26 -0500
Subject: [PATCH 5/5] Fix link
---
doc/source/index.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 49448f2..d6a14d4 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -5,7 +5,7 @@ ACSTOOLS
########
Software tools for
-`Advanced Camera for Surveys (ACS) `_.
+`Advanced Camera for Surveys (ACS) `_.
Different ways to install the latest release of this package::