Skip to content

TST: Add direct tests for _convolveNd_c Cython extension#19455

Open
dhruv1955 wants to merge 3 commits intoastropy:mainfrom
dhruv1955:tst/direct-convolve-cython
Open

TST: Add direct tests for _convolveNd_c Cython extension#19455
dhruv1955 wants to merge 3 commits intoastropy:mainfrom
dhruv1955:tst/direct-convolve-cython

Conversation

@dhruv1955
Copy link
Copy Markdown
Contributor

@dhruv1955 dhruv1955 commented Mar 18, 2026

Part of GSoC 2026 proposal: Hardening Astropy's Core Stability. Follows the same approach as #19410 (time) and #19407 (cosmology).

This PR adds direct tests for the _convolveNd_c Cython extension in astropy/convolution/_convolve.pyx, bypassing the public convolve() API to test the compiled interface directly.

Tests cover:

  • 1D convolution accuracy with a uniform kernel
  • NaN interpolation behavior
  • NaN propagation when interpolation is disabled
  • 2D identity kernel correctness
  • Output shape matching input shape
  • embed_result_within_padded_region=False with a pre-padded array

@github-actions
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

@dhruv1955
Copy link
Copy Markdown
Contributor Author

@neutrinoceros @astrofrog @nstarman - tagging as this is part of my GSoC 2026 proposal. Same approach as #19410 (time) and #19407 (cosmology) - direct pytest-based tests calling the Cython extension interface, no standalone C files.

@neutrinoceros
Copy link
Copy Markdown
Contributor

neutrinoceros commented Mar 20, 2026

Note is that this is "competing" with #19470
We could very likely merge both contributions, but the second one to go in might need some additional effort to harmonize the sum.
@dhruv1955, I see you already have a couple PRs merged, so I would lean towards prioritizing #19470 and come back to this one later. Would that be okay with you ?

@neutrinoceros neutrinoceros self-assigned this Mar 20, 2026
@dhruv1955
Copy link
Copy Markdown
Contributor Author

@neutrinoceros Thanks for the context. That works for me - happy to wait and harmonize once #19470 lands if needed. Let me know if there's anything you'd like me to adjust in this PR in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants