Skip to content

CI failure: JAX job fails due to dtype deprecation warning and stale test expectation #924

@mwcraig

Description

@mwcraig

The JAX-based CI job (see run: https://github.com/astropy/ccdproc/actions/runs/26826491243/job/79159310096?pr=923) is currently failing due to two main issues:

1. JAX deprecation warning promoted to test failure

DeprecationWarning: Implicit conversion of an array to a dtype is deprecated; rather than dtype=arr use dtype=arr.dtype.

This comes from code that does something like astype("float64") or similar string-based dtype conversion, which triggers failures in array-API backends like JAX.

Recommended fix:

  • In ccdproc/combiner.py, change any .astype("float64") to xp.astype(weights, xp.float64) or .astype(xp.float64) using the array namespace where available.
  • The key line is in _weighted_sum:
    # Change this:
    weights = weights.astype("float64")
    # To this (inside the context of using array namespace xp):
    weights = xp.astype(weights, xp.float64)
  • Ensure all dtype conversions are via the array namespace for array-API compatibility.

2. Outdated test: test_generator_ccds_without_unit

The test test_generator_ccds_without_unit in ccdproc/tests/test_image_collection.py expects ImageFileCollection.ccds() to raise a ValueError if no unit is supplied. This is no longer the actual behavior (ccds are now created regardless).

Recommended fix:

  • Update the test function (lines 387–393) to check that a CCDData object is returned, not that an exception is raised:
    def test_generator_ccds_without_unit(self, triage_setup):
        collection = ImageFileCollection(
            location=triage_setup.test_dir, keywords=["imagetyp"]
        )
        ccd = next(collection.ccds())
        assert isinstance(ccd, CCDData)

Both fixes will resolve the current CI failures for the JAX (py313-jax) job.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions