Return all bin indices for filters not specified in Tally.get_filter_indices
#1969
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.
Introducing a change when providing all indices of a filter's bins in
Tally.get_filter_indices
for cases where the filter is not specified. Right now as the method collects bin indices for each filter on theTally
object, the method callsFilter.get_bin_index
for every filter bin regardless of whether or not specific bins were specified on the filter in the function call in thefilters
argument.The method should safely (and more quickly) be able to use a set of indices generated by
np.arange(len(bins))
for filters not specified in thefilters
argument. As I understand it, this array is what would be produced were we to perform theFilter.get_bin_index
calls sequentially anyway since we want the full set of bins.The downside here is that this approach bypasses some checking that occurs in each Filter's
get_bin_index
method. Looking at our current set of filters, it shouldn't be a problem, but there's a chance it might bite us in the future. Based on the patterns present for theEnergyFunctionFilter
, however, I think the filter will be different enough that it will be clear what unique treatment is needed.