{"action":"created","issue":{"url":"https://api.github.com/repos/nengo/nengo/issues/699","labels_url":"https://api.github.com/repos/nengo/nengo/issues/699/labels{/name}","comments_url":"https://api.github.com/repos/nengo/nengo/issues/699/comments","events_url":"https://api.github.com/repos/nengo/nengo/issues/699/events","html_url":"https://github.com/nengo/nengo/pull/699","id":68963663,"number":699,"title":"Spa subvocab","user":{"login":"xchoo","id":1971583,"avatar_url":"https://avatars.githubusercontent.com/u/1971583?v=3","gravatar_id":"","url":"https://api.github.com/users/xchoo","html_url":"https://github.com/xchoo","followers_url":"https://api.github.com/users/xchoo/followers","following_url":"https://api.github.com/users/xchoo/following{/other_user}","gists_url":"https://api.github.com/users/xchoo/gists{/gist_id}","starred_url":"https://api.github.com/users/xchoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xchoo/subscriptions","organizations_url":"https://api.github.com/users/xchoo/orgs","repos_url":"https://api.github.com/users/xchoo/repos","events_url":"https://api.github.com/users/xchoo/events{/privacy}","received_events_url":"https://api.github.com/users/xchoo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nengo/nengo/labels/needs%20review","name":"needs review","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-16T16:43:58Z","updated_at":"2015-04-19T15:20:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nengo/nengo/pulls/699","html_url":"https://github.com/nengo/nengo/pull/699","diff_url":"https://github.com/nengo/nengo/pull/699.diff","patch_url":"https://github.com/nengo/nengo/pull/699.patch"},"body":"Redid implementation of vocabulary subsets. Subsets now reference the parent vocabulary, and handles transform_to correctly (doesn't add new terms as it did before). Also added a read_only flag for vocabularies to prevent unwanted addition of items to vocabularies."},"comment":{"url":"https://api.github.com/repos/nengo/nengo/issues/comments/94287498","html_url":"https://github.com/nengo/nengo/pull/699#issuecomment-94287498","issue_url":"https://api.github.com/repos/nengo/nengo/issues/699","id":94287498,"user":{"login":"xchoo","id":1971583,"avatar_url":"https://avatars.githubusercontent.com/u/1971583?v=3","gravatar_id":"","url":"https://api.github.com/users/xchoo","html_url":"https://github.com/xchoo","followers_url":"https://api.github.com/users/xchoo/followers","following_url":"https://api.github.com/users/xchoo/following{/other_user}","gists_url":"https://api.github.com/users/xchoo/gists{/gist_id}","starred_url":"https://api.github.com/users/xchoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xchoo/subscriptions","organizations_url":"https://api.github.com/users/xchoo/orgs","repos_url":"https://api.github.com/users/xchoo/repos","events_url":"https://api.github.com/users/xchoo/events{/privacy}","received_events_url":"https://api.github.com/users/xchoo/received_events","type":"User","site_admin":false},"created_at":"2015-04-19T15:20:05Z","updated_at":"2015-04-19T15:20:05Z","body":"- What is the use case for adding terms to a VocabularySubset?\r\nI was thinking of use cases outside of the networks we build in nengo. It is conceivable that people can use the subsets to do purely mathematical operations on vocabularies. And I can see that in some cases (sequential programming, or reusing the same subset for different purposes), subsets can be extended. I very nearly put in the ability to remove items from the vocabulary, but I didn't (yet.. haha)\r\n\r\n- Should VocabularySubset be a subclass of Vocabulary, or should we get rid of it entirely and just have ```create_subset``` return a suitably configured Vocabulary instance?\r\nEven with the read_only functionality of the Vocabularies, this will create problems when connecting two modules with different subsets. Suppose I had this:\r\n\r\n```python\r\nnum = spa.Buffer(vocab=num_subset)  # num_subset = {'ONE', 'TWO', 'THR'} of vocab\r\npos = spa.Buffer(vocab=pos_subset)  # pos_subset = {'P1', 'P2', 'P3'} of vocab\r\nmem = spa.Buffer(vocab=vocab)  # vocab = {'ONE', 'TWO', ..., 'P1', 'P2', ...} + PAIRS\r\n\r\nactions = spa.Actions(\"mem = num * pos\")\r\ncortical = spa.Cortical(actions)\r\n```\r\n\r\nIn this case, because everything is (essentially) using the one vocabulary, there should be no transforms between either of the connections. If the subset returned a read-only vocabulary, the conv_effect will add a transform from (e.g. the num buffer) ```{'ONE', 'TWO', 'THR'}``` of ```num_subset``` to ```{'ONE', 'TWO', 'THR'}``` of ```vocab``` (which is not an identity matrix), which then adds noise to the calculations. \r\n\r\n- What are the use cases for extend_subset? If this functionality is needed, shouldn't it be in the base class?\r\nSee point 1 for use cases. Should it be in the base class? Maybe? I just added it as a shortcut for ```vocab.parse('+'.join(keys))```. "}}