Repository navigation
Identify pellet species by element, not by label or order - #14
Merged
jmcclena merged 2 commits intoNov 24, 2026
Merged
Conversation
dr_dt! chose the ablation model from exact labels ("D", "T", "Ne20", "C12") and, for Ne-D, assigned masses, charges and fractions by list position: the check species_list[1] == "Ne" never matches the label "Ne20" that selects the branch, so a layer listing Ne20 before D got the two masses swapped. Layers labelled "Ne" or "C" were rejected, and a carbon-deuterium mixture silently used the pure-carbon model.
Species are now found by element with IMAS.ion_properties (hydrogen isotopes by mass number, neon Z = 10, carbon Z = 6), the model is chosen from the exact set of elements in the layer, and anything else raises an error that names the species. The formulas are unchanged. Adds a species-detection testset.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
dr_dt!picks the ablation model from exact label strings:"D"and"T","Ne20"and"D", or"C12". Inside the Ne-D branch it assigns masses, charges and fractions by list position. The branch testsspecies_list[1] == "Ne"to decide the order, which never matches the label"Ne20"that selected the branch. So:Ne20beforeDgets the two masses swapped, and a wrong ablation rate;"Ne"or"C", whichIMAS.ion_propertiesaccepts, is rejected with "No ablation model";C12with another species silently uses the pure-carbon model.Fix
Species are found by element from
IMAS.ion_properties: the hydrogen isotopes by mass number, neon by Z = 10, carbon by Z = 6. The model is chosen from the exact set of elements in the layer, D-T, D-Ne or C. Anything else raises an error that names the species. The ablation formulas are unchanged. For the orders that already worked (D, T;T, D;D, Ne20), every variable takes the same value as before, and the OMFIT comparison test is unchanged.Test
A new
species detectiontestset runsrun_PAMon the D3D template and checks:"Ne"and"C"work, within the small mass difference from"Ne20"and"C12";On
master, 4 of these 6 checks fail. With this change all tests pass.🤖 Generated with Claude Code