{"action":"created","issue":{"url":"https://api.github.com/repos/nengo/nengo_gui/issues/460","labels_url":"https://api.github.com/repos/nengo/nengo_gui/issues/460/labels{/name}","comments_url":"https://api.github.com/repos/nengo/nengo_gui/issues/460/comments","events_url":"https://api.github.com/repos/nengo/nengo_gui/issues/460/events","html_url":"https://github.com/nengo/nengo_gui/pull/460","id":92970131,"number":460,"title":"Refactor viz","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":[{"url":"https://api.github.com/repos/nengo/nengo_gui/labels/needs%20review","name":"needs review","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-07-04T04:31:54Z","updated_at":"2015-07-06T19:58:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nengo/nengo_gui/pulls/460","html_url":"https://github.com/nengo/nengo_gui/pull/460","diff_url":"https://github.com/nengo/nengo_gui/pull/460.diff","patch_url":"https://github.com/nengo/nengo_gui/pull/460.patch"},"body":"This PR reworks the Viz / VizSim mess.  \r\n\r\nThe most important change is now there is no state shared across simulations.  Previously, the one Viz object held a lot of information that should be different across different tabs open to nengo_gui.  This caused all sorts of threading problems because one tab could change something that was required by another tab.  A similar thing could happen when reloading a page (since that's the same as opening a new tab).\r\n\r\nIn the new approach, there is one SimServer object (the new version of Viz), and the only things it holds are immutable default values.  Every page has its own Sim object (the new version of VizSim).  This is the main workhorse.  It maintains all of its own state and is not dependent on SimServer after initialization.\r\n\r\nThis change also cleaned up the code for executing the script, and now the same code is used for executing the script the first time (on startup) and when code is changed in the text editor.  \r\n\r\nI've also added documentation to the new Sim and SimServer classes.  :)\r\n\r\nI believe that this reorganization should address the dreaded \"pop\" bug.  But it's been difficult to replicate that bug, so it's hard to test.  But in any case this is a *much* cleaner code organization and so as long as I haven't broken any features, I think this is the right way to go.  :)"},"comment":{"url":"https://api.github.com/repos/nengo/nengo_gui/issues/comments/118978803","html_url":"https://github.com/nengo/nengo_gui/pull/460#issuecomment-118978803","issue_url":"https://api.github.com/repos/nengo/nengo_gui/issues/460","id":118978803,"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},"created_at":"2015-07-06T19:58:22Z","updated_at":"2015-07-06T19:58:22Z","body":"> As @Seanny123 mentioned, Patch is not a very descriptive name. Maybe something like GuiExecutionEnv is better?\r\n\r\n<sigh>  I liked ```monkey.Patch``` as a name...  ;)  But, it is causing more confusion than the cuteness of the name is worth.  I think I'll go with ```ExecutionEnvironment``` or something like that...  :)"}}