Use array-API dtype in Combiner; fix stale test#925
Open
karlhillx wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #925 +/- ##
=======================================
Coverage 96.56% 96.56%
=======================================
Files 8 8
Lines 1571 1571
=======================================
Hits 1517 1517
Misses 54 54 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
85fac1a to
0ab3a95
Compare
0ab3a95 to
f18622c
Compare
Fixes astropy#924. The string-based weights.astype('float64') triggers a DeprecationWarning in JAX's array API implementation, which is promoted to a test failure in the py313-jax CI job. Use xp.astype(weights, xp.float64) instead, where xp is the array namespace already in scope at that point in the function. This works across all array-API backends (numpy, jax, cupy, etc.) without deprecation warnings. The issue body also notes a 'stale' test in test_image_collection.py (test_generator_ccds_without_unit) where it claims ImageFileCollection.ccds() no longer raises ValueError. Verified locally against astropy 7.2.0 that the test still passes as written — ccds() does still raise ValueError when no unit is supplied (via CCDData.__init__ enforcing _config_ccd_requires_unit). The 'stale test' part of the issue appears to be based on a misreading of the current behavior, so the test is left as-is. No new tests needed: the JAX CI job is the verification for the array-API dtype change.
f18622c to
a5f80d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #924.
Two changes:
ccdproc/combiner.py:603—weights.astype("float64")→xp.astype(weights, xp.float64). The actual JAX deprecation.ccdproc/tests/test_image_collection.py:387-401—ccds()raisesValueErrorin every backend except JAX, so the test branches: asserts the raise in numpy/dask, asserts a CCDData is returned in JAX. Same pattern astest_memory_use.py.The py313-jax job still has 6 failures from
np.result_typeinastropy.nddata.mixins.ndarithmetic:769when scaling CCDData. That's astropy code, not ccdproc, and predates this PR — worth a separate issue upstream.cc @mwcraig