-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update models to accept parameter objects as node parameters #2482
Conversation
Thanks Håkon! Just to be sure: nodes do not need to implement |
@clinssen Yes, to be able to use a parameter object to set model parameters, the node pointer has to be passed when using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hakonsbm Thanks! It looks good, but I wonder if you could extend the test to test setting all parameters that can be set. I believe there is a test somewhere that does something like this, it may be a SLI test. Could you see if you can find that?
I'd also suggest to call the test test_regression_issue-2480.py
in line with the other Python regression tests we have.
@hakonsbm: could you point me to the changes I should make to make this work for synapses as well? I'm getting the same error when trying |
@heplesser I have moved the test to a new file. I can't find the test you mention which sets all parameters that can be set, though. I also thought about how one could test all settable parameters, but there are a couple problems with that. Getting all parameters that can be set would be complicated. And some node parameters require their values being lower or higher than other parameters, which is impossible to check without consulting the documentation for that model. Ultimately I think a test like that, while useful, would be too complicated and difficult to make reliable. |
@clinssen Parameter objects that set parameters of non-spatial connections requires the post-synaptic node. So to set the status of a synapse model, you would have to pass the node you get here:
It would then have to be passed as an argument down to the model's For spatial connections it's a bit more complicated, because you then need not only the post-synaptic node, but also the layer, source node position, and target node position. However, using parameter objects to set parameters of synapses is already possible when creating the connections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hakonsbm Thanks, looks good to me! Your point that a test checking all parameters would be too difficult, so I think the test we have now is good.
So this is not possible/expected to fail with the same |
@clinssen Yes, without the changes outlined in my previous comment it's impossible to set parameters of a synapse with a parameter object after the connection is created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The corresponding NESTML PR now contains a working test for setting both neuron and synapse variables with distributions, so I can now pass off on this. Cheers!
Some models were not updated to take parameter objects when setting parameters such as
V_m
. With this PR they are updated, and a test of settingV_m
for all relevant node models is added. Fixes #2480.