{"action":"created","issue":{"url":"https://api.github.com/repos/metapolator/metapolator/issues/332","labels_url":"https://api.github.com/repos/metapolator/metapolator/issues/332/labels{/name}","comments_url":"https://api.github.com/repos/metapolator/metapolator/issues/332/comments","events_url":"https://api.github.com/repos/metapolator/metapolator/issues/332/events","html_url":"https://github.com/metapolator/metapolator/issues/332","id":57059835,"number":332,"title":"Add an initial API to the Model for interaction with the GUI","user":{"login":"graphicore","id":393132,"avatar_url":"https://avatars.githubusercontent.com/u/393132?v=3","gravatar_id":"","url":"https://api.github.com/users/graphicore","html_url":"https://github.com/graphicore","followers_url":"https://api.github.com/users/graphicore/followers","following_url":"https://api.github.com/users/graphicore/following{/other_user}","gists_url":"https://api.github.com/users/graphicore/gists{/gist_id}","starred_url":"https://api.github.com/users/graphicore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphicore/subscriptions","organizations_url":"https://api.github.com/users/graphicore/orgs","repos_url":"https://api.github.com/users/graphicore/repos","events_url":"https://api.github.com/users/graphicore/events{/privacy}","received_events_url":"https://api.github.com/users/graphicore/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/metapolator/metapolator/labels/code","name":"code","color":"009800"},{"url":"https://api.github.com/repos/metapolator/metapolator/labels/Priority%20High","name":"Priority High","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"graphicore","id":393132,"avatar_url":"https://avatars.githubusercontent.com/u/393132?v=3","gravatar_id":"","url":"https://api.github.com/users/graphicore","html_url":"https://github.com/graphicore","followers_url":"https://api.github.com/users/graphicore/followers","following_url":"https://api.github.com/users/graphicore/following{/other_user}","gists_url":"https://api.github.com/users/graphicore/gists{/gist_id}","starred_url":"https://api.github.com/users/graphicore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphicore/subscriptions","organizations_url":"https://api.github.com/users/graphicore/orgs","repos_url":"https://api.github.com/users/graphicore/repos","events_url":"https://api.github.com/users/graphicore/events{/privacy}","received_events_url":"https://api.github.com/users/graphicore/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/metapolator/metapolator/milestones/27","html_url":"https://github.com/metapolator/metapolator/milestones/0.3.0","labels_url":"https://api.github.com/repos/metapolator/metapolator/milestones/27/labels","id":728549,"number":27,"title":"0.3.0","description":"","creator":{"login":"davelab6","id":261579,"avatar_url":"https://avatars.githubusercontent.com/u/261579?v=3","gravatar_id":"","url":"https://api.github.com/users/davelab6","html_url":"https://github.com/davelab6","followers_url":"https://api.github.com/users/davelab6/followers","following_url":"https://api.github.com/users/davelab6/following{/other_user}","gists_url":"https://api.github.com/users/davelab6/gists{/gist_id}","starred_url":"https://api.github.com/users/davelab6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davelab6/subscriptions","organizations_url":"https://api.github.com/users/davelab6/orgs","repos_url":"https://api.github.com/users/davelab6/repos","events_url":"https://api.github.com/users/davelab6/events{/privacy}","received_events_url":"https://api.github.com/users/davelab6/received_events","type":"User","site_admin":false},"open_issues":22,"closed_issues":3,"state":"open","created_at":"2014-07-22T15:38:39Z","updated_at":"2015-03-27T14:19:00Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2015-02-09T17:11:45Z","updated_at":"2015-03-28T16:32:33Z","closed_at":null,"body":"This issue discusses the initial API to interface with the model that is going to be implemented in Metapolator.\r\n\r\nThe work that has to be done here consists of 2 major topics:\r\n\r\n* finer controlled cache invalidation\r\n* an API to interface with the model\r\n\r\nThe cache control is currently in the making. A list of dependencies is stored for each cached CPS parameter value. This enables us to prune just the right caches when a dependency invalidates. In most of the cases this will speed up re-rendering of changed glyphs, in some cases we'll have to prune all caches, as we are doing right now.\r\n\r\n\r\nThe initial API focuses on manipulating the CPS side of the model, not the MOM side. Thus the skeleton/structure/essence won't be changeable.\r\n\r\nFor changing CPS I'll focus on making a minimal API that enables the most important actions. Some actions that are needed to express everything that is possible with CPS will be intentionally left out, because they don't have that much immediate use.\r\n\r\nMore complex actions will have to be expressed as a chain of these minimal actions. We will probably end up writing a higher level API that uses the minimal methods itself.\r\n\r\nI don't plan allowing to write invalid data via the API. Invalid data can happen when CPS is imported, but it appears to make little sense to make that possible via the API.\r\n\r\nThe minimal Methods are roughly:\r\n\r\n## For Rules:\r\n\r\n- [x] replace the SelectorList with another valid SelectorList\r\n\r\n## For the `ParameterDict` of a `Rule`:\r\n\r\nThis is a list of key-value pairs (a parameter valid or invalid), comments, and hunks of stuff that did not parse.\r\nAs an interface for reading, it currently serves the last *valid* parameter of a name as the value for that name. There may be more Parameters with the same name, shadowed by the last occurance.\r\nThus, this is is a bit of a list and a bit of a dict.\r\n\r\n### These are methods to work with the parameterDict in a dict-ish way:\r\n\r\n- [x]  replace/add the current active Parameter for a `name` with another valid Parameter. If there is no active parameter this is a append, otherwise this is a replace.\r\n- [x]  remove the current active Parameter. May make another valid Parameter with the same name active, if there is any.\r\n- [x]  remove all Parameters (valid and invalid) with the same name.\r\n\r\n### These are methods to work with the parameterDict in a list-ish way:\r\n\r\n- [ ]  maybe/later: remove any element from the list of items\r\n  - parameters, \r\n  - comments, \r\n  - invalid hunks\r\n- [ ]  maybe/later: insert a valid parameter or comment at any position in the list\r\n\r\n## ParameterCollection (a list of rules), also `@namespace`\r\n\r\n- [x] Add a Rule (which must have a valid SelectorList)\r\n- [x] Remove a Rule\r\n- [x] Add/remove `@namespace` (with valid SelectorList) or `@import`\r\n- [x] Add/remove comments\r\n- [x] Remove invalid hunks of data.\r\n\r\n## `@namespace`\r\n\r\n- [x] replace the SelectorList with another valid SelectorList\r\n\r\n## `@import`\r\n\r\n- [x] change the cps file address\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/metapolator/metapolator/issues/comments/87258842","html_url":"https://github.com/metapolator/metapolator/issues/332#issuecomment-87258842","issue_url":"https://api.github.com/repos/metapolator/metapolator/issues/332","id":87258842,"user":{"login":"jeroenbreen","id":6692653,"avatar_url":"https://avatars.githubusercontent.com/u/6692653?v=3","gravatar_id":"","url":"https://api.github.com/users/jeroenbreen","html_url":"https://github.com/jeroenbreen","followers_url":"https://api.github.com/users/jeroenbreen/followers","following_url":"https://api.github.com/users/jeroenbreen/following{/other_user}","gists_url":"https://api.github.com/users/jeroenbreen/gists{/gist_id}","starred_url":"https://api.github.com/users/jeroenbreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeroenbreen/subscriptions","organizations_url":"https://api.github.com/users/jeroenbreen/orgs","repos_url":"https://api.github.com/users/jeroenbreen/repos","events_url":"https://api.github.com/users/jeroenbreen/events{/privacy}","received_events_url":"https://api.github.com/users/jeroenbreen/received_events","type":"User","site_admin":false},"created_at":"2015-03-28T16:32:33Z","updated_at":"2015-03-28T16:32:33Z","body":"> I like the idea of having the base as a read only master. This forces me to duplicate and modify from the start.\r\n\r\nBut is this master selectable then (considering you couldnt add parameters to it)?"}}