Skip to content

Commit

Permalink
only show warning for at least 1 line
Browse files Browse the repository at this point in the history
  • Loading branch information
AWehrhahn committed Jun 7, 2022
1 parent ddcae66 commit c32766b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/pysme/sme_synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,16 @@ def InputLineList(self, linelist):
mask = np.full(len(linelist), False)
for key, value in max_ion.items():
mask |= (elem == key) & (ion > value)
logger.warning(
"Discarding %i high ionization lines, of species %s",
np.count_nonzero(mask),
", ".join(np.unique(linelist[mask].species)),
)
nlines = np.count_nonzero(mask)
# And remove those lines
linelist = linelist[~mask]
if nlines > 0:
warning = ", ".join(np.unique(linelist[mask]["species"]))
logger.warning(
"Discarding %i high ionization lines, of species %s",
nlines,
warning,
)
linelist = linelist[~mask]

# Prepare arrays for the C code
atomic = linelist["atomic"].T
Expand Down

0 comments on commit c32766b

Please sign in to comment.