Skip to content

Quiet the warning of fiasco that an ion is solved with the single-ion model - #16

Merged
roytsmart merged 1 commit into
mainfrom
bugfix/single-ion-warning
Oct 20, 2026
Merged

roytsmart merged 1 commit into
mainfrom
bugfix/single-ion-warning

Conversation

@roytsmart

Copy link
Copy Markdown
Contributor

Every contribution function utu computes logged a warning from fiasco, for nearly every ion:

WARNING: No autoionization or level-resolved radiative recombination data available for He 1. Using single-ion model for level populations calculation. To silence this warning, set use_two_ion_model=False. [fiasco.ions]

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_function adds a filter to fiasco.log while 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=False would change the lines of the ions which do have the data. Passing it for only the others would need Ion._has_dataset, which is private to fiasco.

Tests

test_contribution_function_single_ion computes 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

… 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

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (cecd0dc) to head (dc7f1bb).

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.
📢 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.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 utu | 🛠️ Build #35258237 | 📁 Comparing dc7f1bb against latest (cecd0dc)

  🔍 Preview build  

1 file changed
± _modules/utu/spectrum/_lines.html

@roytsmart
roytsmart merged commit ea429ec into main Oct 20, 2026
13 checks passed
@roytsmart
roytsmart deleted the bugfix/single-ion-warning branch October 20, 2026 12:27
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.

1 participant