brian icon indicating copy to clipboard operation
brian copied to clipboard

Allow simple saving/loading of synaptic variables via Synapses.save_connectivity/load_connectivity

Open ghost opened this issue 10 years ago • 1 comments

Added optional argument synaptic_vars to Synapses.save_connectivity that may contain a list of strings of synaptic variables that are then saved to the file along with the synaptic indices. Variables saved in this way are automatically restored by load_connectivity.

ghost avatar May 19 '14 19:05 ghost

Hi Felix, thanks for your contribution! I'll add some comments directly to the source code. Could you also add a test for your feature or rather adapt the existing test for the save functionality ( https://github.com/brian-team/brian/blob/master/brian/tests/testutils/test_savesynapses.py )? Actually, the existing test seems to assume that synaptic variables are saved already but it only passes because it compares the state variable in the Synapses object before saving to itself... Weird. In general, it would be nice to have some more error checking in this function (non-existing variable names, etc) -- but let's leave this for the port to Brian 2 :)

Note that we don't really use github/git for the development in Brian1, I'll commit the changes to the subversion repository in the end and close this pull request. Therefore you don't have to bother with cleaning up the commit history or anything like that if you continue to make changes to this pull request.

mstimberg avatar May 20 '14 14:05 mstimberg