Repository navigation
Quiet the warning of fiasco that an ion is solved with the single-ion model - #16
Merged
Merged
Conversation
… model fiasco asks for the two-ion model by default, and solves an ion without the data that model needs, which is most of them, with the single-ion model instead, logging a warning every time. The single-ion model is the right one for those ions, so `contribution_function` now drops that one record from the log of fiasco while it calls fiasco, and nothing else. Passing `use_two_ion_model=False` would change the lines of the ions which do have the data, and telling them apart beforehand needs an API private to fiasco. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xqpht97bF4FWsACAA4wQa
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 21 21
Lines 1414 1431 +17
=========================================
+ Hits 1414 1431 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Every contribution function utu computes logged a warning from fiasco, for nearly every ion:
fiasco asks for the two-ion model by default, and an ion without the data that model needs is solved with the single-ion model instead. That's most ions: of He 1, He 2, O 5, Ne 7, Fe 13, Mg 8 and Si 12, only Si 12 has the data. The single-ion model is the right one for those ions, so there is nothing for anyone to act on. The ESIS-II synthetic-image report (esis-mission/esis#72) shows the warning, twice, since drms configures the root logger when it is imported.
Fix
contribution_functionadds a filter tofiasco.logwhile it calls fiasco, which drops that one record. Everything else fiasco logs still comes through, and the filter is removed when the call returns. A filter on the logger drops the record before any handler sees it, the one drms adds included.Following the warning's advice and passing
use_two_ion_model=Falsewould change the lines of the ions which do have the data. Passing it for only the others would needIon._has_dataset, which is private to fiasco.Tests
test_contribution_function_single_ioncomputes O 5 with utu and checks that nothing is logged about the single-ion model. It then computes it with fiasco directly, and checks that fiasco does log it, so that the test is about an ion without the data and the filter is gone afterwards, and that both give the same numbers. Without the fix it fails. All 125 tests pass with the CHIANTI database, and black and ruff are clean.🤖 Generated with Claude Code
https://claude.ai/code/session_017xqpht97bF4FWsACAA4wQa