Skip to content

Properly control validity of NodeCollections and SynapseCollections with hashes #3100

@heplesser

Description

@heplesser

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I: No breaking changePreviously written code will work as before, no one should note anything changing (aside the fix)S: NormalHandle this with default priorityT: EnhancementNew functionality, model or documentationstaleAutomatic marker for inactivity, please have another look here

    Type

    No type

    Projects

    Status

    To do (open issues)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions