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(): if key not in self.DEFAULT_VALUES.keys():
raise ValueError("Given key is unknown!\n" raise ValueError("Given key is unknown!\n"
"Please check spelling and refer to list LIFAC.KEYS.") "Please check spelling and refer to list LIFAC.KEYS.")
if "tau" in key and value < 0: if "tau" in key and value <= 0:
warn("Time constants cannot be negative! Setting it to 0.5ms") warn("Time constants cannot be zero or negative! Setting " + str(key) + " to 0.5ms")
self.parameters[key] = 0.00005 self.parameters[key] = 0.00005
return return
self.parameters[key] = value self.parameters[key] = value