{"action":"created","issue":{"url":"https://api.github.com/repos/pywr/pywr/issues/326","repository_url":"https://api.github.com/repos/pywr/pywr","labels_url":"https://api.github.com/repos/pywr/pywr/issues/326/labels{/name}","comments_url":"https://api.github.com/repos/pywr/pywr/issues/326/comments","events_url":"https://api.github.com/repos/pywr/pywr/issues/326/events","html_url":"https://github.com/pywr/pywr/pull/326","id":190126332,"number":326,"title":"Add support for literals in AggregatedParameters. Closes #325.","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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-17T18:29:41Z","updated_at":"2016-12-16T10:12:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pywr/pywr/pulls/326","html_url":"https://github.com/pywr/pywr/pull/326","diff_url":"https://github.com/pywr/pywr/pull/326.diff","patch_url":"https://github.com/pywr/pywr/pull/326.patch"},"body":"This PR adds support for writing a literal into the parameter list for AggregatedParameter. The current requirement is that this is wrapped in a {\"type\": \"constant\", \"value\": X} parameter.\r\n\r\nNo changes are made to initalisation from Python space. Although it would be possible to do the same thing (convert floats to ConstantParameter), there might be some oddities with the .add/.remove methods, e.g. how should this work:\r\n\r\n```\r\np = AggregatedParameter()\r\np.add(3.0)\r\np.remove(3.0)\r\n```\r\n\r\nYou might expect this to work, but if 3.0 has been converted to a ConstantParameter that is what you'd need to pass to .remove. Also, not just equivalent (e.g. another constant == 3.0) as the set remove function works on the id() of the object, which the user doesn't even have a reference to!\r\n\r\nThoughts @jetuk?"},"comment":{"url":"https://api.github.com/repos/pywr/pywr/issues/comments/267560938","html_url":"https://github.com/pywr/pywr/pull/326#issuecomment-267560938","issue_url":"https://api.github.com/repos/pywr/pywr/issues/326","id":267560938,"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},"created_at":"2016-12-16T10:12:38Z","updated_at":"2016-12-16T10:12:38Z","body":"I'm lost on this one. Do we merge now or is there more to do?"}}
{"actor":{"display_login":"jetuk"}}