Skip to content

Commit

Permalink
Allow peaks to have zero area, but emit a warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Nov 24, 2020
1 parent 67d8d16 commit 4cdbe2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyms/Peak/Class.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,10 @@ def area(self, value: float):

if not is_number(value):
raise TypeError("'Peak.area' must be a positive number")
elif value <= 0:
elif value < 0:
raise ValueError("'Peak.area' must be a positive number")
elif value <= 0:
warnings.warn(f"Peak {self!r} @ {self.rt} seconds has zero area.")

self._area = value

Expand Down

0 comments on commit 4cdbe2f

Please sign in to comment.