{"action":"created","comment":{"url":"https://api.github.com/repos/pytroll/satpy/pulls/comments/173789586","pull_request_review_id":103031666,"id":173789586,"diff_hunk":"@@ -766,7 +766,7 @@ def load_writer_config(self, config_files, **kwargs):\n         return writer\n \n     def save_dataset(self, dataset_id, filename=None, writer=None,\n-                     overlay=None, **kwargs):\n+                     overlay=None, compute=True, **kwargs):","path":"satpy/scene.py","position":5,"original_position":5,"commit_id":"54844055654e1d7c8e15cda7280b9cd8f2e5becd","original_commit_id":"54844055654e1d7c8e15cda7280b9cd8f2e5becd","user":{"login":"mraspaud","id":167802,"avatar_url":"https://avatars1.githubusercontent.com/u/167802?v=4","gravatar_id":"","url":"https://api.github.com/users/mraspaud","html_url":"https://github.com/mraspaud","followers_url":"https://api.github.com/users/mraspaud/followers","following_url":"https://api.github.com/users/mraspaud/following{/other_user}","gists_url":"https://api.github.com/users/mraspaud/gists{/gist_id}","starred_url":"https://api.github.com/users/mraspaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mraspaud/subscriptions","organizations_url":"https://api.github.com/users/mraspaud/orgs","repos_url":"https://api.github.com/users/mraspaud/repos","events_url":"https://api.github.com/users/mraspaud/events{/privacy}","received_events_url":"https://api.github.com/users/mraspaud/received_events","type":"User","site_admin":false},"body":"Docstring should mention `compute` and what the function returns.","created_at":"2018-03-12T13:11:17Z","updated_at":"2018-03-12T13:13:15Z","html_url":"https://github.com/pytroll/satpy/pull/216#discussion_r173789586","pull_request_url":"https://api.github.com/repos/pytroll/satpy/pulls/216","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/pytroll/satpy/pulls/comments/173789586"},"html":{"href":"https://github.com/pytroll/satpy/pull/216#discussion_r173789586"},"pull_request":{"href":"https://api.github.com/repos/pytroll/satpy/pulls/216"}}},"pull_request":{"url":"https://api.github.com/repos/pytroll/satpy/pulls/216","id":173635626,"html_url":"https://github.com/pytroll/satpy/pull/216","diff_url":"https://github.com/pytroll/satpy/pull/216.diff","patch_url":"https://github.com/pytroll/satpy/pull/216.patch","issue_url":"https://api.github.com/repos/pytroll/satpy/issues/216","number":216,"state":"open","locked":false,"title":"Fix dataset writing so computations are shared between tasks","user":{"login":"davidh-ssec","id":1828519,"avatar_url":"https://avatars3.githubusercontent.com/u/1828519?v=4","gravatar_id":"","url":"https://api.github.com/users/davidh-ssec","html_url":"https://github.com/davidh-ssec","followers_url":"https://api.github.com/users/davidh-ssec/followers","following_url":"https://api.github.com/users/davidh-ssec/following{/other_user}","gists_url":"https://api.github.com/users/davidh-ssec/gists{/gist_id}","starred_url":"https://api.github.com/users/davidh-ssec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidh-ssec/subscriptions","organizations_url":"https://api.github.com/users/davidh-ssec/orgs","repos_url":"https://api.github.com/users/davidh-ssec/repos","events_url":"https://api.github.com/users/davidh-ssec/events{/privacy}","received_events_url":"https://api.github.com/users/davidh-ssec/received_events","type":"User","site_admin":false},"body":"This PR adds a `compute` keyword argument to all save_dataset, save_datasets, save_image methods in the Scene and Writers. It defaults to True in all of these methods so individual use cases have not changed. It is also handled by the higher level methods so that the user doesn't see a difference except in performance.\r\n\r\nHandling writes in the way this PR implements will allow all dask objects to be computed at the same and is how it is implemented in the higher level methods. This means that if tasks share computations (input datasets) they will be shared and shouldn't have to be recalculated.\r\n\r\nAdditionally this will allow for more flexibility in the future. If a user calls `scn.save_datasets(..., compute=False)` they will get a dask `Delayed` object back which they can then use with other delayed objects.\r\n\r\nIf compute is True or a writer does not support returning a delayed object (and they don't complain about the compute keyword being passed) then functions will return whatever the result of the delayed function call was. Typically this is just None. This should also allow future flexibility if a writer should be returning something (maybe filenames of the files created?).\r\n\r\nWIP: Docstrings and tests to make sure this functionality completely works.\r\n\r\n - [ ] Tests added <!-- for all bug fixes or enhancements -->\r\n - [x] Tests passed <!-- for all non-documentation changes) -->\r\n - [x] Passes ``git diff origin/develop **/*py | flake8 --diff`` <!-- remove if you did not edit any Python files -->\r\n - [ ] Fully documented <!-- remove if this change should not be visible to users, e.g., if it is an internal clean-up, or if this is part of a larger project that will be documented later -->\r\n","created_at":"2018-03-08T03:22:47Z","updated_at":"2018-03-12T13:13:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"761f49769b23d6fd5feea2c7e250f038118075b0","assignee":{"login":"davidh-ssec","id":1828519,"avatar_url":"https://avatars3.githubusercontent.com/u/1828519?v=4","gravatar_id":"","url":"https://api.github.com/users/davidh-ssec","html_url":"https://github.com/davidh-ssec","followers_url":"https://api.github.com/users/davidh-ssec/followers","following_url":"https://api.github.com/users/davidh-ssec/following{/other_user}","gists_url":"https://api.github.com/users/davidh-ssec/gists{/gist_id}","starred_url":"https://api.github.com/users/davidh-ssec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidh-ssec/subscriptions","organizations_url":"https://api.github.com/users/davidh-ssec/orgs","repos_url":"https://api.github.com/users/davidh-ssec/repos","events_url":"https://api.github.com/users/davidh-ssec/events{/privacy}","received_events_url":"https://api.github.com/users/davidh-ssec/received_events","type":"User","site_admin":false},"assignees":[{"login":"davidh-ssec","id":1828519,"avatar_url":"https://avatars3.githubusercontent.com/u/1828519?v=4","gravatar_id":"","url":"https://api.github.com/users/davidh-ssec","html_url":"https://github.com/davidh-ssec","followers_url":"https://api.github.com/users/davidh-ssec/followers","following_url":"https://api.github.com/users/davidh-ssec/following{/other_user}","gists_url":"https://api.github.com/users/davidh-ssec/gists{/gist_id}","starred_url":"https://api.github.com/users/davidh-ssec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidh-ssec/subscriptions","organizations_url":"https://api.github.com/users/davidh-ssec/orgs","repos_url":"https://api.github.com/users/davidh-ssec/repos","events_url":"https://api.github.com/users/davidh-ssec/events{/privacy}","received_events_url":"https://api.github.com/users/davidh-ssec/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":841946279,"url":"https://api.github.com/repos/pytroll/satpy/labels/component:writers","name":"component:writers","color":"1d76db","default":false},{"id":323805264,"url":"https://api.github.com/repos/pytroll/satpy/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":{"url":"https://api.github.com/repos/pytroll/satpy/milestones/2","html_url":"https://github.com/pytroll/satpy/milestone/2","labels_url":"https://api.github.com/repos/pytroll/satpy/milestones/2/labels","id":2979810,"number":2,"title":"v0.9","description":"Xarray and dask","creator":{"login":"mraspaud","id":167802,"avatar_url":"https://avatars1.githubusercontent.com/u/167802?v=4","gravatar_id":"","url":"https://api.github.com/users/mraspaud","html_url":"https://github.com/mraspaud","followers_url":"https://api.github.com/users/mraspaud/followers","following_url":"https://api.github.com/users/mraspaud/following{/other_user}","gists_url":"https://api.github.com/users/mraspaud/gists{/gist_id}","starred_url":"https://api.github.com/users/mraspaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mraspaud/subscriptions","organizations_url":"https://api.github.com/users/mraspaud/orgs","repos_url":"https://api.github.com/users/mraspaud/repos","events_url":"https://api.github.com/users/mraspaud/events{/privacy}","received_events_url":"https://api.github.com/users/mraspaud/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":9,"state":"open","created_at":"2017-12-14T12:48:31Z","updated_at":"2018-03-08T03:22:47Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/pytroll/satpy/pulls/216/commits","review_comments_url":"https://api.github.com/repos/pytroll/satpy/pulls/216/comments","review_comment_url":"https://api.github.com/repos/pytroll/satpy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pytroll/satpy/issues/216/comments","statuses_url":"https://api.github.com/repos/pytroll/satpy/statuses/54844055654e1d7c8e15cda7280b9cd8f2e5becd","head":{"label":"pytroll:feature-delayed-save-datasets","ref":"feature-delayed-save-datasets","sha":"54844055654e1d7c8e15cda7280b9cd8f2e5becd","user":{"login":"pytroll","id":13004956,"avatar_url":"https://avatars0.githubusercontent.com/u/13004956?v=4","gravatar_id":"","url":"https://api.github.com/users/pytroll","html_url":"https://github.com/pytroll","followers_url":"https://api.github.com/users/pytroll/followers","following_url":"https://api.github.com/users/pytroll/following{/other_user}","gists_url":"https://api.github.com/users/pytroll/gists{/gist_id}","starred_url":"https://api.github.com/users/pytroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytroll/subscriptions","organizations_url":"https://api.github.com/users/pytroll/orgs","repos_url":"https://api.github.com/users/pytroll/repos","events_url":"https://api.github.com/users/pytroll/events{/privacy}","received_events_url":"https://api.github.com/users/pytroll/received_events","type":"Organization","site_admin":false},"repo":{"id":51397392,"name":"satpy","full_name":"pytroll/satpy","owner":{"login":"pytroll","id":13004956,"avatar_url":"https://avatars0.githubusercontent.com/u/13004956?v=4","gravatar_id":"","url":"https://api.github.com/users/pytroll","html_url":"https://github.com/pytroll","followers_url":"https://api.github.com/users/pytroll/followers","following_url":"https://api.github.com/users/pytroll/following{/other_user}","gists_url":"https://api.github.com/users/pytroll/gists{/gist_id}","starred_url":"https://api.github.com/users/pytroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytroll/subscriptions","organizations_url":"https://api.github.com/users/pytroll/orgs","repos_url":"https://api.github.com/users/pytroll/repos","events_url":"https://api.github.com/users/pytroll/events{/privacy}","received_events_url":"https://api.github.com/users/pytroll/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pytroll/satpy","description":"Python package for earth-observing satellite data processing","fork":false,"url":"https://api.github.com/repos/pytroll/satpy","forks_url":"https://api.github.com/repos/pytroll/satpy/forks","keys_url":"https://api.github.com/repos/pytroll/satpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pytroll/satpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pytroll/satpy/teams","hooks_url":"https://api.github.com/repos/pytroll/satpy/hooks","issue_events_url":"https://api.github.com/repos/pytroll/satpy/issues/events{/number}","events_url":"https://api.github.com/repos/pytroll/satpy/events","assignees_url":"https://api.github.com/repos/pytroll/satpy/assignees{/user}","branches_url":"https://api.github.com/repos/pytroll/satpy/branches{/branch}","tags_url":"https://api.github.com/repos/pytroll/satpy/tags","blobs_url":"https://api.github.com/repos/pytroll/satpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pytroll/satpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pytroll/satpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/pytroll/satpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pytroll/satpy/statuses/{sha}","languages_url":"https://api.github.com/repos/pytroll/satpy/languages","stargazers_url":"https://api.github.com/repos/pytroll/satpy/stargazers","contributors_url":"https://api.github.com/repos/pytroll/satpy/contributors","subscribers_url":"https://api.github.com/repos/pytroll/satpy/subscribers","subscription_url":"https://api.github.com/repos/pytroll/satpy/subscription","commits_url":"https://api.github.com/repos/pytroll/satpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/pytroll/satpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/pytroll/satpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/pytroll/satpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/pytroll/satpy/contents/{+path}","compare_url":"https://api.github.com/repos/pytroll/satpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pytroll/satpy/merges","archive_url":"https://api.github.com/repos/pytroll/satpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pytroll/satpy/downloads","issues_url":"https://api.github.com/repos/pytroll/satpy/issues{/number}","pulls_url":"https://api.github.com/repos/pytroll/satpy/pulls{/number}","milestones_url":"https://api.github.com/repos/pytroll/satpy/milestones{/number}","notifications_url":"https://api.github.com/repos/pytroll/satpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pytroll/satpy/labels{/name}","releases_url":"https://api.github.com/repos/pytroll/satpy/releases{/id}","deployments_url":"https://api.github.com/repos/pytroll/satpy/deployments","created_at":"2016-02-09T20:29:43Z","updated_at":"2018-03-02T10:48:54Z","pushed_at":"2018-03-12T12:50:27Z","git_url":"git://github.com/pytroll/satpy.git","ssh_url":"git@github.com:pytroll/satpy.git","clone_url":"https://github.com/pytroll/satpy.git","svn_url":"https://github.com/pytroll/satpy","homepage":"http://satpy.readthedocs.org/en/latest/","size":4464,"stargazers_count":41,"watchers_count":41,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"archived":false,"open_issues_count":60,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":33,"open_issues":60,"watchers":41,"default_branch":"master"}},"base":{"label":"pytroll:develop","ref":"develop","sha":"cebde2b2dea51cf86dc83d38ee78fa639ce4d0f8","user":{"login":"pytroll","id":13004956,"avatar_url":"https://avatars0.githubusercontent.com/u/13004956?v=4","gravatar_id":"","url":"https://api.github.com/users/pytroll","html_url":"https://github.com/pytroll","followers_url":"https://api.github.com/users/pytroll/followers","following_url":"https://api.github.com/users/pytroll/following{/other_user}","gists_url":"https://api.github.com/users/pytroll/gists{/gist_id}","starred_url":"https://api.github.com/users/pytroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytroll/subscriptions","organizations_url":"https://api.github.com/users/pytroll/orgs","repos_url":"https://api.github.com/users/pytroll/repos","events_url":"https://api.github.com/users/pytroll/events{/privacy}","received_events_url":"https://api.github.com/users/pytroll/received_events","type":"Organization","site_admin":false},"repo":{"id":51397392,"name":"satpy","full_name":"pytroll/satpy","owner":{"login":"pytroll","id":13004956,"avatar_url":"https://avatars0.githubusercontent.com/u/13004956?v=4","gravatar_id":"","url":"https://api.github.com/users/pytroll","html_url":"https://github.com/pytroll","followers_url":"https://api.github.com/users/pytroll/followers","following_url":"https://api.github.com/users/pytroll/following{/other_user}","gists_url":"https://api.github.com/users/pytroll/gists{/gist_id}","starred_url":"https://api.github.com/users/pytroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytroll/subscriptions","organizations_url":"https://api.github.com/users/pytroll/orgs","repos_url":"https://api.github.com/users/pytroll/repos","events_url":"https://api.github.com/users/pytroll/events{/privacy}","received_events_url":"https://api.github.com/users/pytroll/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pytroll/satpy","description":"Python package for earth-observing satellite data processing","fork":false,"url":"https://api.github.com/repos/pytroll/satpy","forks_url":"https://api.github.com/repos/pytroll/satpy/forks","keys_url":"https://api.github.com/repos/pytroll/satpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pytroll/satpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pytroll/satpy/teams","hooks_url":"https://api.github.com/repos/pytroll/satpy/hooks","issue_events_url":"https://api.github.com/repos/pytroll/satpy/issues/events{/number}","events_url":"https://api.github.com/repos/pytroll/satpy/events","assignees_url":"https://api.github.com/repos/pytroll/satpy/assignees{/user}","branches_url":"https://api.github.com/repos/pytroll/satpy/branches{/branch}","tags_url":"https://api.github.com/repos/pytroll/satpy/tags","blobs_url":"https://api.github.com/repos/pytroll/satpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pytroll/satpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pytroll/satpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/pytroll/satpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pytroll/satpy/statuses/{sha}","languages_url":"https://api.github.com/repos/pytroll/satpy/languages","stargazers_url":"https://api.github.com/repos/pytroll/satpy/stargazers","contributors_url":"https://api.github.com/repos/pytroll/satpy/contributors","subscribers_url":"https://api.github.com/repos/pytroll/satpy/subscribers","subscription_url":"https://api.github.com/repos/pytroll/satpy/subscription","commits_url":"https://api.github.com/repos/pytroll/satpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/pytroll/satpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/pytroll/satpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/pytroll/satpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/pytroll/satpy/contents/{+path}","compare_url":"https://api.github.com/repos/pytroll/satpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pytroll/satpy/merges","archive_url":"https://api.github.com/repos/pytroll/satpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pytroll/satpy/downloads","issues_url":"https://api.github.com/repos/pytroll/satpy/issues{/number}","pulls_url":"https://api.github.com/repos/pytroll/satpy/pulls{/number}","milestones_url":"https://api.github.com/repos/pytroll/satpy/milestones{/number}","notifications_url":"https://api.github.com/repos/pytroll/satpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pytroll/satpy/labels{/name}","releases_url":"https://api.github.com/repos/pytroll/satpy/releases{/id}","deployments_url":"https://api.github.com/repos/pytroll/satpy/deployments","created_at":"2016-02-09T20:29:43Z","updated_at":"2018-03-02T10:48:54Z","pushed_at":"2018-03-12T12:50:27Z","git_url":"git://github.com/pytroll/satpy.git","ssh_url":"git@github.com:pytroll/satpy.git","clone_url":"https://github.com/pytroll/satpy.git","svn_url":"https://github.com/pytroll/satpy","homepage":"http://satpy.readthedocs.org/en/latest/","size":4464,"stargazers_count":41,"watchers_count":41,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"archived":false,"open_issues_count":60,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":33,"open_issues":60,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pytroll/satpy/pulls/216"},"html":{"href":"https://github.com/pytroll/satpy/pull/216"},"issue":{"href":"https://api.github.com/repos/pytroll/satpy/issues/216"},"comments":{"href":"https://api.github.com/repos/pytroll/satpy/issues/216/comments"},"review_comments":{"href":"https://api.github.com/repos/pytroll/satpy/pulls/216/comments"},"review_comment":{"href":"https://api.github.com/repos/pytroll/satpy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pytroll/satpy/pulls/216/commits"},"statuses":{"href":"https://api.github.com/repos/pytroll/satpy/statuses/54844055654e1d7c8e15cda7280b9cd8f2e5becd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mraspaud"}}