{"action":"created","issue":{"url":"https://api.github.com/repos/gammapy/gammapy/issues/661","repository_url":"https://api.github.com/repos/gammapy/gammapy","labels_url":"https://api.github.com/repos/gammapy/gammapy/issues/661/labels{/name}","comments_url":"https://api.github.com/repos/gammapy/gammapy/issues/661/comments","events_url":"https://api.github.com/repos/gammapy/gammapy/issues/661/events","html_url":"https://github.com/gammapy/gammapy/pull/661","id":169174018,"number":661,"title":"Improve detect.CWT","user":{"login":"OlgaVorokh","id":11058113,"avatar_url":"https://avatars.githubusercontent.com/u/11058113?v=3","gravatar_id":"","url":"https://api.github.com/users/OlgaVorokh","html_url":"https://github.com/OlgaVorokh","followers_url":"https://api.github.com/users/OlgaVorokh/followers","following_url":"https://api.github.com/users/OlgaVorokh/following{/other_user}","gists_url":"https://api.github.com/users/OlgaVorokh/gists{/gist_id}","starred_url":"https://api.github.com/users/OlgaVorokh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlgaVorokh/subscriptions","organizations_url":"https://api.github.com/users/OlgaVorokh/orgs","repos_url":"https://api.github.com/users/OlgaVorokh/repos","events_url":"https://api.github.com/users/OlgaVorokh/events{/privacy}","received_events_url":"https://api.github.com/users/OlgaVorokh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gammapy/gammapy/labels/cleanup","name":"cleanup","color":"5319e7"},{"url":"https://api.github.com/repos/gammapy/gammapy/labels/docs","name":"docs","color":"0052cc"},{"url":"https://api.github.com/repos/gammapy/gammapy/labels/feature","name":"feature","color":"84b6eb"},{"url":"https://api.github.com/repos/gammapy/gammapy/labels/tests","name":"tests","color":"009800"}],"state":"open","locked":false,"assignee":{"login":"cdeil","id":852409,"avatar_url":"https://avatars.githubusercontent.com/u/852409?v=3","gravatar_id":"","url":"https://api.github.com/users/cdeil","html_url":"https://github.com/cdeil","followers_url":"https://api.github.com/users/cdeil/followers","following_url":"https://api.github.com/users/cdeil/following{/other_user}","gists_url":"https://api.github.com/users/cdeil/gists{/gist_id}","starred_url":"https://api.github.com/users/cdeil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdeil/subscriptions","organizations_url":"https://api.github.com/users/cdeil/orgs","repos_url":"https://api.github.com/users/cdeil/repos","events_url":"https://api.github.com/users/cdeil/events{/privacy}","received_events_url":"https://api.github.com/users/cdeil/received_events","type":"User","site_admin":false},"assignees":[{"login":"cdeil","id":852409,"avatar_url":"https://avatars.githubusercontent.com/u/852409?v=3","gravatar_id":"","url":"https://api.github.com/users/cdeil","html_url":"https://github.com/cdeil","followers_url":"https://api.github.com/users/cdeil/followers","following_url":"https://api.github.com/users/cdeil/following{/other_user}","gists_url":"https://api.github.com/users/cdeil/gists{/gist_id}","starred_url":"https://api.github.com/users/cdeil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdeil/subscriptions","organizations_url":"https://api.github.com/users/cdeil/orgs","repos_url":"https://api.github.com/users/cdeil/repos","events_url":"https://api.github.com/users/cdeil/events{/privacy}","received_events_url":"https://api.github.com/users/cdeil/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/gammapy/gammapy/milestones/7","html_url":"https://github.com/gammapy/gammapy/milestones/0.5","labels_url":"https://api.github.com/repos/gammapy/gammapy/milestones/7/labels","id":1275561,"number":7,"title":"0.5","description":"","creator":{"login":"cdeil","id":852409,"avatar_url":"https://avatars.githubusercontent.com/u/852409?v=3","gravatar_id":"","url":"https://api.github.com/users/cdeil","html_url":"https://github.com/cdeil","followers_url":"https://api.github.com/users/cdeil/followers","following_url":"https://api.github.com/users/cdeil/following{/other_user}","gists_url":"https://api.github.com/users/cdeil/gists{/gist_id}","starred_url":"https://api.github.com/users/cdeil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdeil/subscriptions","organizations_url":"https://api.github.com/users/cdeil/orgs","repos_url":"https://api.github.com/users/cdeil/repos","events_url":"https://api.github.com/users/cdeil/events{/privacy}","received_events_url":"https://api.github.com/users/cdeil/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":121,"state":"open","created_at":"2015-08-27T09:29:48Z","updated_at":"2016-08-04T15:18:43Z","due_on":"2016-08-04T22:00:00Z","closed_at":null},"comments":3,"created_at":"2016-08-03T16:23:44Z","updated_at":"2016-08-04T17:37:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/gammapy/gammapy/pulls/661","html_url":"https://github.com/gammapy/gammapy/pull/661","diff_url":"https://github.com/gammapy/gammapy/pull/661.diff","patch_url":"https://github.com/gammapy/gammapy/pull/661.patch"},"body":"This PR improves [CWT](http://docs.gammapy.org/en/latest/api/gammapy.detect.CWT.html), which was added in #25 and recently improved directly in Gammapy master.\r\n\r\nTasks for this PR:\r\n- [ ] Improve the code quality\r\n- [ ] Add tests\r\n- [ ] Fix docs\r\n"},"comment":{"url":"https://api.github.com/repos/gammapy/gammapy/issues/comments/237626420","html_url":"https://github.com/gammapy/gammapy/pull/661#issuecomment-237626420","issue_url":"https://api.github.com/repos/gammapy/gammapy/issues/661","id":237626420,"user":{"login":"cdeil","id":852409,"avatar_url":"https://avatars.githubusercontent.com/u/852409?v=3","gravatar_id":"","url":"https://api.github.com/users/cdeil","html_url":"https://github.com/cdeil","followers_url":"https://api.github.com/users/cdeil/followers","following_url":"https://api.github.com/users/cdeil/following{/other_user}","gists_url":"https://api.github.com/users/cdeil/gists{/gist_id}","starred_url":"https://api.github.com/users/cdeil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdeil/subscriptions","organizations_url":"https://api.github.com/users/cdeil/orgs","repos_url":"https://api.github.com/users/cdeil/repos","events_url":"https://api.github.com/users/cdeil/events{/privacy}","received_events_url":"https://api.github.com/users/cdeil/received_events","type":"User","site_admin":false},"created_at":"2016-08-04T17:37:28Z","updated_at":"2016-08-04T17:37:28Z","body":"I think my preference would be to split out the scales and kernels into a separate class.\r\nMostly to have it nicely grouped, not necessarily for code re-use from other applications, although that might be possible later.\r\n```\r\nclass CWTKernels:\r\n    def __init__(self, scales):\r\n        scales = np.array(scales)\r\n        # compute kernels here, like previously done in `CWT.__init__`\r\n\r\n    @classmethod\r\n    def from_scale_grid(cls, n, min, step):\r\n        scales = [min * step ** _ for _ in range(n)]\r\n        return cls(scales)\r\n\r\n    def __str__():\r\n        # print useful info about the grid of scales, can be added later\r\n```\r\n\r\nWe will be able to re-use that class for other multi-scale algorithms, so I think it's good to split it out now. To use it for CWT:\r\n```\r\nfrom gammapy.detect import CWTKernels, CWT\r\n\r\nkernels = CWTKernels.from_scale_grid(... parameters ...)\r\nprint(scales) # for debugging\r\ncwt = CWT(scales)\r\ncwt.run(data)\r\n```\r\n\r\nOK to split out the scale / kernel handling this way, or do you prefer to keep the scales / kernel handling in `CWT.__init__`?"}}
{"actor":{"display_login":"cdeil"}}