GSoC: Standardize tolerance levels for TestBlackBodySimpleSource#3439
Open
abhayrajjais01 wants to merge 2 commits intotardis-sn:masterfrom
Open
GSoC: Standardize tolerance levels for TestBlackBodySimpleSource#3439abhayrajjais01 wants to merge 2 commits intotardis-sn:masterfrom
abhayrajjais01 wants to merge 2 commits intotardis-sn:masterfrom
Conversation
tardis-bot
reviewed
Feb 17, 2026
Contributor
tardis-bot
left a comment
There was a problem hiding this comment.
👋 Welcome @abhayrajjais01! Thank you for your first contribution to this repository!
If you are applying to GSoC, please read our AI Usage Policy and our PR checklist.
Please mark the pull request as draft if you are not ready for review yet or if there are things you will be adding.
Contributor
Author
|
hii @atharva-2001 |
3 tasks
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.
📝 Description
Type: 🧹 Refactor
Summary:
This PR standardizes the tolerance levels in
TestBlackBodySimpleSourceandTestBlackBodySimpleSourceRelby making the implicit default tolerance explicit. It introduces a module-level constantRELATIVE_TOLERANCE_BLACKBODY = 1e-7and updates allassert_allclosecalls to useatol=0andrtol=RELATIVE_TOLERANCE_BLACKBODY.Why this matters
Previously, all 8 test assertions used
numpy.testing.assert_allclose()without explicit tolerance parameters, relying on numpy's defaultrtol=1e-7. Making tolerances explicit is the first step toward standardizing them across the codebase, as seen in other modules liketest_sdec_plot.py.Current Tolerance Landscape (Context)
I analyzed the current state of tolerances across the codebase to inform this change:
rtol=1e-7(explicit)test_blackbody_sources.pyrtol=1e-12test_sdec_plot.pyrtol=1e-12test_liv_plot.pyrtol=1e-13test_montecarlo_main_loop.pyrtol=1e-13test_continuum.pyFuture Work
1e-7can be tightened to match the1e-12standard used in visualization tests.test_montecarlo_main_loop.py,test_continuum.py) to use module-level constants.🚦 Testing
ast.parse().RELATIVE_TOLERANCE_BLACKBODYis correctly applied to all 8 assertions.1e-7matches the previous implicit default.☑️ Checklist
AI/LLM Disclosure