-
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
Attribute assignment safeguards for NestModule
and SynapseCollection
#2220
Conversation
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.
@Helveg Thanks!
- This change seems too drastic, all Pynest tests seem to fail now ;).
- How does this address the problem that unknown synapse collection objects are not detected?
- Please add a regression test, both for kernel and synapse attributes.
I cannot think of any reason for this behavior. One technical aspect might be that the detection of unknown parameter names for node collections largely happens in |
Where can I find a description of this problem? I thought the problems were related to attribute assignment on |
Sorry, my comment was unclear. What I meant is: How does this change ensure that c = nest.GetConnections()
c.gewicht = 10 will raise an exception because |
There already was a |
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.
@Helveg Thanks for the fixes! Could you improve comments a little, see inline remarks?
@heplesser Yes, but the behaviour isn't consistent for NodeCollections and SynapseCollections. For empty NodeCollections, trying to get a non-existent attribute results in an An empty SynapseCollection will return an empty tuple when trying to get an unknown attribute, while setting an attribute will set the attribute on the SynapseCollection itself. Interestingly, setting a valid attribute, like |
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.
This looks good to me, I only have a small comment on a comment.
Regarding the different behavior for NodeCollection and SynapseCollection, I cannot remember why there is a difference. Maybe something we should look at further in another issue?
Co-authored-by: Stine Brekke Vennemo <stine.vennemo@gmail.com>
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.
👍
@Helveg: The merge of this PR leads to the following error on Read the Docs.
|
This breaks the documentation generation: https://readthedocs.org/api/v2/build/15469804.txt |
This was also one of the Python trickery |
|
Closes #2219.
Just 1 remark: while the network or synapse collection is empty, you can set unknown attributes. Any idea why this was implemented, should it remain that way?