Conversation
… tally docs Two places call openmc_load_nuclide and turn a failure into a thrown std::runtime_error. Nothing catches either of them -- there is no try/catch on the initialization path at all -- so both end the process with "terminate called after throwing an instance of" and no OpenMC error message. Tally::set_nuclides is the reachable one. A tally bin names a nuclide, so an element symbol does not resolve even when the element is in the material: nuclides=['C'] aborts on a material made of C12, as does a plain typo. Report it with the offending name. read_ce_cross_sections is the same pattern; Material::init_nuclide_index checks the library first so nothing reaches it today, but the two should fail the same way. Checking the names in Python is tempting, but cannot raise: a multi-group bin may name a macroscopic dataset, whose name is arbitrary and indistinguishable from a typo without knowing the model's energy mode, and Tally.nuclides also accepts the CrossNuclide and AggregateNuclide objects that tally arithmetic produces. A warning that fires on valid input is worth less than an error that names the problem, which is what the above now gives. Also drop the user guide's claim that 'all' can be listed as a nuclide. Only "total" is special-cased; "all" is recognized for trigger scores and nowhere else, so following that advice lands in the error above. Point at Material.get_nuclides() instead, and say that an element symbol is not a valid bin even for photon tallies, whose data is tabulated per element. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JxR1sQWWnALXj39rX12v7c
GuySten
marked this pull request as ready for review
September 14, 2026 16:02
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.
Two places call openmc_load_nuclide and turn a failure into a thrown std::runtime_error. Nothing catches either of them -- there is no try/catch on the initialization path at all -- so both end the process with "terminate called after throwing an instance of" and no OpenMC error message.
Tally::set_nuclides is the reachable one. A tally bin names a nuclide, so an element symbol does not resolve even when the element is in the material: nuclides=['C'] aborts on a material made of C12, as does a plain typo. Report it with the offending name. read_ce_cross_sections is the same pattern; Material::init_nuclide_index checks the library first so nothing reaches it today, but the two should fail the same way.
Checking the names in Python is tempting, but cannot raise: a multi-group bin may name a macroscopic dataset, whose name is arbitrary and indistinguishable from a typo without knowing the model's energy mode, and Tally.nuclides also accepts the CrossNuclide and AggregateNuclide objects that tally arithmetic produces. A warning that fires on valid input is worth less than an error that names the problem, which is what the above now gives.
Also drop the user guide's claim that 'all' can be listed as a nuclide. Only "total" is special-cased; "all" is recognized for trigger scores and nowhere else, so following that advice lands in the error above. Point at Material.get_nuclides() instead, and say that an element symbol is not a valid bin even for photon tallies, whose data is tabulated per element.
Checklist