TST: Add direct tests for _sigma_clip_fast C extension#19377
Open
dhruv1955 wants to merge 1 commit intoastropy:mainfrom
Open
TST: Add direct tests for _sigma_clip_fast C extension#19377dhruv1955 wants to merge 1 commit intoastropy:mainfrom
dhruv1955 wants to merge 1 commit intoastropy:mainfrom
Conversation
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.
|
Member
|
Same sentiment as #19378 (comment) |
Contributor
Author
|
cc @neutrinoceros - same motivation as #19378 which you reopened. Happy to update this one too if it's worth proceeding. |
9e380e9 to
eb3f48d
Compare
Contributor
Author
|
Thanks @neutrinoceros Added a module-level docstring explaining the full function signature and each parameter. Also removed the changelog fragment. Squashed to a single commit. |
eb3f48d to
26cda44
Compare
26cda44 to
5b2b8cf
Compare
Contributor
Author
|
Thanks @neutrinoceros. I've moved the parameter documentation into the C source file's docstring |
This was referenced Mar 15, 2026
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.
Summary
Add a dedicated test file for the
_sigma_clip_fastC extension function, testing it directly and independently of the publicSigmaClipAPI.Motivation
Astropy's test suite currently only tests
_sigma_clip_fastindirectly throughSigmaClip. These tests exercise the C extension directly, making them suitable for a future low-level test layer independent of the Python API.Tests added
test_basic_returns_finite_bounds- clean input returns finite boundstest_median_vs_mean_differ-use_medianflag changes boundstest_pre_masked_outlier_excluded- pre-masked values excluded from bound calculationtest_mad_std_vs_std_differ-use_mad_stdflag changes boundstest_max_iter_zero-max_iter=0returns finite boundstest_single_element- single element returns equal boundstest_all_masked_returns_nan- all-masked input returns NaN bounds