From 42ee4620160b181ad818c01a8939ac53f2a7d913 Mon Sep 17 00:00:00 2001 From: AlexanderOtt Date: Thu, 2 Apr 2020 10:00:53 +0200 Subject: [PATCH] add condition that time constants (taus) are larger than 0 --- models/AbstractModel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/AbstractModel.py b/models/AbstractModel.py index 3ce8b03..1a16dcb 100644 --- a/models/AbstractModel.py +++ b/models/AbstractModel.py @@ -78,8 +78,8 @@ class AbstractModel: if key not in self.DEFAULT_VALUES.keys(): raise ValueError("Given key is unknown!\n" "Please check spelling and refer to list LIFAC.KEYS.") - if "tau" in key and value < 0: - warn("Time constants cannot be negative! Setting it to 0.5ms") + if "tau" in key and value <= 0: + warn("Time constants cannot be zero or negative! Setting " + str(key) + " to 0.5ms") self.parameters[key] = 0.00005 return self.parameters[key] = value