Commit 85fac1a
committed
Use array-API-compatible dtype conversion in Combiner._weighted_sum
Fixes #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.1 parent 9d25eee commit 85fac1a
2 files changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
1 | 12 | | |
2 | 13 | | |
3 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
603 | | - | |
| 603 | + | |
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
| |||
0 commit comments