{"action":"created","issue":{"url":"https://api.github.com/repos/brian-team/brian2/issues/487","labels_url":"https://api.github.com/repos/brian-team/brian2/issues/487/labels{/name}","comments_url":"https://api.github.com/repos/brian-team/brian2/issues/487/comments","events_url":"https://api.github.com/repos/brian-team/brian2/issues/487/events","html_url":"https://github.com/brian-team/brian2/pull/487","id":89333639,"number":487,"title":"[WIP] Support for general events","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":20,"created_at":"2015-06-18T16:13:34Z","updated_at":"2015-06-25T17:43:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/brian-team/brian2/pulls/487","html_url":"https://github.com/brian-team/brian2/pull/487","diff_url":"https://github.com/brian-team/brian2/pull/487.diff","patch_url":"https://github.com/brian-team/brian2/pull/487.patch"},"body":"This introduces support for general events using the `events = {eventname: (condition, statement)}` syntax and an `EventMonitor` for recording such events. It is lacking tests, error-checking (e.g. for valid event names) and documentation but it seems to work fine.\r\nMany of the tests fail currently, but that's because of a little change that we won't create a `_spikespace` array unconditionally anymore, but only if the `NeuronGroup` has a threshold. This makes quite a number of `Synapses` tests fail, where for simplicity, `Synapses` is connected to a `NeuronGroup` without a threshold. I'm not sure whether that's a bug or a feature, though -- but the error message is certainly not helpful at the moment.\r\nOne thing that came to my mind is that in the same way that this pull request generalizes threshold/reset/monitors for multiple events, synaptic pathways could easily connect to a different synaptic event type than spikes, which could be potentially useful (in our discussion in #106 we decided to not do this for simplicity, but the necessary changes are really not that big). Maybe worth opening a new issue for that (and/or discuss it in our meeting tomorrow).\r\n\r\nThis branch does not (yet):\r\n* Rename reset/threshold ( #106)\r\n* Rename the scheduling slots `resets` and `thresholds`\r\n* Rename the templates `reset`, `threshold`, `spikemonitor` (which is potentially annoying for other people already working on devices, on the other hand we should make this change rather now or never)\r\n"},"comment":{"url":"https://api.github.com/repos/brian-team/brian2/issues/comments/115341713","html_url":"https://github.com/brian-team/brian2/pull/487#issuecomment-115341713","issue_url":"https://api.github.com/repos/brian-team/brian2/issues/487","id":115341713,"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-06-25T17:43:06Z","updated_at":"2015-06-25T17:43:06Z","body":"OK, so how about we go with default for events is after thresholds and resets (I like that solution), and for when and order, we have a method for that in order to simplify the constructor, e.g.:\r\n\r\n```\r\n1. G.set_event_schedule(when={'name':'slot'}, order={'name':order})\r\n2. G.set_event_schedule(name=('slot', order))\r\n3. G.set_event_schedule(name=dict(when='slot', order=order))\r\n```\r\n\r\nI know I argued against the method before, but now I'm thinking that if it's very rare to use it that's OK, and it simplifies the constructor arguments quite a lot. Also, even though option (2) has a tuple in it, for some reason I don't find it so bad. Putting when and order together into a tuple feels OK to me. I don't have a strong preference between the options above."}}