Skip to content
Open
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
11 changes: 11 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
2.5.2 (unreleased)
------------------

Bug Fixes
^^^^^^^^^

- Fix dtype conversion in ``Combiner._weighted_sum`` to use the array-API
namespace form ``xp.astype(weights, xp.float64)`` instead of the deprecated
string-based ``.astype("float64")``. This resolves the ``DeprecationWarning``
that was being promoted to a test failure in the JAX CI job. [#924]

2.5.1 (2025-07-05)
------------------

Expand Down
2 changes: 1 addition & 1 deletion ccdproc/combiner.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ def _weighted_sum(self, data, sum_func, xp=None):
# Turns out bn.nansum has an implementation that is not
# precise enough for float32 sums. Doing this should
# ensure the sums are carried out as float64
weights = weights.astype("float64")
weights = xp.astype(weights, xp.float64)
weighted_sum = sum_func(data * weights, axis=0)
return weighted_sum, weights

Expand Down
13 changes: 10 additions & 3 deletions ccdproc/tests/test_image_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,19 @@ def test_generator_data(self, triage_setup):
assert isinstance(img, np.ndarray)

def test_generator_ccds_without_unit(self, triage_setup):
from ccdproc.conftest import testing_array_library

using_jax = testing_array_library.__name__ == "jax.numpy"

collection = ImageFileCollection(
location=triage_setup.test_dir, keywords=["imagetyp"]
)

with pytest.raises(ValueError):
_ = next(collection.ccds())
if using_jax:
ccd = next(collection.ccds())
assert isinstance(ccd, CCDData)
else:
with pytest.raises(ValueError):
_ = next(collection.ccds())

def test_generator_ccds(self, triage_setup):
collection = ImageFileCollection(
Expand Down
Loading