Repository: astropy/ccdproc (python)

Issue:
Error with Numpy 2.0.0rc1
I'm running into the following error with Numpy 2.0.0rc1:

```
    from .extern.bitfield import bitfield_to_boolean_mask as _bitfield_to_boolean_mask
.tox/py311-ccdproc/lib/python3.11/site-packages/ccdproc/extern/bitfield.py:56: in <module>
    MAX_UINT_TYPE = np.maximum_sctype(np.uint)
.tox/py311-ccdproc/lib/python3.11/site-packages/numpy/__init__.py:397: in __getattr__
    raise AttributeError(
E   AttributeError: `np.maximum_sctype` was removed in the NumPy 2.0 release. Use a specific dtype instead. You should avoid relying on any implicit mechanism and select the largest dtype of a kind explicitly in the code.
```

Pull request:
Avoid using np.maximum_sctype (dropped in NumPy 2)
Fixes #818, but doesn't yet allow testing against numpy 2: astroscrappy needs a compatible release before that.

Patch:
diff --git a/.readthedocs.yml b/.readthedocs.yml
index abb7e64..d180ab0 100644
--- a/.readthedocs.yml
+++ b/.readthedocs.yml
@@ -1,13 +1,12 @@
 version: 2
 
 build:
-  os: ubuntu-22.04
-  tools:
-    python: "3.10"
-
-sphinx:
-  configuration: docs/conf.py
+  image: latest
 
 python:
+  version: 3.8
   install:
-  - requirements: docs/rtd-pip-requirements
+    - method: pip
+      path: .
+      extra_requirements:
+        - docs
diff --git a/ccdproc/extern/bitfield.py b/ccdproc/extern/bitfield.py
index b09f45c..13a194f 100644
--- a/ccdproc/extern/bitfield.py
+++ b/ccdproc/extern/bitfield.py
@@ -53,7 +53,7 @@ __all__ = ['bitfield_to_boolean_mask', 'interpret_bit_flags', 'is_bit_flag']
 # 1.1.1 (30-January-2018) - Improved filtering of high bits in flags.
 #
 INT_TYPE = (int, long,) if sys.version_info < (3,) else (int,)
-MAX_UINT_TYPE = np.maximum_sctype(np.uint)
+MAX_UINT_TYPE = np.uint64
 SUPPORTED_FLAGS = int(np.bitwise_not(
     0, dtype=MAX_UINT_TYPE, casting='unsafe'
 ))
diff --git a/docs/rtd-pip-requirements b/docs/rtd-pip-requirements
index 0b8954f..59a3449 100644
--- a/docs/rtd-pip-requirements
+++ b/docs/rtd-pip-requirements
@@ -1,3 +1,6 @@
--e .  # install ccdproc itself (and its dependencies)
+numpy>=1.9
+scipy
+scikit-image
 numpydoc
+astropy>=3.0
 sphinx-astropy
diff --git a/setup.cfg b/setup.cfg
index 93c3b09..ce03157 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -4,7 +4,7 @@ minversion = 2.2
 testpaths = "ccdproc" "docs"
 norecursedirs = build docs/_build
 doctest_plus = enabled
-addopts = --doctest-rst --color=yes
+addopts = --doctest-rst
 filterwarnings=
     error
     ignore:numpy\.ufunc size changed:RuntimeWarning


Test patch:
diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml
index 0787ffb..55a6535 100644
--- a/.github/workflows/ci_tests.yml
+++ b/.github/workflows/ci_tests.yml
@@ -76,7 +76,7 @@ jobs:
     - name: Check out repository
       uses: actions/checkout@v4
     - name: Set up Python ${{ matrix.python }}
-      uses: actions/setup-python@v5
+      uses: actions/setup-python@v4
       with:
         python-version: ${{ matrix.python }}
     - name: Install base dependencies
@@ -101,4 +101,4 @@ jobs:
     #   run: tox -e ${{ matrix.tox_env }} -- --remote-data=any
     - name: Upload coverage to codecov
       if: "endsWith(matrix.tox_env, '-cov')"
-      uses: codecov/codecov-action@v4
+      uses: codecov/codecov-action@v3
diff --git a/ccdproc/tests/test_cosmicray.py b/ccdproc/tests/test_cosmicray.py
index 278cd17..e5ea9f2 100644
--- a/ccdproc/tests/test_cosmicray.py
+++ b/ccdproc/tests/test_cosmicray.py
@@ -168,13 +168,7 @@ def test_cosmicray_lacosmic_detects_inconsistent_units():
     assert 'Inconsistent units' in str(e.value)
 
 
-if OLD_ASTROSCRAPPY:
-    decorator = pytest.mark.filterwarnings("ignore:`np.bool` is a deprecated alias:DeprecationWarning")
-else:
-    decorator = lambda f: f
-
-@decorator
-def test_cosmicray_lacosmic_warns_on_ccd_in_electrons():
+def test_cosmicray_lacosmic_warns_on_ccd_in_electrons(recwarn):
     # Check that an input ccd in electrons raises a warning.
     ccd_data = ccd_data_func(data_scale=DATA_SCALE)
     # The unit below is important for the test; this unit on
@@ -189,13 +183,12 @@ def test_cosmicray_lacosmic_warns_on_ccd_in_electrons():
     # Don't really need to set this (6.5 is the default value) but want to
     # make lack of units explicit.
     readnoise = 6.5
-    with pytest.warns(UserWarning, match="Image unit is electron"):
-        cosmicray_lacosmic(
-            ccd_data,
-            gain=gain,
-            gain_apply=True,
-            readnoise=readnoise
-        )
+    new_ccd = cosmicray_lacosmic(ccd_data,
+                                 gain=gain,
+                                 gain_apply=True,
+                                 readnoise=readnoise)
+
+    assert "Image unit is electron" in str(recwarn.pop())
 
 
 # The skip can be removed when the oldest supported astroscrappy
diff --git a/ccdproc/tests/test_image_collection.py b/ccdproc/tests/test_image_collection.py
index ee381ac..eb5a55e 100644
--- a/ccdproc/tests/test_image_collection.py
+++ b/ccdproc/tests/test_image_collection.py
@@ -952,7 +952,6 @@ class TestImageFileCollection:
 
         assert n_heads == expected_heads
 
-    @pytest.mark.filterwarnings("ignore:The following header keyword is invalid:UserWarning")
     def test_less_strict_verify_option(self, triage_setup):
         # Tests for feature request
         #