{"action":"created","comment":{"url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/comments/179654627","pull_request_review_id":109940289,"id":179654627,"diff_hunk":"@@ -184,6 +185,42 @@ def test_numpy_func(self):\n         assert isinstance(result, np.ndarray)\n         np.testing.assert_array_equal(result, np.angle(self.signal.data))\n \n+    def test_add_gaussian_noise(self):\n+        s = self.signal\n+        kwargs = {}\n+        if s._lazy:\n+            data = s.data.compute()\n+            from dask.array.random import seed, normal\n+            kwargs[\"chunks\"] = s.data.chunks\n+        else:\n+            data = s.data.copy()\n+            from numpy.random import seed, normal\n+        seed(1)\n+        s.add_gaussian_noise(std=1.0)\n+        seed(1)\n+        if s._lazy:\n+            s.compute()\n+        np.testing.assert_array_almost_equal(","path":"hyperspy/tests/signal/test_tools.py","position":36,"original_position":36,"commit_id":"48fb58ade865f83ecda25a77fc2d8076dbb62ca5","original_commit_id":"48fb58ade865f83ecda25a77fc2d8076dbb62ca5","user":{"login":"francisco-dlp","id":989719,"avatar_url":"https://avatars0.githubusercontent.com/u/989719?v=4","gravatar_id":"","url":"https://api.github.com/users/francisco-dlp","html_url":"https://github.com/francisco-dlp","followers_url":"https://api.github.com/users/francisco-dlp/followers","following_url":"https://api.github.com/users/francisco-dlp/following{/other_user}","gists_url":"https://api.github.com/users/francisco-dlp/gists{/gist_id}","starred_url":"https://api.github.com/users/francisco-dlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francisco-dlp/subscriptions","organizations_url":"https://api.github.com/users/francisco-dlp/orgs","repos_url":"https://api.github.com/users/francisco-dlp/repos","events_url":"https://api.github.com/users/francisco-dlp/events{/privacy}","received_events_url":"https://api.github.com/users/francisco-dlp/received_events","type":"User","site_admin":false},"body":"I also thought so, but it turns out that the random numbers generated by dask and numpy with the same seed differ. ","created_at":"2018-04-06T03:48:10Z","updated_at":"2018-04-06T03:48:11Z","html_url":"https://github.com/hyperspy/hyperspy/pull/1895#discussion_r179654627","pull_request_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1895","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/comments/179654627"},"html":{"href":"https://github.com/hyperspy/hyperspy/pull/1895#discussion_r179654627"},"pull_request":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1895"}},"in_reply_to_id":179560583},"pull_request":{"url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1895","id":179704493,"html_url":"https://github.com/hyperspy/hyperspy/pull/1895","diff_url":"https://github.com/hyperspy/hyperspy/pull/1895.diff","patch_url":"https://github.com/hyperspy/hyperspy/pull/1895.patch","issue_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/1895","number":1895,"state":"open","locked":false,"title":"Fix lazy noise (#1886)","user":{"login":"francisco-dlp","id":989719,"avatar_url":"https://avatars0.githubusercontent.com/u/989719?v=4","gravatar_id":"","url":"https://api.github.com/users/francisco-dlp","html_url":"https://github.com/francisco-dlp","followers_url":"https://api.github.com/users/francisco-dlp/followers","following_url":"https://api.github.com/users/francisco-dlp/following{/other_user}","gists_url":"https://api.github.com/users/francisco-dlp/gists{/gist_id}","starred_url":"https://api.github.com/users/francisco-dlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francisco-dlp/subscriptions","organizations_url":"https://api.github.com/users/francisco-dlp/orgs","repos_url":"https://api.github.com/users/francisco-dlp/repos","events_url":"https://api.github.com/users/francisco-dlp/events{/privacy}","received_events_url":"https://api.github.com/users/francisco-dlp/received_events","type":"User","site_admin":false},"body":"### Description of the change\r\n\r\nFixes #1886 and #1894 \r\n\r\n### Progress of the PR\r\n- [x] Change implemented (can be split into several points),\r\n- [x] update docstring (if appropriate),\r\n- [x] add tests,\r\n- [x] ready for review.\r\n\r\n","created_at":"2018-04-05T15:01:19Z","updated_at":"2018-04-06T03:48:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53c202bfe01237eb2d0799f5612ed6e79e4c4a72","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":410127191,"url":"https://api.github.com/repos/hyperspy/hyperspy/labels/release:%20next%20patch","name":"release: next patch","color":"5319e7","default":false},{"id":166577586,"url":"https://api.github.com/repos/hyperspy/hyperspy/labels/status:%20needs%20review","name":"status: needs review","color":"fbca04","default":false},{"id":262046960,"url":"https://api.github.com/repos/hyperspy/hyperspy/labels/type:%20bug-fix","name":"type: bug-fix","color":"0e8a16","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1895/commits","review_comments_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1895/comments","review_comment_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/1895/comments","statuses_url":"https://api.github.com/repos/hyperspy/hyperspy/statuses/48fb58ade865f83ecda25a77fc2d8076dbb62ca5","head":{"label":"francisco-dlp:FIX_lazy_noise","ref":"FIX_lazy_noise","sha":"48fb58ade865f83ecda25a77fc2d8076dbb62ca5","user":{"login":"francisco-dlp","id":989719,"avatar_url":"https://avatars0.githubusercontent.com/u/989719?v=4","gravatar_id":"","url":"https://api.github.com/users/francisco-dlp","html_url":"https://github.com/francisco-dlp","followers_url":"https://api.github.com/users/francisco-dlp/followers","following_url":"https://api.github.com/users/francisco-dlp/following{/other_user}","gists_url":"https://api.github.com/users/francisco-dlp/gists{/gist_id}","starred_url":"https://api.github.com/users/francisco-dlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francisco-dlp/subscriptions","organizations_url":"https://api.github.com/users/francisco-dlp/orgs","repos_url":"https://api.github.com/users/francisco-dlp/repos","events_url":"https://api.github.com/users/francisco-dlp/events{/privacy}","received_events_url":"https://api.github.com/users/francisco-dlp/received_events","type":"User","site_admin":false},"repo":{"id":10522613,"name":"hyperspy","full_name":"francisco-dlp/hyperspy","owner":{"login":"francisco-dlp","id":989719,"avatar_url":"https://avatars0.githubusercontent.com/u/989719?v=4","gravatar_id":"","url":"https://api.github.com/users/francisco-dlp","html_url":"https://github.com/francisco-dlp","followers_url":"https://api.github.com/users/francisco-dlp/followers","following_url":"https://api.github.com/users/francisco-dlp/following{/other_user}","gists_url":"https://api.github.com/users/francisco-dlp/gists{/gist_id}","starred_url":"https://api.github.com/users/francisco-dlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francisco-dlp/subscriptions","organizations_url":"https://api.github.com/users/francisco-dlp/orgs","repos_url":"https://api.github.com/users/francisco-dlp/repos","events_url":"https://api.github.com/users/francisco-dlp/events{/privacy}","received_events_url":"https://api.github.com/users/francisco-dlp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/francisco-dlp/hyperspy","description":"A toolbox for hyperspectra data analysis","fork":true,"url":"https://api.github.com/repos/francisco-dlp/hyperspy","forks_url":"https://api.github.com/repos/francisco-dlp/hyperspy/forks","keys_url":"https://api.github.com/repos/francisco-dlp/hyperspy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/francisco-dlp/hyperspy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/francisco-dlp/hyperspy/teams","hooks_url":"https://api.github.com/repos/francisco-dlp/hyperspy/hooks","issue_events_url":"https://api.github.com/repos/francisco-dlp/hyperspy/issues/events{/number}","events_url":"https://api.github.com/repos/francisco-dlp/hyperspy/events","assignees_url":"https://api.github.com/repos/francisco-dlp/hyperspy/assignees{/user}","branches_url":"https://api.github.com/repos/francisco-dlp/hyperspy/branches{/branch}","tags_url":"https://api.github.com/repos/francisco-dlp/hyperspy/tags","blobs_url":"https://api.github.com/repos/francisco-dlp/hyperspy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/francisco-dlp/hyperspy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/francisco-dlp/hyperspy/git/refs{/sha}","trees_url":"https://api.github.com/repos/francisco-dlp/hyperspy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/francisco-dlp/hyperspy/statuses/{sha}","languages_url":"https://api.github.com/repos/francisco-dlp/hyperspy/languages","stargazers_url":"https://api.github.com/repos/francisco-dlp/hyperspy/stargazers","contributors_url":"https://api.github.com/repos/francisco-dlp/hyperspy/contributors","subscribers_url":"https://api.github.com/repos/francisco-dlp/hyperspy/subscribers","subscription_url":"https://api.github.com/repos/francisco-dlp/hyperspy/subscription","commits_url":"https://api.github.com/repos/francisco-dlp/hyperspy/commits{/sha}","git_commits_url":"https://api.github.com/repos/francisco-dlp/hyperspy/git/commits{/sha}","comments_url":"https://api.github.com/repos/francisco-dlp/hyperspy/comments{/number}","issue_comment_url":"https://api.github.com/repos/francisco-dlp/hyperspy/issues/comments{/number}","contents_url":"https://api.github.com/repos/francisco-dlp/hyperspy/contents/{+path}","compare_url":"https://api.github.com/repos/francisco-dlp/hyperspy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/francisco-dlp/hyperspy/merges","archive_url":"https://api.github.com/repos/francisco-dlp/hyperspy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/francisco-dlp/hyperspy/downloads","issues_url":"https://api.github.com/repos/francisco-dlp/hyperspy/issues{/number}","pulls_url":"https://api.github.com/repos/francisco-dlp/hyperspy/pulls{/number}","milestones_url":"https://api.github.com/repos/francisco-dlp/hyperspy/milestones{/number}","notifications_url":"https://api.github.com/repos/francisco-dlp/hyperspy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/francisco-dlp/hyperspy/labels{/name}","releases_url":"https://api.github.com/repos/francisco-dlp/hyperspy/releases{/id}","deployments_url":"https://api.github.com/repos/francisco-dlp/hyperspy/deployments","created_at":"2013-06-06T09:01:00Z","updated_at":"2015-04-07T09:32:13Z","pushed_at":"2018-04-05T14:37:57Z","git_url":"git://github.com/francisco-dlp/hyperspy.git","ssh_url":"git@github.com:francisco-dlp/hyperspy.git","clone_url":"https://github.com/francisco-dlp/hyperspy.git","svn_url":"https://github.com/francisco-dlp/hyperspy","homepage":"http://www.hyperspy.org","size":201274,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hyperspy:RELEASE_next_patch","ref":"RELEASE_next_patch","sha":"cea9c8976e932bf244d270fa37d44fa4c97f4d52","user":{"login":"hyperspy","id":989756,"avatar_url":"https://avatars3.githubusercontent.com/u/989756?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperspy","html_url":"https://github.com/hyperspy","followers_url":"https://api.github.com/users/hyperspy/followers","following_url":"https://api.github.com/users/hyperspy/following{/other_user}","gists_url":"https://api.github.com/users/hyperspy/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperspy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperspy/subscriptions","organizations_url":"https://api.github.com/users/hyperspy/orgs","repos_url":"https://api.github.com/users/hyperspy/repos","events_url":"https://api.github.com/users/hyperspy/events{/privacy}","received_events_url":"https://api.github.com/users/hyperspy/received_events","type":"Organization","site_admin":false},"repo":{"id":2233998,"name":"hyperspy","full_name":"hyperspy/hyperspy","owner":{"login":"hyperspy","id":989756,"avatar_url":"https://avatars3.githubusercontent.com/u/989756?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperspy","html_url":"https://github.com/hyperspy","followers_url":"https://api.github.com/users/hyperspy/followers","following_url":"https://api.github.com/users/hyperspy/following{/other_user}","gists_url":"https://api.github.com/users/hyperspy/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperspy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperspy/subscriptions","organizations_url":"https://api.github.com/users/hyperspy/orgs","repos_url":"https://api.github.com/users/hyperspy/repos","events_url":"https://api.github.com/users/hyperspy/events{/privacy}","received_events_url":"https://api.github.com/users/hyperspy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hyperspy/hyperspy","description":"Multidimensional data analysis","fork":false,"url":"https://api.github.com/repos/hyperspy/hyperspy","forks_url":"https://api.github.com/repos/hyperspy/hyperspy/forks","keys_url":"https://api.github.com/repos/hyperspy/hyperspy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyperspy/hyperspy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyperspy/hyperspy/teams","hooks_url":"https://api.github.com/repos/hyperspy/hyperspy/hooks","issue_events_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/events{/number}","events_url":"https://api.github.com/repos/hyperspy/hyperspy/events","assignees_url":"https://api.github.com/repos/hyperspy/hyperspy/assignees{/user}","branches_url":"https://api.github.com/repos/hyperspy/hyperspy/branches{/branch}","tags_url":"https://api.github.com/repos/hyperspy/hyperspy/tags","blobs_url":"https://api.github.com/repos/hyperspy/hyperspy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyperspy/hyperspy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyperspy/hyperspy/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyperspy/hyperspy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyperspy/hyperspy/statuses/{sha}","languages_url":"https://api.github.com/repos/hyperspy/hyperspy/languages","stargazers_url":"https://api.github.com/repos/hyperspy/hyperspy/stargazers","contributors_url":"https://api.github.com/repos/hyperspy/hyperspy/contributors","subscribers_url":"https://api.github.com/repos/hyperspy/hyperspy/subscribers","subscription_url":"https://api.github.com/repos/hyperspy/hyperspy/subscription","commits_url":"https://api.github.com/repos/hyperspy/hyperspy/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyperspy/hyperspy/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyperspy/hyperspy/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyperspy/hyperspy/contents/{+path}","compare_url":"https://api.github.com/repos/hyperspy/hyperspy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyperspy/hyperspy/merges","archive_url":"https://api.github.com/repos/hyperspy/hyperspy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyperspy/hyperspy/downloads","issues_url":"https://api.github.com/repos/hyperspy/hyperspy/issues{/number}","pulls_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls{/number}","milestones_url":"https://api.github.com/repos/hyperspy/hyperspy/milestones{/number}","notifications_url":"https://api.github.com/repos/hyperspy/hyperspy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyperspy/hyperspy/labels{/name}","releases_url":"https://api.github.com/repos/hyperspy/hyperspy/releases{/id}","deployments_url":"https://api.github.com/repos/hyperspy/hyperspy/deployments","created_at":"2011-08-19T13:14:36Z","updated_at":"2018-04-05T15:04:16Z","pushed_at":"2018-04-05T23:27:17Z","git_url":"git://github.com/hyperspy/hyperspy.git","ssh_url":"git@github.com:hyperspy/hyperspy.git","clone_url":"https://github.com/hyperspy/hyperspy.git","svn_url":"https://github.com/hyperspy/hyperspy","homepage":"http://www.hyperspy.org","size":200458,"stargazers_count":132,"watchers_count":132,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":94,"mirror_url":null,"archived":false,"open_issues_count":311,"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":94,"open_issues":311,"watchers":132,"default_branch":"RELEASE_next_minor"}},"_links":{"self":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1895"},"html":{"href":"https://github.com/hyperspy/hyperspy/pull/1895"},"issue":{"href":"https://api.github.com/repos/hyperspy/hyperspy/issues/1895"},"comments":{"href":"https://api.github.com/repos/hyperspy/hyperspy/issues/1895/comments"},"review_comments":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1895/comments"},"review_comment":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1895/commits"},"statuses":{"href":"https://api.github.com/repos/hyperspy/hyperspy/statuses/48fb58ade865f83ecda25a77fc2d8076dbb62ca5"}},"author_association":"OWNER"}}
{"actor":{"display_login":"francisco-dlp"}}