Skip to content

Respect array namespaces when Bottleneck is installed - #959

Merged
mwcraig merged 4 commits into
astropy:mainfrom
nomad3:fix-904-gate-bottleneck-namespace
Jul 30, 2026
Merged

Respect array namespaces when Bottleneck is installed#959
mwcraig merged 4 commits into
astropy:mainfrom
nomad3:fix-904-gate-bottleneck-namespace

Conversation

@nomad3

@nomad3 nomad3 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • use Bottleneck's NaN-aware reductions only for NumPy or an unspecified array namespace
  • use the selected backend's native reductions for non-NumPy arrays
  • resolve average and sum uncertainty/reduction defaults at call time, after the data namespace is known
  • exercise both NumPy+Bottleneck and Dask+Bottleneck in CI

Fixes #904

Validation

  • failing-first on untouched main, Dask+Bottleneck test_combiner.py: 35 failed, 39 passed
  • focused namespace regressions: 6 passed with Dask+Bottleneck and 6 passed with NumPy+Bottleneck
  • full Combiner module: 80 passed with Dask+Bottleneck and 80 passed with NumPy+Bottleneck
  • full NumPy suite: 342 passed, 29 skipped
  • full Dask suite: 337 passed, 34 skipped
  • full JAX x64 suite: 335 passed, 29 skipped, 7 established xfails
  • black --check ccdproc/combiner.py ccdproc/tests/test_combiner.py
  • ruff check ccdproc/combiner.py ccdproc/tests/test_combiner.py
  • workflow YAML parse and git diff --check

AI assistance disclosure

I used OpenAI Codex to assist with repository inspection, test design, implementation, and review. I reviewed the resulting changes and take responsibility for their correctness and maintenance.

Checklist

  • For new contributors: Did you add yourself to the AUTHORS.rst file? (The entry is already in draft PR Exclude masked weights from average combinations #952 and is not duplicated here.)
  • For documentation changes: Does your commit message include a [skip ci]? (Not applicable.)
  • Did you add an entry to the CHANGES.rst file?
  • Did you add a regression test?
  • Does the commit message include a Fixes #issue_number?
  • Does this PR add, rename, move or remove any existing functions or parameters? (No; existing defaults are resolved at call time.)

nomad3 added a commit to nomad3/ccdproc that referenced this pull request Jul 19, 2026
Signed-off-by: Simon Aguilera <saguilera1608@gmail.com>
nomad3 added 2 commits July 29, 2026 21:04
Fixes astropy#904

Signed-off-by: Simon Aguilera <saguilera1608@gmail.com>
Signed-off-by: Simon Aguilera <saguilera1608@gmail.com>
@nomad3
nomad3 marked this pull request as ready for review July 30, 2026 01:14
@nomad3
nomad3 force-pushed the fix-904-gate-bottleneck-namespace branch from baabcb8 to c957961 Compare July 30, 2026 01:14
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.47059% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.82%. Comparing base (3ea1af9) to head (b78287c).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
ccdproc/combiner.py 76.47% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #959      +/-   ##
==========================================
- Coverage   96.70%   95.82%   -0.88%     
==========================================
  Files           8        8              
  Lines        1576     1628      +52     
==========================================
+ Hits         1524     1560      +36     
- Misses         52       68      +16     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread ccdproc/combiner.py Outdated
Comment thread ccdproc/combiner.py Outdated
Comment thread ccdproc/combiner.py Outdated
Comment thread ccdproc/combiner.py Outdated
Co-authored-by: Matt Craig <mattwcraig@gmail.com>

@mwcraig mwcraig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, @nomad3!

Thanks for fixing the old ubuntu-py312-bottleneck job that never actually installed bottleneck (its tox env lacked the bottleneck factor, and alldeps doesn't include it) — which is why CI never caught #904. The env rename here makes that job real
for the first time.

@mwcraig
mwcraig merged commit db5aa81 into astropy:main Jul 30, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Revisit how to handle bottleneck/array API implelementation

2 participants