{"action":"created","comment":{"url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/comments/213258709","pull_request_review_id":150055852,"id":213258709,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMzI1ODcwOQ==","diff_hunk":"@@ -109,12 +109,14 @@ def estimate_parameters(self, signal, x1, x2, only_current=False,\n             s = signal.get_current_signal()\n         else:\n             s = signal\n-        I1 = s.isig[i1:i3].integrate1D(2j).data.astype(\"float\")\n-        I2 = s.isig[i3:i2].integrate1D(2j).data.astype(\"float\")\n         if s._lazy:\n             import dask.array as da\n             log = da.log\n+            I1 = s.isig[i1:i3].integrate1D(2j).data.astype(\"float\")\n+            I2 = s.isig[i3:i2].integrate1D(2j).data.astype(\"float\")\n         else:\n+            I1 = s.data[..., i1:i3].sum(-1)","path":"hyperspy/_components/power_law.py","position":94,"original_position":12,"commit_id":"c92ab1d181f84f0b6c99df2cba3b5179d2da0bcb","original_commit_id":"3facbc1df3bee8c186cb0efecaef1c6e3fc7d0a4","user":{"login":"ericpre","id":11851990,"node_id":"MDQ6VXNlcjExODUxOTkw","avatar_url":"https://avatars1.githubusercontent.com/u/11851990?v=4","gravatar_id":"","url":"https://api.github.com/users/ericpre","html_url":"https://github.com/ericpre","followers_url":"https://api.github.com/users/ericpre/followers","following_url":"https://api.github.com/users/ericpre/following{/other_user}","gists_url":"https://api.github.com/users/ericpre/gists{/gist_id}","starred_url":"https://api.github.com/users/ericpre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericpre/subscriptions","organizations_url":"https://api.github.com/users/ericpre/orgs","repos_url":"https://api.github.com/users/ericpre/repos","events_url":"https://api.github.com/users/ericpre/events{/privacy}","received_events_url":"https://api.github.com/users/ericpre/received_events","type":"User","site_admin":false},"body":"This is an speed improvement of 100x. Using `integrate1D` give slightly different results (~2e-3) for binned signal, so for an estimation this is fine!","created_at":"2018-08-28T10:19:51Z","updated_at":"2018-08-28T10:19:51Z","html_url":"https://github.com/hyperspy/hyperspy/pull/2032#discussion_r213258709","pull_request_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/2032","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/comments/213258709"},"html":{"href":"https://github.com/hyperspy/hyperspy/pull/2032#discussion_r213258709"},"pull_request":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/2032"}}},"pull_request":{"url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/2032","id":208142139,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4MTQyMTM5","html_url":"https://github.com/hyperspy/hyperspy/pull/2032","diff_url":"https://github.com/hyperspy/hyperspy/pull/2032.diff","patch_url":"https://github.com/hyperspy/hyperspy/pull/2032.patch","issue_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/2032","number":2032,"state":"open","locked":false,"title":"Speed up fast background removal","user":{"login":"ericpre","id":11851990,"node_id":"MDQ6VXNlcjExODUxOTkw","avatar_url":"https://avatars1.githubusercontent.com/u/11851990?v=4","gravatar_id":"","url":"https://api.github.com/users/ericpre","html_url":"https://github.com/ericpre","followers_url":"https://api.github.com/users/ericpre/followers","following_url":"https://api.github.com/users/ericpre/following{/other_user}","gists_url":"https://api.github.com/users/ericpre/gists{/gist_id}","starred_url":"https://api.github.com/users/ericpre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericpre/subscriptions","organizations_url":"https://api.github.com/users/ericpre/orgs","repos_url":"https://api.github.com/users/ericpre/repos","events_url":"https://api.github.com/users/ericpre/events{/privacy}","received_events_url":"https://api.github.com/users/ericpre/received_events","type":"User","site_admin":false},"body":"### Description of the change\r\nAdd a method to a few \"background type\" model component to compute the value of the component significantly quicker than it is currently done. This is particularly useful in combination of `estimate_parameters` of this components, for example for background removal of EELS data set.\r\n\r\n### Progress of the PR\r\n- [x] Add the `array` method to a few components to compute the component value without iteration over navigation axis,\r\n- [x] add tests,\r\n- [x] fix a bug in the `estimate_parameters` of the `GaussianHF` component,\r\n- [x] simplify tests and increase their coverage for a few components,\r\n- [x] move component tests from the tests/model folder to the tests/component folder,\r\n- [x] ready for review.\r\n\r\n","created_at":"2018-08-14T00:53:20Z","updated_at":"2018-08-28T10:19:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"afe2d45b7b7578be0a0e883c3370339e2baafc5d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":410127270,"node_id":"MDU6TGFiZWw0MTAxMjcyNzA=","url":"https://api.github.com/repos/hyperspy/hyperspy/labels/release:%20next%20minor","name":"release: next minor","color":"5319e7","default":false},{"id":239616072,"node_id":"MDU6TGFiZWwyMzk2MTYwNzI=","url":"https://api.github.com/repos/hyperspy/hyperspy/labels/status:%20waiting%20for%20author","name":"status: waiting for author","color":"fef2c0","default":false},{"id":262046960,"node_id":"MDU6TGFiZWwyNjIwNDY5NjA=","url":"https://api.github.com/repos/hyperspy/hyperspy/labels/type:%20bug-fix","name":"type: bug-fix","color":"0e8a16","default":false},{"id":142016,"node_id":"MDU6TGFiZWwxNDIwMTY=","url":"https://api.github.com/repos/hyperspy/hyperspy/labels/type:%20enhancement","name":"type: enhancement","color":"0052cc","default":false}],"milestone":{"url":"https://api.github.com/repos/hyperspy/hyperspy/milestones/30","html_url":"https://github.com/hyperspy/hyperspy/milestone/30","labels_url":"https://api.github.com/repos/hyperspy/hyperspy/milestones/30/labels","id":3265728,"node_id":"MDk6TWlsZXN0b25lMzI2NTcyOA==","number":30,"title":"v1.4","description":"","creator":{"login":"francisco-dlp","id":989719,"node_id":"MDQ6VXNlcjk4OTcxOQ==","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},"open_issues":26,"closed_issues":40,"state":"open","created_at":"2018-04-13T13:21:31Z","updated_at":"2018-08-27T11:14:22Z","due_on":"2018-09-03T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/2032/commits","review_comments_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/2032/comments","review_comment_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/2032/comments","statuses_url":"https://api.github.com/repos/hyperspy/hyperspy/statuses/c92ab1d181f84f0b6c99df2cba3b5179d2da0bcb","head":{"label":"ericpre:speed_up_fast_background_removal","ref":"speed_up_fast_background_removal","sha":"c92ab1d181f84f0b6c99df2cba3b5179d2da0bcb","user":{"login":"ericpre","id":11851990,"node_id":"MDQ6VXNlcjExODUxOTkw","avatar_url":"https://avatars1.githubusercontent.com/u/11851990?v=4","gravatar_id":"","url":"https://api.github.com/users/ericpre","html_url":"https://github.com/ericpre","followers_url":"https://api.github.com/users/ericpre/followers","following_url":"https://api.github.com/users/ericpre/following{/other_user}","gists_url":"https://api.github.com/users/ericpre/gists{/gist_id}","starred_url":"https://api.github.com/users/ericpre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericpre/subscriptions","organizations_url":"https://api.github.com/users/ericpre/orgs","repos_url":"https://api.github.com/users/ericpre/repos","events_url":"https://api.github.com/users/ericpre/events{/privacy}","received_events_url":"https://api.github.com/users/ericpre/received_events","type":"User","site_admin":false},"repo":{"id":41250647,"node_id":"MDEwOlJlcG9zaXRvcnk0MTI1MDY0Nw==","name":"hyperspy","full_name":"ericpre/hyperspy","owner":{"login":"ericpre","id":11851990,"node_id":"MDQ6VXNlcjExODUxOTkw","avatar_url":"https://avatars1.githubusercontent.com/u/11851990?v=4","gravatar_id":"","url":"https://api.github.com/users/ericpre","html_url":"https://github.com/ericpre","followers_url":"https://api.github.com/users/ericpre/followers","following_url":"https://api.github.com/users/ericpre/following{/other_user}","gists_url":"https://api.github.com/users/ericpre/gists{/gist_id}","starred_url":"https://api.github.com/users/ericpre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericpre/subscriptions","organizations_url":"https://api.github.com/users/ericpre/orgs","repos_url":"https://api.github.com/users/ericpre/repos","events_url":"https://api.github.com/users/ericpre/events{/privacy}","received_events_url":"https://api.github.com/users/ericpre/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ericpre/hyperspy","description":"Multidimensional data analysis","fork":true,"url":"https://api.github.com/repos/ericpre/hyperspy","forks_url":"https://api.github.com/repos/ericpre/hyperspy/forks","keys_url":"https://api.github.com/repos/ericpre/hyperspy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ericpre/hyperspy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ericpre/hyperspy/teams","hooks_url":"https://api.github.com/repos/ericpre/hyperspy/hooks","issue_events_url":"https://api.github.com/repos/ericpre/hyperspy/issues/events{/number}","events_url":"https://api.github.com/repos/ericpre/hyperspy/events","assignees_url":"https://api.github.com/repos/ericpre/hyperspy/assignees{/user}","branches_url":"https://api.github.com/repos/ericpre/hyperspy/branches{/branch}","tags_url":"https://api.github.com/repos/ericpre/hyperspy/tags","blobs_url":"https://api.github.com/repos/ericpre/hyperspy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ericpre/hyperspy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ericpre/hyperspy/git/refs{/sha}","trees_url":"https://api.github.com/repos/ericpre/hyperspy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ericpre/hyperspy/statuses/{sha}","languages_url":"https://api.github.com/repos/ericpre/hyperspy/languages","stargazers_url":"https://api.github.com/repos/ericpre/hyperspy/stargazers","contributors_url":"https://api.github.com/repos/ericpre/hyperspy/contributors","subscribers_url":"https://api.github.com/repos/ericpre/hyperspy/subscribers","subscription_url":"https://api.github.com/repos/ericpre/hyperspy/subscription","commits_url":"https://api.github.com/repos/ericpre/hyperspy/commits{/sha}","git_commits_url":"https://api.github.com/repos/ericpre/hyperspy/git/commits{/sha}","comments_url":"https://api.github.com/repos/ericpre/hyperspy/comments{/number}","issue_comment_url":"https://api.github.com/repos/ericpre/hyperspy/issues/comments{/number}","contents_url":"https://api.github.com/repos/ericpre/hyperspy/contents/{+path}","compare_url":"https://api.github.com/repos/ericpre/hyperspy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ericpre/hyperspy/merges","archive_url":"https://api.github.com/repos/ericpre/hyperspy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ericpre/hyperspy/downloads","issues_url":"https://api.github.com/repos/ericpre/hyperspy/issues{/number}","pulls_url":"https://api.github.com/repos/ericpre/hyperspy/pulls{/number}","milestones_url":"https://api.github.com/repos/ericpre/hyperspy/milestones{/number}","notifications_url":"https://api.github.com/repos/ericpre/hyperspy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ericpre/hyperspy/labels{/name}","releases_url":"https://api.github.com/repos/ericpre/hyperspy/releases{/id}","deployments_url":"https://api.github.com/repos/ericpre/hyperspy/deployments","created_at":"2015-08-23T13:30:33Z","updated_at":"2018-08-20T18:44:08Z","pushed_at":"2018-08-28T10:08:48Z","git_url":"git://github.com/ericpre/hyperspy.git","ssh_url":"git@github.com:ericpre/hyperspy.git","clone_url":"https://github.com/ericpre/hyperspy.git","svn_url":"https://github.com/ericpre/hyperspy","homepage":"http://www.hyperspy.org","size":208831,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"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","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"RELEASE_next_minor"}},"base":{"label":"hyperspy:RELEASE_next_minor","ref":"RELEASE_next_minor","sha":"4c19e2ef8dbae78d3b51bf7b88413948dd9e9b4b","user":{"login":"hyperspy","id":989756,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk4OTc1Ng==","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,"node_id":"MDEwOlJlcG9zaXRvcnkyMjMzOTk4","name":"hyperspy","full_name":"hyperspy/hyperspy","owner":{"login":"hyperspy","id":989756,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk4OTc1Ng==","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-08-28T08:53:05Z","pushed_at":"2018-08-28T10:08:49Z","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":206589,"stargazers_count":151,"watchers_count":151,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":100,"mirror_url":null,"archived":false,"open_issues_count":292,"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","node_id":"MDc6TGljZW5zZTk="},"forks":100,"open_issues":292,"watchers":151,"default_branch":"RELEASE_next_minor"}},"_links":{"self":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/2032"},"html":{"href":"https://github.com/hyperspy/hyperspy/pull/2032"},"issue":{"href":"https://api.github.com/repos/hyperspy/hyperspy/issues/2032"},"comments":{"href":"https://api.github.com/repos/hyperspy/hyperspy/issues/2032/comments"},"review_comments":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/2032/comments"},"review_comment":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/2032/commits"},"statuses":{"href":"https://api.github.com/repos/hyperspy/hyperspy/statuses/c92ab1d181f84f0b6c99df2cba3b5179d2da0bcb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ericpre"}}