{"action":"created","issue":{"url":"https://api.github.com/repos/nengo/nengo/issues/1006","repository_url":"https://api.github.com/repos/nengo/nengo","labels_url":"https://api.github.com/repos/nengo/nengo/issues/1006/labels{/name}","comments_url":"https://api.github.com/repos/nengo/nengo/issues/1006/comments","events_url":"https://api.github.com/repos/nengo/nengo/issues/1006/events","html_url":"https://github.com/nengo/nengo/pull/1006","id":146101926,"number":1006,"title":"Allow hierarchical SPA modules.","user":{"login":"jgosmann","id":850157,"avatar_url":"https://avatars.githubusercontent.com/u/850157?v=3","gravatar_id":"","url":"https://api.github.com/users/jgosmann","html_url":"https://github.com/jgosmann","followers_url":"https://api.github.com/users/jgosmann/followers","following_url":"https://api.github.com/users/jgosmann/following{/other_user}","gists_url":"https://api.github.com/users/jgosmann/gists{/gist_id}","starred_url":"https://api.github.com/users/jgosmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgosmann/subscriptions","organizations_url":"https://api.github.com/users/jgosmann/orgs","repos_url":"https://api.github.com/users/jgosmann/repos","events_url":"https://api.github.com/users/jgosmann/events{/privacy}","received_events_url":"https://api.github.com/users/jgosmann/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nengo/nengo/labels/discussion","name":"discussion","color":"207de5"},{"url":"https://api.github.com/repos/nengo/nengo/labels/needs%20changes","name":"needs changes","color":"e11d21"},{"url":"https://api.github.com/repos/nengo/nengo/labels/needs%20review","name":"needs review","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"jgosmann","id":850157,"avatar_url":"https://avatars.githubusercontent.com/u/850157?v=3","gravatar_id":"","url":"https://api.github.com/users/jgosmann","html_url":"https://github.com/jgosmann","followers_url":"https://api.github.com/users/jgosmann/followers","following_url":"https://api.github.com/users/jgosmann/following{/other_user}","gists_url":"https://api.github.com/users/jgosmann/gists{/gist_id}","starred_url":"https://api.github.com/users/jgosmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgosmann/subscriptions","organizations_url":"https://api.github.com/users/jgosmann/orgs","repos_url":"https://api.github.com/users/jgosmann/repos","events_url":"https://api.github.com/users/jgosmann/events{/privacy}","received_events_url":"https://api.github.com/users/jgosmann/received_events","type":"User","site_admin":false},"milestone":null,"comments":28,"created_at":"2016-04-05T20:31:45Z","updated_at":"2016-05-31T13:50:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nengo/nengo/pulls/1006","html_url":"https://github.com/nengo/nengo/pull/1006","diff_url":"https://github.com/nengo/nengo/pull/1006.diff","patch_url":"https://github.com/nengo/nengo/pull/1006.patch"},"body":"There are a few more things that should be done before reviewing/merging (see below), but it would be nice to get this looked over and see what the general opinion (and especially @tcstewar's opinion) on this is. Also because I plan a number of other changes to the SPA system that might be based on this.\r\n\r\nFixes #556, #749. Might touch on  #695, #886, #1005.\r\n\r\nThis allows to have SPA modules within other modules (see `test_module.py` for a simple example). As a result the distinction between `spa.SPA` and `spa.Module` is no longer needed. We could mark remove `spa.SPA` or mark it as obsolete. Any opinions on this? (This will of course require a number of tests and examples to be updated.)\r\n\r\nAlso, it probably makes sense to move the tests from `test_spa.py` to `test_module.py`.\r\n\r\nNote that I removed some obsolete code as discussed in #1005.\r\n\r\n### Using the config system for SPA modules\r\n\r\nYou might notice that the the `spa.Module` class now has a `vocabs` parameter. This makes me wonder whether it (or `Network`) should inherit from `NengoObject`) or whether there is some part that could or should be extracted into a separate mix-in class. But so far it this parameter requires only one more line.\r\n\r\nBut we might add (probably should add) more parameters as discussed in #695. Might that change things? This is also related to #977, #984.\r\n\r\n### Addressing sub modules in actions\r\n\r\nCurrently, SPA Actions can only access modules defined on the same level of the hierarchy. I believe, it should not be to troublesome to extend it so that submodules can be accessed, but we need to agree on a syntax for that. I think the dot notation `module.submodule` is natural because it is the same as in actual Python.\r\n\r\nAlong those lines, I might want to change the syntax to access non-default inputs and outputs where we currently use an underscore (`module_input`). This might clash with other module names and seems less natural to me. I would like to change this to the dot notation too (`module.input`). This might of course break existing models.\r\n\r\n### Adding modules twice\r\n\r\nIt is an error to add a module twice to to SPA module. Is there a technical reason for that? Or is there some kind of easy to overlook error that could get introduced by adding a module twice? I'm asking because this happens in the `Thalamus` module (it adds the basal ganglia to itself, but usually they will also be added to the top level module). It is not to complicated to circumvent this (see code for details), but maybe it makes more sense to allow adding a module multiple times. Of course this would allow to use different names to access the same module, but would this cause any problems?\r\n\r\n(Note with adding I mean assigning it to a SPA module, independent of that a module gets only added once to a network at the moment it is instantiated.)"},"comment":{"url":"https://api.github.com/repos/nengo/nengo/issues/comments/222694182","html_url":"https://github.com/nengo/nengo/pull/1006#issuecomment-222694182","issue_url":"https://api.github.com/repos/nengo/nengo/issues/1006","id":222694182,"user":{"login":"jgosmann","id":850157,"avatar_url":"https://avatars.githubusercontent.com/u/850157?v=3","gravatar_id":"","url":"https://api.github.com/users/jgosmann","html_url":"https://github.com/jgosmann","followers_url":"https://api.github.com/users/jgosmann/followers","following_url":"https://api.github.com/users/jgosmann/following{/other_user}","gists_url":"https://api.github.com/users/jgosmann/gists{/gist_id}","starred_url":"https://api.github.com/users/jgosmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgosmann/subscriptions","organizations_url":"https://api.github.com/users/jgosmann/orgs","repos_url":"https://api.github.com/users/jgosmann/repos","events_url":"https://api.github.com/users/jgosmann/events{/privacy}","received_events_url":"https://api.github.com/users/jgosmann/received_events","type":"User","site_admin":false},"created_at":"2016-05-31T13:50:32Z","updated_at":"2016-05-31T13:50:32Z","body":"Aren't the slow tests then not run on Travis? (@tbekolay?)"}}
{"actor":{"display_login":"jgosmann"}}