-
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
Return empty dictionary if get()
is called on empty SynapseCollection
#2332
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.
Could you also add a test of conns.get()
on an empty SynapseCollection with specified keys (the case that should return ()
)?
Co-authored-by: Håkon Bakke Mørk <hakon.mork@nmbu.no>
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.
Thanks!
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.
Otherwise, it looks good to me.
|
||
nrns = nest.Create('iaf_psc_alpha', 2) | ||
nest.Connect(nrns, nrns, 'one_to_one') | ||
conns = nest.GetConnections() | ||
self.assertEqual(len(conns), 2) | ||
|
||
nest.ResetKernel() | ||
self.assertEqual(conns.get(), ()) | ||
self.assertEqual(conns.get(), {}) | ||
conns.set(weight=10.) |
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.
Is not resetting the kernel
equivalent to adding or deleting connections
, and in that case we should get a warning from the ConnectionManager
stating a similar info
as the following: ConnectionManager [Warning]: New connections created, connection descriptors previously obtained using 'GetConnections' are now invalid
. In that case, the user should know that setting the weight
in conn
object won't be a valid operation, or maybe throw an error that the weight
isn't in the connection dictionary anymore.
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.
@med-ayssar Could you make an issue for that?
This fixes #2318.