{"action":"created","issue":{"url":"https://api.github.com/repos/nengo/nengo/issues/953","repository_url":"https://api.github.com/repos/nengo/nengo","labels_url":"https://api.github.com/repos/nengo/nengo/issues/953/labels{/name}","comments_url":"https://api.github.com/repos/nengo/nengo/issues/953/comments","events_url":"https://api.github.com/repos/nengo/nengo/issues/953/events","html_url":"https://github.com/nengo/nengo/pull/953","id":134188069,"number":953,"title":"Modifying semantic pointers in a vocabulary.","user":{"login":"pblouw","id":2708813,"avatar_url":"https://avatars.githubusercontent.com/u/2708813?v=3","gravatar_id":"","url":"https://api.github.com/users/pblouw","html_url":"https://github.com/pblouw","followers_url":"https://api.github.com/users/pblouw/followers","following_url":"https://api.github.com/users/pblouw/following{/other_user}","gists_url":"https://api.github.com/users/pblouw/gists{/gist_id}","starred_url":"https://api.github.com/users/pblouw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pblouw/subscriptions","organizations_url":"https://api.github.com/users/pblouw/orgs","repos_url":"https://api.github.com/users/pblouw/repos","events_url":"https://api.github.com/users/pblouw/events{/privacy}","received_events_url":"https://api.github.com/users/pblouw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nengo/nengo/labels/discussion","name":"discussion","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-17T06:02:29Z","updated_at":"2016-05-10T21:22:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nengo/nengo/pulls/953","html_url":"https://github.com/nengo/nengo/pull/953","diff_url":"https://github.com/nengo/nengo/pull/953.diff","patch_url":"https://github.com/nengo/nengo/pull/953.patch"},"body":"Currently, vocabularies store info about SPs in two separate places: the `.pointers` dictionary that maps vocabulary keys to SemanticPointer objects, and the `.vectors` array whose rows correspond to the vector attributes of each SP in the vocabulary.  It is possible to modify an SP in one of these places and not the other, which can lead to confusing errors of the sort reported in nengo/nengo_gui#438. (e.g. one might want to change the SP associated with a particular key to be structured in some way, randomly perturbed, or whatever). So, this PR introduces a `set_value` method that takes a key and vector as input and updates the vocabulary such that `.pointers` and `.vectors` are consistent with one another. \r\n\r\nI've flagged this pull request as a discussion, since it is not obvious to me that this is the best solution to this problem. Another option would be to get rid of the pointers dictionary altogether and create new SemanticPointer objects each time `__getitem__` is called by indexing into the `.vectors ` array. "},"comment":{"url":"https://api.github.com/repos/nengo/nengo/issues/comments/218295738","html_url":"https://github.com/nengo/nengo/pull/953#issuecomment-218295738","issue_url":"https://api.github.com/repos/nengo/nengo/issues/953","id":218295738,"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-10T21:22:28Z","updated_at":"2016-05-10T21:22:28Z","body":"Yes, this issue won't be solved by #1014 and related PRs."}}