From 7ce9e868f6538342fac8a9ee15df90d23ce6d7f6 Mon Sep 17 00:00:00 2001 From: Alexander Minges Date: Mon, 24 Aug 2015 17:36:32 +0200 Subject: [PATCH] Throw an additional warning for really bad r squared values --- libkinetics/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libkinetics/__init__.py b/libkinetics/__init__.py index b23ae5c..80e37ee 100644 --- a/libkinetics/__init__.py +++ b/libkinetics/__init__.py @@ -42,9 +42,12 @@ class Replicate(): self.owner.concentration_unit) self.logger.info('Linear fit for {} #{}:'.format(conc, self.num)) - if r_squared < 0.9: + if r_squared < 0.9 and r_squared > 0.7: msg = ' r-squared: {} < 0.9; Check fit manually!' self.logger.warning(msg.format(round(r_squared, 4))) + elif r_squared < 0.7: + msg = ' r-squared: {} < 0.7; Linear fit probably failed!' + self.logger.warning(msg.format(round(r_squared, 4))) else: msg = ' r-squared: {}' self.logger.info(msg.format(round(r_squared, 4)))