From 1376f4f1098f3b874f639ec760e70296d7c5d9ec Mon Sep 17 00:00:00 2001 From: Oscar Date: Sat, 13 Jul 2019 16:29:31 +1000 Subject: [PATCH] fixed behaviour of calibrate when specifying analytes --- latools/latools.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/latools/latools.py b/latools/latools.py index 2f1872e..c18497b 100644 --- a/latools/latools.py +++ b/latools/latools.py @@ -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] @@ -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)