{"action":"created","issue":{"url":"https://api.github.com/repos/brian-team/brian2/issues/600","repository_url":"https://api.github.com/repos/brian-team/brian2","labels_url":"https://api.github.com/repos/brian-team/brian2/issues/600/labels{/name}","comments_url":"https://api.github.com/repos/brian-team/brian2/issues/600/comments","events_url":"https://api.github.com/repos/brian-team/brian2/issues/600/events","html_url":"https://github.com/brian-team/brian2/pull/600","id":118722608,"number":600,"title":"[WIP] Efficient synapse creation","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},"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":100,"created_at":"2015-11-24T23:03:53Z","updated_at":"2016-04-04T15:41:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/brian-team/brian2/pulls/600","html_url":"https://github.com/brian-team/brian2/pull/600","diff_url":"https://github.com/brian-team/brian2/pull/600.diff","patch_url":"https://github.com/brian-team/brian2/pull/600.patch"},"body":"This branch is for work on issue #65."},"comment":{"url":"https://api.github.com/repos/brian-team/brian2/issues/comments/205356935","html_url":"https://github.com/brian-team/brian2/pull/600#issuecomment-205356935","issue_url":"https://api.github.com/repos/brian-team/brian2/issues/600","id":205356935,"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":"2016-04-04T15:41:47Z","updated_at":"2016-04-04T15:41:47Z","body":"> Yes, these are the complications I mentioned in our earlier discussion, splitting everything into multiple code blocks makes things significantly more complicated. \r\n\r\nDid you like my C++ hack with scopes to make this work? I was quite pleased with it. I'm not sure I can think of a better way of doing it without fairly major changes to our codegen pipeline. You need to know which variables are going to be accessed in the same scope, which is template-dependent and therefore not something that would normally be known at the time of snippet generation.\r\n\r\n> ``_vectorisation_idx``\r\n\r\nAh, that'll do it. Are you making changes or should I?\r\n\r\n> Ah, sorry, again something that I did not quite realize -- synapses_create is replaced for all use cases (p string expressions and so on) already?\r\n\r\nYes! I made it so that e.g. ``connect(cond)`` is turned into ``connect(j='k for k in range(N) if cond')`` etc.\r\n\r\n> We need to clearly document this change also from a developer point of view, it will possibly break GeNN etc. (not sure, though, possibly Brian is only passing the generated synapses to GeNN).\r\n\r\nYep. In general I think we need to document all the new stuff here. Incidentally, I think we should maybe soon write some documentation for the whole codegen system including all of the details about the syntax in the templates, etc. I think it would be good to have that for the 2.0 release.\r\n\r\nFor GeNN I hope we'll be OK because I think now it's inheriting the templates rather than copy/pasting them all, right? I know that the synapses creation is all done on CPU not GPU for the moment, so in principle then this should all be fine."}}