Skip to content

Commit 4c6aaa0

Browse files
committed
Fix PSR schema to track default_parameters (issue #837)
1 parent bec9b29 commit 4c6aaa0

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

pyNN/standardmodels/base.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,12 @@ class StandardPostSynapticResponse(StandardModelType, models.BasePostSynapticRes
188188
"""Base class for standardized post-synaptic receptor models."""
189189

190190
def get_schema(self):
191+
# Derive the validation schema from default_parameters so that it always
192+
# matches the actual parameters of each subclass. All post-synaptic
193+
# response parameters are floats except "locations".
191194
return {
192-
"locations": SynapseDistribution,
193-
"e_syn": float,
194-
"tau_syn": float # should be a tuple, if multiple time constants
195+
name: (SynapseDistribution if name == "locations" else float)
196+
for name in self.default_parameters
195197
}
196198

197199
def set_parent(self, parent):

0 commit comments

Comments
 (0)