Skip to content

Commit

Permalink
make sure synth segments are unique
Browse files Browse the repository at this point in the history
  • Loading branch information
AWehrhahn committed Apr 6, 2022
1 parent 441f3f8 commit e84f284
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/pysme/synthesize.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def check_segments(sme, segments):
segments = np.atleast_1d(segments)
if np.any(segments < 0) or np.any(segments >= sme.nseg):
raise IndexError("Segment(s) out of range")
segments = np.unique(segments)

if sme.mask is not None:
segments = [
Expand Down

0 comments on commit e84f284

Please sign in to comment.