In PyNN 0.12.4, pyNN.nest.BetaPSR / CondBetaPostSynapticResponse rejects tau_rise and tau_decay, even though these are declared in CondBetaPostSynapticResponse.default_parameters.
Minimal example:
import pyNN.nest as sim
sim.setup()
receptor = sim.BetaPSR(
e_syn=0.0,
tau_rise=0.2,
tau_decay=1.5,
)
sim.end()
This fails with:
Traceback (most recent call last):
File "/home/tibor/cuni/virt_env/mozaik/lib/python3.10/site-packages/pyNN/parameters.py", line 341, in _setitem_value
expected_dtype = self.schema[name]
KeyError: 'tau_rise'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tibor/lala.py", line 4, in <module>
receptor = sim.BetaPSR(
File "/home/tibor/cuni/virt_env/mozaik/lib/python3.10/site-packages/pyNN/models.py", line 23, in __init__
self.parameter_space = ParameterSpace(self.default_parameters,
File "/home/tibor/cuni/virt_env/mozaik/lib/python3.10/site-packages/pyNN/parameters.py", line 283, in __init__
self.update(**parameters)
File "/home/tibor/cuni/virt_env/mozaik/lib/python3.10/site-packages/pyNN/parameters.py", line 320, in update
self.__setitem__(name, value)
File "/home/tibor/cuni/virt_env/mozaik/lib/python3.10/site-packages/pyNN/parameters.py", line 336, in __setitem__
self._setitem_value(name, value)
File "/home/tibor/cuni/virt_env/mozaik/lib/python3.10/site-packages/pyNN/parameters.py", line 347, in _setitem_value
raise errors.NonExistentParameterError(
pyNN.errors.NonExistentParameterError: tau_rise (valid parameters for CondBetaPostSynapticResponse are: e_syn, locations, tau_syn)
Suggested fix (pyNN/standardmodels/receptors.py):
class CondBetaPostSynapticResponse(StandardPostSynapticResponse):
"""
Post-synaptic response consisting of an beta-function-shaped synaptic conductance.
"""
default_parameters = {
"locations": 0.5, # synapses per micron
'e_syn': 0.0, # synaptic reversal potential in mV.
'tau_rise': 0.2, # rise time constant of the synaptic conductance in ms.
'tau_decay': 1.7 # decay time constant of the synaptic conductance in ms.
}
default_initial_values = {
"gsyn": 0.0
}
units = {
"gsyn": "uS"
}
conductance_based = True
+ def get_schema(self):
+ schema = super().get_schema()
+ schema.pop("tau_syn", None)
+ schema.update({
+ "tau_rise": float,
+ "tau_decay": float,
+ })
+ return schema
In PyNN 0.12.4,
pyNN.nest.BetaPSR/CondBetaPostSynapticResponserejectstau_riseandtau_decay, even though these are declared inCondBetaPostSynapticResponse.default_parameters.Minimal example:
This fails with:
Suggested fix (pyNN/standardmodels/receptors.py):
class CondBetaPostSynapticResponse(StandardPostSynapticResponse): """ Post-synaptic response consisting of an beta-function-shaped synaptic conductance. """ default_parameters = { "locations": 0.5, # synapses per micron 'e_syn': 0.0, # synaptic reversal potential in mV. 'tau_rise': 0.2, # rise time constant of the synaptic conductance in ms. 'tau_decay': 1.7 # decay time constant of the synaptic conductance in ms. } default_initial_values = { "gsyn": 0.0 } units = { "gsyn": "uS" } conductance_based = True + def get_schema(self): + schema = super().get_schema() + schema.pop("tau_syn", None) + schema.update({ + "tau_rise": float, + "tau_decay": float, + }) + return schema