Skip to content

Commit

Permalink
fixed behaviour of calibrate when specifying analytes
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarbranson committed Jul 13, 2019
1 parent 3399c37 commit 1376f4f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions latools/latools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@ def calibrate(self, analytes=None, drift_correct=True,
None
"""
if analytes is None:
analytes = self.analytes.difference(self.internal_standard)
analytes = self.analytes.difference([self.internal_standard])
elif isinstance(analytes, str):
analytes = [analytes]

Expand All @@ -1605,14 +1605,12 @@ def calibrate(self, analytes=None, drift_correct=True,
self.calib_params = pd.DataFrame(columns=pd.MultiIndex.from_product([analytes, ['m']]),
index=gTime)

calib_analytes = self.srmtabs.index.get_level_values(0).unique()

if zero_intercept:
fn = lambda x, m: x * m
else:
fn = lambda x, m, c: x * m + c

for a in calib_analytes:
for a in analytes:
if zero_intercept:
if (a, 'c') in self.calib_params:
self.calib_params.drop((a, 'c'), 1, inplace=True)
Expand Down

0 comments on commit 1376f4f

Please sign in to comment.