Repository navigation
Allow DistribcellFilter to work with apply_tally_results=True - #3667
Merged
Merged
Conversation
pshriwise
reviewed
Dec 2, 2025
pshriwise
left a comment
Contributor
There was a problem hiding this comment.
Thanks @paulromano! The updates are much appreciated.
Just one curiosity about linking data to the tally and filter objects.
Contributor
Author
|
@pshriwise PR has been updated with the change you requested along with a unit test to confirm that the fix for DistribcellFilter works as intended |
pshriwise
reviewed
Dec 4, 2025
pshriwise
requested changes
Dec 4, 2025
pshriwise
left a comment
Contributor
There was a problem hiding this comment.
A few small thoughts and then I think this is good to go. Thanks @paulromano!
pshriwise
reviewed
Dec 4, 2025
Contributor
Author
|
@pshriwise thanks for the review. Your comments have been addressed ✔️ |
pshriwise
approved these changes
Dec 4, 2025
pshriwise
left a comment
Contributor
There was a problem hiding this comment.
Looks great @paulromano! Thanks for the fixes with sprinkles and a cherry on top! 🍒
jon-proximafusion
pushed a commit
to shimwell/openmc
that referenced
this pull request
Apr 13, 2026
apingegno
pushed a commit
to apingegno/openmc
that referenced
this pull request
May 7, 2026
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.
Description
Currently, if you run a model with a tally that has a
DistribcellFilterand try to useapply_tally_results=True, it raises an exception if you try to look at the tally results because the number of bins on the filter is not populated. This PR fixes it by making the following updates:Tally._read_resultsmethod.Tallyis marked with a_modelattribute that references theModelthat holds it, and eachFilteris marked with a_tallyattribute that references one of the tallies that holds it. This makes it so that we can determine geometry paths to cell instances, which are used when callingget_pandas_dataframeon a tally that includes aDistribcellFilterA few other miscellaneous fixes are included in this PR:
apply_tally_results=True, if you look at theshapeattribute of a tally, it has zero for the middle dimension (nuclides) when no nuclides are specified. Now it will show 1, corresponding to the default of "total".SearchResultclass was not showing up in theopenmcnamespace because it wasn't specifically imported from openmc.model.gnds_namewhere possibleChecklist