nest-simulator icon indicating copy to clipboard operation
nest-simulator copied to clipboard

Properly control validity of NodeCollections and SynapseCollections with hashes

Open heplesser opened this issue 1 year ago • 1 comments

NodeCollections and SynapseCollections remain existent in Python even after a ResetKernel(). We currently protect against failing C++ assertions on set()/get() on SynapseCollection by checking against an empty network, but that is approximate at best.

A robust solution would be to generate a time-based hash every time ResetKernel() is called. Each NodeCollection is assigned the kernel hash valid when it is created, and any operation using the NodeCollection to interact with the kernel checks that the NC-hash is equal to the current kernel hash.

For SynapseCollections, one can do things correspondingly, but here a new hash should be set every time connections_have_changed is set to true. The "no longer valid" warning can then disappear, as the user will get an error.

heplesser avatar Feb 11 '24 17:02 heplesser

Issue automatically marked stale!

github-actions[bot] avatar Apr 12 '24 08:04 github-actions[bot]