{"action":"created","issue":{"url":"https://api.github.com/repos/nengo/nengo/issues/1201","repository_url":"https://api.github.com/repos/nengo/nengo","labels_url":"https://api.github.com/repos/nengo/nengo/issues/1201/labels{/name}","comments_url":"https://api.github.com/repos/nengo/nengo/issues/1201/comments","events_url":"https://api.github.com/repos/nengo/nengo/issues/1201/events","html_url":"https://github.com/nengo/nengo/issues/1201","id":189592192,"number":1201,"title":"Unhandled situation in new-spa action handling","user":{"login":"tcstewar","id":2380772,"avatar_url":"https://avatars.githubusercontent.com/u/2380772?v=3","gravatar_id":"","url":"https://api.github.com/users/tcstewar","html_url":"https://github.com/tcstewar","followers_url":"https://api.github.com/users/tcstewar/followers","following_url":"https://api.github.com/users/tcstewar/following{/other_user}","gists_url":"https://api.github.com/users/tcstewar/gists{/gist_id}","starred_url":"https://api.github.com/users/tcstewar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcstewar/subscriptions","organizations_url":"https://api.github.com/users/tcstewar/orgs","repos_url":"https://api.github.com/users/tcstewar/repos","events_url":"https://api.github.com/users/tcstewar/events{/privacy}","received_events_url":"https://api.github.com/users/tcstewar/received_events","type":"User","site_admin":false},"labels":[{"id":36691245,"url":"https://api.github.com/repos/nengo/nengo/labels/bug","name":"bug","color":"000000","default":true},{"id":397719195,"url":"https://api.github.com/repos/nengo/nengo/labels/SPA","name":"SPA","color":"bfdadc","default":false}],"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},"assignees":[{"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":{"url":"https://api.github.com/repos/nengo/nengo/milestones/11","html_url":"https://github.com/nengo/nengo/milestones/Next%20generation%20SPA%20module","labels_url":"https://api.github.com/repos/nengo/nengo/milestones/11/labels","id":1899900,"number":11,"title":"Next generation SPA module","description":"Collection of issues and PRs to address in the core Nengo repository before splitting off the spa module into a separate repository. To reduce the number of issues and PRs that needs to be transferred.","creator":{"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},"open_issues":21,"closed_issues":11,"state":"open","created_at":"2016-07-23T04:18:15Z","updated_at":"2016-11-16T15:18:43Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-11-16T05:14:34Z","updated_at":"2016-11-16T16:21:55Z","closed_at":null,"body":"I just found an example that the new spa parser doesn't handle:\r\n\r\n```python\r\nimport nengo\r\nimport nengo.spa as spa\r\n\r\nD = 32\r\n\r\nmodel = spa.SPA()\r\nwith model:\r\n    model.vector = spa.State(D)\r\n    model.scalar = spa.State(1)\r\n\r\n    actions = spa.Actions(\r\n        'dot(vector,A) + scalar --> vector=B'\r\n        )\r\n\r\n    model.bg = spa.BasalGanglia(actions)\r\n    model.thalamus = spa.Thalamus(model.bg)\r\n```\r\n\r\nThis worked in the old system (i.e. current master)\r\n\r\nHere's the error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"c:\\users\\terry\\documents\\github\\nengo_gui\\nengo_gui\\page.py\", line 219, in execute\r\n    exec(compiled, code_locals)\r\n  File \"<nengo_gui_compiled>\", line 61, in <module>\r\n  File \"c:\\users\\terry\\documents\\github\\nengo\\nengo\\spa\\thalamus.py\", line 112, in __init__\r\n    self.bg.actions.process()\r\n  File \"c:\\users\\terry\\documents\\github\\nengo\\nengo\\spa\\actions.py\", line 227, in process\r\n    self.process_new_actions(self.vocabs, *self.args, **self.kwargs)\r\n  File \"c:\\users\\terry\\documents\\github\\nengo\\nengo\\spa\\actions.py\", line 232, in process_new_actions\r\n    action.infer_types(self.construction_context.root_module, None)\r\n  File \"c:\\users\\terry\\documents\\github\\nengo\\nengo\\spa\\spa_ast.py\", line 1022, in infer_types\r\n    self.condition.infer_types(root_module, context_type)\r\n  File \"c:\\users\\terry\\documents\\github\\nengo\\nengo\\spa\\spa_ast.py\", line 565, in infer_types\r\n    self.lhs.infer_types(root_module, context_type)\r\n  File \"c:\\users\\terry\\documents\\github\\nengo\\nengo\\spa\\spa_ast.py\", line 763, in infer_types\r\n    self.lhs.type, self.rhs.type, self))\r\nSpaTypeError: Incompatible types TVocabulary<32-dimensional vocab at 0x39b74908> and TVocabulary<1-dimensional vocab at 0x39b74e48> in dot product 'dot(vector, A)'.\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/nengo/nengo/issues/comments/260992063","html_url":"https://github.com/nengo/nengo/issues/1201#issuecomment-260992063","issue_url":"https://api.github.com/repos/nengo/nengo/issues/1201","id":260992063,"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-11-16T16:21:55Z","updated_at":"2016-11-16T16:21:55Z","body":"Yes, that's what for example `spa.Compare` is already doing. I also noticed that the [`spa.Scalar` already exists in `new-spa`](https://github.com/nengo/nengo/blob/new-spa/nengo/spa/scalar.py). So the following works:\r\n\r\n```python\r\nimport nengo\r\nimport nengo.spa as spa\r\n\r\nD = 32\r\n\r\nmodel = spa.SPA()\r\nwith model:\r\n    model.vector = spa.State(D)\r\n    model.scalar = spa.Scalar()\r\n\r\n    actions = spa.Actions(\r\n        'dot(vector,A) + scalar --> vector=B'\r\n        )\r\n\r\n    model.bg = spa.BasalGanglia(actions)\r\n    model.thalamus = spa.Thalamus(model.bg)\r\n```"}}
{"actor":{"display_login":"jgosmann"}}