{"action":"created","issue":{"url":"https://api.github.com/repos/brian-team/brian2/issues/544","labels_url":"https://api.github.com/repos/brian-team/brian2/issues/544/labels{/name}","comments_url":"https://api.github.com/repos/brian-team/brian2/issues/544/comments","events_url":"https://api.github.com/repos/brian-team/brian2/issues/544/events","html_url":"https://github.com/brian-team/brian2/pull/544","id":102345872,"number":544,"title":"[MRG] Synapses to synapses connections","user":{"login":"mstimberg","id":1381982,"avatar_url":"https://avatars.githubusercontent.com/u/1381982?v=3","gravatar_id":"","url":"https://api.github.com/users/mstimberg","html_url":"https://github.com/mstimberg","followers_url":"https://api.github.com/users/mstimberg/followers","following_url":"https://api.github.com/users/mstimberg/following{/other_user}","gists_url":"https://api.github.com/users/mstimberg/gists{/gist_id}","starred_url":"https://api.github.com/users/mstimberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mstimberg/subscriptions","organizations_url":"https://api.github.com/users/mstimberg/orgs","repos_url":"https://api.github.com/users/mstimberg/repos","events_url":"https://api.github.com/users/mstimberg/events{/privacy}","received_events_url":"https://api.github.com/users/mstimberg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/brian-team/brian2/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-21T10:10:29Z","updated_at":"2015-08-22T14:30:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/brian-team/brian2/pulls/544","html_url":"https://github.com/brian-team/brian2/pull/544","diff_url":"https://github.com/brian-team/brian2/pull/544.diff","patch_url":"https://github.com/brian-team/brian2/pull/544.patch"},"body":"This is quite a big change, necessary for the astrocyte project where we need `Synapses` that target other `Synapses`. There are a few minor tweaks and additions but the two main changes are the following:\r\n* The variable `N` is now no longer an `AttributeVariable` that gets the length of the group via Python (or the `Synapses` class in the C++ standalone code) but instead either a constant or a scalar `ArrayVariable` (for synapses). In runtime code, it can still be simply accessed as `N`, as the value of constant scalar arrays is passed in the namespace. In standalone, two templates contain an `{% if ... %}` to generate the correct code depending on whether `N` is a constant or an array.\r\n* The variables `N_incoming` and `N_outgoing` were previously set in Python code, they are now set in the `synapses_create` template. This is potentially redundant for multiple `Synapses.connect` calls, but the overhead should not be noticeable (and multiple connect calls are not that common, anyway).\r\n\r\nWith these changes the C++ `Synapses` class in C++ standalone became obsolete, so I removed it."},"comment":{"url":"https://api.github.com/repos/brian-team/brian2/issues/comments/133709042","html_url":"https://github.com/brian-team/brian2/pull/544#issuecomment-133709042","issue_url":"https://api.github.com/repos/brian-team/brian2/issues/544","id":133709042,"user":{"login":"thesamovar","id":2903870,"avatar_url":"https://avatars.githubusercontent.com/u/2903870?v=3","gravatar_id":"","url":"https://api.github.com/users/thesamovar","html_url":"https://github.com/thesamovar","followers_url":"https://api.github.com/users/thesamovar/followers","following_url":"https://api.github.com/users/thesamovar/following{/other_user}","gists_url":"https://api.github.com/users/thesamovar/gists{/gist_id}","starred_url":"https://api.github.com/users/thesamovar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thesamovar/subscriptions","organizations_url":"https://api.github.com/users/thesamovar/orgs","repos_url":"https://api.github.com/users/thesamovar/repos","events_url":"https://api.github.com/users/thesamovar/events{/privacy}","received_events_url":"https://api.github.com/users/thesamovar/received_events","type":"User","site_admin":false},"created_at":"2015-08-22T14:30:08Z","updated_at":"2015-08-22T14:30:08Z","body":"Apart from that issue, the code looks good (although I think I should also test on my machine before merging because it's a big change - will do that asap).\r\n\r\nIf we can do the same thing with the size of a ``NeuronGroup`` as with the ``N`` in ``Synapses`` then perhaps we are almost there in making it possible to build/compile C++ standalone once but run it for different group sizes? Or will that be substantially more work?"}}