Repository navigation
List the ions of the database utu.spectrum.ions() is given - #13
Merged
Merged
Conversation
`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
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Open
5 tasks done
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
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 ionsions()returns.The ions are now listed from
hdf5_dbase_rootwhen 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
test_ions_databasereplacesfiasco.list_ionswith a stand-in and checks that it receives the given database. It fails onmain, where the stand-in receivesNone.pytest utu/spectrum/_tests/test_lines.py -k ionspasses locally against CHIANTI 11.0.2.ruff check .andblack --check utu.🤖 Generated with Claude Code
https://claude.ai/code/session_01TN11CvLpJ9mX44K3MaCyB1