From ccec9ee7bfdaab126ca2a33020df6667618abf5b Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 11 Feb 2022 21:29:37 -0600 Subject: [PATCH] Optimization for complete list of bin indices --- openmc/tallies.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openmc/tallies.py b/openmc/tallies.py index c7bc35933..436e3189e 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -1110,7 +1110,11 @@ class Tally(IDManagerMixin): bins = self_filter.bins # Add indices for each bin in this Filter to the list - indices = np.array([self_filter.get_bin_index(b) for b in bins]) + + if type(self_filter) in filters: + indices = np.array([self_filter.get_bin_index(b) for b in bins]) + else: + indices = np.arange(len(bins)) filter_indices.append(indices) # Account for stride in each of the previous filters