Skip to content

Commit

Permalink
Adding a comment to explain flexibility of tally estimators in equiva…
Browse files Browse the repository at this point in the history
…lence check
  • Loading branch information
pshriwise committed Sep 13, 2024
1 parent d32fee8 commit 7a64ff7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion openmc/tallies.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ def __eq__(self, other):
return False
if other.name != self.name:
return False
if self.estimator is not None and other.estimator != self.estimator:
# estimators are automatically set during OpenMC initialization if this value is None, so it
# it not considered a requirement for equivalence if it is unset on either tally as it implies that
# the user is allowing OpenMC to apply the appropriate estimator. If the value is explicitly set
# on both tallies, then it must match to be considered equivalent.
if self.estimator is not None and other.estimator is not None and other.estimator != self.estimator:
return False
if other.filters != self.filters:
return False
Expand Down

0 comments on commit 7a64ff7

Please sign in to comment.