Skip to content

Commit

Permalink
Fix ParticleFilter to work with set inputs (#3092)
Browse files Browse the repository at this point in the history
  • Loading branch information
johvincau authored Jul 30, 2024
1 parent 0ad0033 commit 467b8e9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions openmc/filter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations
from abc import ABCMeta
from collections.abc import Iterable
from collections.abc import Iterable, Sequence
import hashlib
from itertools import product
from numbers import Real, Integral
Expand Down Expand Up @@ -736,15 +736,15 @@ class ParticleFilter(Filter):
Parameters
----------
bins : str, or iterable of str
bins : str, or sequence of str
The particles to tally represented as strings ('neutron', 'photon',
'electron', 'positron').
filter_id : int
Unique identifier for the filter
Attributes
----------
bins : iterable of str
bins : sequence of str
The particles to tally
id : int
Unique identifier for the filter
Expand All @@ -764,8 +764,8 @@ def __eq__(self, other):

@Filter.bins.setter
def bins(self, bins):
bins = np.atleast_1d(bins)
cv.check_iterable_type('filter bins', bins, str)
cv.check_type('bins', bins, Sequence, str)
bins = np.atleast_1d(bins)
for edge in bins:
cv.check_value('filter bin', edge, _PARTICLES)
self._bins = bins
Expand Down

0 comments on commit 467b8e9

Please sign in to comment.