Skip to content

Commit

Permalink
Merge pull request #304 from JB-Wolf/fix-add
Browse files Browse the repository at this point in the history
generate reprofiled in Spectrum.__add__ if not present.
  • Loading branch information
MKoesters authored Sep 8, 2022
2 parents 3238071 + e3c28f0 commit fb27b80
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pymzml/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,8 @@ def __add__(self, other_spec):
if self._peak_dict["reprofiled"] is None:
reprofiled = self._reprofile_Peaks()
self.set_peaks(reprofiled, "reprofiled")
if other_spec._peak_dict["reprofiled"] is None:
other_spec.set_peaks(other_spec._reprofile_Peaks(), "reprofiled")
for mz, i in other_spec.peaks("reprofiled"):
self._peak_dict["reprofiled"][mz] += i
return self
Expand Down

0 comments on commit fb27b80

Please sign in to comment.