add condition that time constants (taus) are larger than 0

This commit is contained in:
AlexanderOtt 2020-04-02 10:00:53 +02:00
parent 45abc0ae14
commit 42ee462016

View File

@ -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