Skip to content

Commit

Permalink
Enforce sequence type when setting Setting.track (openmc-dev#3071)
Browse files Browse the repository at this point in the history
  • Loading branch information
johvincau authored Jul 8, 2024
1 parent 1b22dd2 commit b11f8b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openmc/settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from collections.abc import Iterable, Mapping, MutableSequence
from collections.abc import Iterable, Mapping, MutableSequence, Sequence
from enum import Enum
import itertools
from math import ceil
Expand Down Expand Up @@ -819,7 +819,7 @@ def track(self) -> typing.Iterable[typing.Iterable[int]]:

@track.setter
def track(self, track: typing.Iterable[typing.Iterable[int]]):
cv.check_type('track', track, Iterable)
cv.check_type('track', track, Sequence)
for t in track:
if len(t) != 3:
msg = f'Unable to set the track to "{t}" since its length is not 3'
Expand Down

0 comments on commit b11f8b7

Please sign in to comment.