Skip to content

List the ions of the database utu.spectrum.ions() is given - #13

Merged
roytsmart merged 1 commit into
mainfrom
bug_fix/ions-database
Oct 10, 2026
Merged

roytsmart merged 1 commit into
mainfrom
bug_fix/ions-database

Conversation

@roytsmart

Copy link
Copy Markdown
Contributor

Summary

utu.spectrum.ions(hdf5_dbase_root=...) opened each ion from the database it was given, but listed the ions from fiasco's default database (fiasco.list_ions() with no arguments). An ion that only the given database has was therefore never returned. Its lines were silently missing for any caller that computes lines only for the ions ions() returns.

The ions are now listed from hdf5_dbase_root when it's given, and from fiasco's default database otherwise, as before.

Found by a review of sun-data/solar-dynamics-observatory#28. That PR's generator runs on several CHIANTI databases, and until this is released it guards against the problem itself. CHIANTI 9.0.1 and 11.0.2 list the same 495 ions, so nothing has gone wrong in practice yet.

Test plan

  • New test_ions_database replaces fiasco.list_ions with a stand-in and checks that it receives the given database. It fails on main, where the stand-in receives None.
  • pytest utu/spectrum/_tests/test_lines.py -k ions passes locally against CHIANTI 11.0.2.
  • ruff check . and black --check utu.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TN11CvLpJ9mX44K3MaCyB1

`utu.spectrum.ions(hdf5_dbase_root=...)` opened each ion from the given
database but listed the ions from fiasco's default one, so an ion only the
given database has was never returned. The ions are now listed from the
database in `hdf5_dbase_root` when it is given.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TN11CvLpJ9mX44K3MaCyB1
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 utu | 🛠️ Build #35063088 | 📁 Comparing 35f1be1 against latest (2f1880b)

  🔍 Preview build  

2 files changed
± _autosummary/utu.spectrum.ions.html
± _modules/utu/spectrum/_lines.html

@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2f1880b) to head (35f1be1).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #13   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         1044      1055   +11     
=========================================
+ Hits          1044      1055   +11     

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

@roytsmart
roytsmart merged commit e269f91 into main Oct 10, 2026
13 checks passed
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