{"action":"opened","issue":{"url":"https://api.github.com/repos/pywr/pywr/issues/122","repository_url":"https://api.github.com/repos/pywr/pywr","labels_url":"https://api.github.com/repos/pywr/pywr/issues/122/labels{/name}","comments_url":"https://api.github.com/repos/pywr/pywr/issues/122/comments","events_url":"https://api.github.com/repos/pywr/pywr/issues/122/events","html_url":"https://github.com/pywr/pywr/issues/122","id":147412219,"number":122,"title":"Cache for Parameters","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":[{"url":"https://api.github.com/repos/pywr/pywr/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-11T12:31:25Z","updated_at":"2016-04-11T12:31:25Z","closed_at":null,"body":"Some `Parameters` will benefit from being cached.\r\n\r\n```\r\nfrom pywr.core import CacheParameter\r\ncache = CacheParameter(parameter)\r\nnode.max_flow = cache\r\n```\r\n\r\nThe cache only needs to retain values for the current timestep - if a query is made for another timestep the cache can be flushed.\r\n\r\nIt will be up to the user to determine when it's appropriate to cache a parameter. It should be useful for any parameter that's being called more than once in a timestep, where the result is more than a simple lookup."}}