{"action":"closed","number":33,"pull_request":{"url":"https://api.github.com/repos/snorfalorpagus/pywr/pulls/33","id":41876251,"html_url":"https://github.com/snorfalorpagus/pywr/pull/33","diff_url":"https://github.com/snorfalorpagus/pywr/pull/33.diff","patch_url":"https://github.com/snorfalorpagus/pywr/pull/33.patch","issue_url":"https://api.github.com/repos/snorfalorpagus/pywr/issues/33","number":33,"state":"closed","locked":false,"title":"Generalisation (on the correct branch)","user":{"login":"jetuk","id":4604654,"avatar_url":"https://avatars.githubusercontent.com/u/4604654?v=3","gravatar_id":"","url":"https://api.github.com/users/jetuk","html_url":"https://github.com/jetuk","followers_url":"https://api.github.com/users/jetuk/followers","following_url":"https://api.github.com/users/jetuk/following{/other_user}","gists_url":"https://api.github.com/users/jetuk/gists{/gist_id}","starred_url":"https://api.github.com/users/jetuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jetuk/subscriptions","organizations_url":"https://api.github.com/users/jetuk/orgs","repos_url":"https://api.github.com/users/jetuk/repos","events_url":"https://api.github.com/users/jetuk/events{/privacy}","received_events_url":"https://api.github.com/users/jetuk/received_events","type":"User","site_admin":false},"body":"The motivation here was to move away from water sector specific language and nuances in the core module(s). With that in mind the naming of the nodes in there is very general. There are several things that have changed with this pull request, \r\n\r\n- Creation of pywr.domains package to contain sector specific subclasses. A river domain has been partially implemented using similar class names from before. More are needed to finish this.\r\n- Creation of a Domain class that is given to Nodes to identify them with a specific domain. This is an important concept because routes can not traverse different Domains. However there is a new type of Input node, InputFromOtherDomain, that can be connected to an Output from a different domain. Flow can then occur between these two nodes. A conversion_factor is used to account for any change in units or losses that occur from moving from one domain to another.\r\n- Use of Nodes that contain other Nodes - see Storage and PiecewiseLink as examples. This is a useful addition, but should perhaps be implemented using another class, e.g. CompositeNode(Node). Connect and using these nodes is transparent from the user, but the connecting is a bit hackish due to subclass specific checking required in Node.commit.\r\n- PiecewiseLink is a general node that contains multiple nodes. It is a useful way to have a piecewise benefit objective at a specific nodes. An example is a river gauge - which should probably be implemented as a subclass of PiecewiseLink.\r\n- Added schematic.py (based on your code). It now has colored circles to show the different Domains, and also does not show subnodes on composite nodes.\r\n- The GLPK solver was hacked to make all of this work.\r\n\r\nThings to finish off,\r\n\r\n- Tests - most are broken.\r\n- ~~GLPK solver is broken with timedelta timesteps~~. Discussion about how to handle this needs to occur.\r\n- Confusion between the Domain class and the pywr.domains package?\r\n- Demand, Supply and Blender classes need to be deleted or moved from core.py\r\n- Nothing has been done with licences; they may also be broken.\r\n- More subclasses need implementing in rivers.py. Examples that come to mind include RiverGauge(PiecewiseLink) and ReservoirWithControlCurve(Reservoir).\r\n\r\nI am sure I have missed some stuff of these lists.\r\n\r\nJames\r\n","created_at":"2015-08-07T09:55:05Z","updated_at":"2015-08-27T15:53:06Z","closed_at":"2015-08-27T15:53:06Z","merged_at":null,"merge_commit_sha":"7b4fd2046c3fdff3c0de26f26b9ee4675a117c3d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/snorfalorpagus/pywr/pulls/33/commits","review_comments_url":"https://api.github.com/repos/snorfalorpagus/pywr/pulls/33/comments","review_comment_url":"https://api.github.com/repos/snorfalorpagus/pywr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/snorfalorpagus/pywr/issues/33/comments","statuses_url":"https://api.github.com/repos/snorfalorpagus/pywr/statuses/7686a756ac94ef8be2ab3cd76ff1ad826ee90082","head":{"label":"jetuk:generalisation","ref":"generalisation","sha":"7686a756ac94ef8be2ab3cd76ff1ad826ee90082","user":{"login":"jetuk","id":4604654,"avatar_url":"https://avatars.githubusercontent.com/u/4604654?v=3","gravatar_id":"","url":"https://api.github.com/users/jetuk","html_url":"https://github.com/jetuk","followers_url":"https://api.github.com/users/jetuk/followers","following_url":"https://api.github.com/users/jetuk/following{/other_user}","gists_url":"https://api.github.com/users/jetuk/gists{/gist_id}","starred_url":"https://api.github.com/users/jetuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jetuk/subscriptions","organizations_url":"https://api.github.com/users/jetuk/orgs","repos_url":"https://api.github.com/users/jetuk/repos","events_url":"https://api.github.com/users/jetuk/events{/privacy}","received_events_url":"https://api.github.com/users/jetuk/received_events","type":"User","site_admin":false},"repo":{"id":30042841,"name":"pywr","full_name":"jetuk/pywr","owner":{"login":"jetuk","id":4604654,"avatar_url":"https://avatars.githubusercontent.com/u/4604654?v=3","gravatar_id":"","url":"https://api.github.com/users/jetuk","html_url":"https://github.com/jetuk","followers_url":"https://api.github.com/users/jetuk/followers","following_url":"https://api.github.com/users/jetuk/following{/other_user}","gists_url":"https://api.github.com/users/jetuk/gists{/gist_id}","starred_url":"https://api.github.com/users/jetuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jetuk/subscriptions","organizations_url":"https://api.github.com/users/jetuk/orgs","repos_url":"https://api.github.com/users/jetuk/repos","events_url":"https://api.github.com/users/jetuk/events{/privacy}","received_events_url":"https://api.github.com/users/jetuk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jetuk/pywr","description":"Water resource model written in Python","fork":true,"url":"https://api.github.com/repos/jetuk/pywr","forks_url":"https://api.github.com/repos/jetuk/pywr/forks","keys_url":"https://api.github.com/repos/jetuk/pywr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jetuk/pywr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jetuk/pywr/teams","hooks_url":"https://api.github.com/repos/jetuk/pywr/hooks","issue_events_url":"https://api.github.com/repos/jetuk/pywr/issues/events{/number}","events_url":"https://api.github.com/repos/jetuk/pywr/events","assignees_url":"https://api.github.com/repos/jetuk/pywr/assignees{/user}","branches_url":"https://api.github.com/repos/jetuk/pywr/branches{/branch}","tags_url":"https://api.github.com/repos/jetuk/pywr/tags","blobs_url":"https://api.github.com/repos/jetuk/pywr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jetuk/pywr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jetuk/pywr/git/refs{/sha}","trees_url":"https://api.github.com/repos/jetuk/pywr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jetuk/pywr/statuses/{sha}","languages_url":"https://api.github.com/repos/jetuk/pywr/languages","stargazers_url":"https://api.github.com/repos/jetuk/pywr/stargazers","contributors_url":"https://api.github.com/repos/jetuk/pywr/contributors","subscribers_url":"https://api.github.com/repos/jetuk/pywr/subscribers","subscription_url":"https://api.github.com/repos/jetuk/pywr/subscription","commits_url":"https://api.github.com/repos/jetuk/pywr/commits{/sha}","git_commits_url":"https://api.github.com/repos/jetuk/pywr/git/commits{/sha}","comments_url":"https://api.github.com/repos/jetuk/pywr/comments{/number}","issue_comment_url":"https://api.github.com/repos/jetuk/pywr/issues/comments{/number}","contents_url":"https://api.github.com/repos/jetuk/pywr/contents/{+path}","compare_url":"https://api.github.com/repos/jetuk/pywr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jetuk/pywr/merges","archive_url":"https://api.github.com/repos/jetuk/pywr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jetuk/pywr/downloads","issues_url":"https://api.github.com/repos/jetuk/pywr/issues{/number}","pulls_url":"https://api.github.com/repos/jetuk/pywr/pulls{/number}","milestones_url":"https://api.github.com/repos/jetuk/pywr/milestones{/number}","notifications_url":"https://api.github.com/repos/jetuk/pywr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jetuk/pywr/labels{/name}","releases_url":"https://api.github.com/repos/jetuk/pywr/releases{/id}","created_at":"2015-01-29T21:44:13Z","updated_at":"2015-01-29T21:44:14Z","pushed_at":"2015-08-26T23:18:13Z","git_url":"git://github.com/jetuk/pywr.git","ssh_url":"git@github.com:jetuk/pywr.git","clone_url":"https://github.com/jetuk/pywr.git","svn_url":"https://github.com/jetuk/pywr","homepage":null,"size":331,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"snorfalorpagus:master","ref":"master","sha":"8bf9ddef9251270096afa5ac12b8d612ee02946d","user":{"login":"snorfalorpagus","id":3883947,"avatar_url":"https://avatars.githubusercontent.com/u/3883947?v=3","gravatar_id":"","url":"https://api.github.com/users/snorfalorpagus","html_url":"https://github.com/snorfalorpagus","followers_url":"https://api.github.com/users/snorfalorpagus/followers","following_url":"https://api.github.com/users/snorfalorpagus/following{/other_user}","gists_url":"https://api.github.com/users/snorfalorpagus/gists{/gist_id}","starred_url":"https://api.github.com/users/snorfalorpagus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snorfalorpagus/subscriptions","organizations_url":"https://api.github.com/users/snorfalorpagus/orgs","repos_url":"https://api.github.com/users/snorfalorpagus/repos","events_url":"https://api.github.com/users/snorfalorpagus/events{/privacy}","received_events_url":"https://api.github.com/users/snorfalorpagus/received_events","type":"User","site_admin":false},"repo":{"id":29560246,"name":"pywr","full_name":"snorfalorpagus/pywr","owner":{"login":"snorfalorpagus","id":3883947,"avatar_url":"https://avatars.githubusercontent.com/u/3883947?v=3","gravatar_id":"","url":"https://api.github.com/users/snorfalorpagus","html_url":"https://github.com/snorfalorpagus","followers_url":"https://api.github.com/users/snorfalorpagus/followers","following_url":"https://api.github.com/users/snorfalorpagus/following{/other_user}","gists_url":"https://api.github.com/users/snorfalorpagus/gists{/gist_id}","starred_url":"https://api.github.com/users/snorfalorpagus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snorfalorpagus/subscriptions","organizations_url":"https://api.github.com/users/snorfalorpagus/orgs","repos_url":"https://api.github.com/users/snorfalorpagus/repos","events_url":"https://api.github.com/users/snorfalorpagus/events{/privacy}","received_events_url":"https://api.github.com/users/snorfalorpagus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/snorfalorpagus/pywr","description":"Water resource model written in Python","fork":false,"url":"https://api.github.com/repos/snorfalorpagus/pywr","forks_url":"https://api.github.com/repos/snorfalorpagus/pywr/forks","keys_url":"https://api.github.com/repos/snorfalorpagus/pywr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/snorfalorpagus/pywr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/snorfalorpagus/pywr/teams","hooks_url":"https://api.github.com/repos/snorfalorpagus/pywr/hooks","issue_events_url":"https://api.github.com/repos/snorfalorpagus/pywr/issues/events{/number}","events_url":"https://api.github.com/repos/snorfalorpagus/pywr/events","assignees_url":"https://api.github.com/repos/snorfalorpagus/pywr/assignees{/user}","branches_url":"https://api.github.com/repos/snorfalorpagus/pywr/branches{/branch}","tags_url":"https://api.github.com/repos/snorfalorpagus/pywr/tags","blobs_url":"https://api.github.com/repos/snorfalorpagus/pywr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/snorfalorpagus/pywr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/snorfalorpagus/pywr/git/refs{/sha}","trees_url":"https://api.github.com/repos/snorfalorpagus/pywr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/snorfalorpagus/pywr/statuses/{sha}","languages_url":"https://api.github.com/repos/snorfalorpagus/pywr/languages","stargazers_url":"https://api.github.com/repos/snorfalorpagus/pywr/stargazers","contributors_url":"https://api.github.com/repos/snorfalorpagus/pywr/contributors","subscribers_url":"https://api.github.com/repos/snorfalorpagus/pywr/subscribers","subscription_url":"https://api.github.com/repos/snorfalorpagus/pywr/subscription","commits_url":"https://api.github.com/repos/snorfalorpagus/pywr/commits{/sha}","git_commits_url":"https://api.github.com/repos/snorfalorpagus/pywr/git/commits{/sha}","comments_url":"https://api.github.com/repos/snorfalorpagus/pywr/comments{/number}","issue_comment_url":"https://api.github.com/repos/snorfalorpagus/pywr/issues/comments{/number}","contents_url":"https://api.github.com/repos/snorfalorpagus/pywr/contents/{+path}","compare_url":"https://api.github.com/repos/snorfalorpagus/pywr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/snorfalorpagus/pywr/merges","archive_url":"https://api.github.com/repos/snorfalorpagus/pywr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/snorfalorpagus/pywr/downloads","issues_url":"https://api.github.com/repos/snorfalorpagus/pywr/issues{/number}","pulls_url":"https://api.github.com/repos/snorfalorpagus/pywr/pulls{/number}","milestones_url":"https://api.github.com/repos/snorfalorpagus/pywr/milestones{/number}","notifications_url":"https://api.github.com/repos/snorfalorpagus/pywr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/snorfalorpagus/pywr/labels{/name}","releases_url":"https://api.github.com/repos/snorfalorpagus/pywr/releases{/id}","created_at":"2015-01-20T23:13:55Z","updated_at":"2015-02-06T23:48:29Z","pushed_at":"2015-08-26T23:20:12Z","git_url":"git://github.com/snorfalorpagus/pywr.git","ssh_url":"git@github.com:snorfalorpagus/pywr.git","clone_url":"https://github.com/snorfalorpagus/pywr.git","svn_url":"https://github.com/snorfalorpagus/pywr","homepage":null,"size":566,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":18,"forks":1,"open_issues":18,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/snorfalorpagus/pywr/pulls/33"},"html":{"href":"https://github.com/snorfalorpagus/pywr/pull/33"},"issue":{"href":"https://api.github.com/repos/snorfalorpagus/pywr/issues/33"},"comments":{"href":"https://api.github.com/repos/snorfalorpagus/pywr/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/snorfalorpagus/pywr/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/snorfalorpagus/pywr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/snorfalorpagus/pywr/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/snorfalorpagus/pywr/statuses/7686a756ac94ef8be2ab3cd76ff1ad826ee90082"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":6,"review_comments":0,"commits":23,"additions":1415,"deletions":290,"changed_files":14}}