{"action":"created","comment":{"url":"https://api.github.com/repos/mantidproject/mantid/pulls/comments/37184731","id":37184731,"diff_hunk":"@@ -0,0 +1,281 @@\n+import unittest\n+from testhelpers import run_algorithm\n+from mantid.api import AnalysisDataService\n+import numpy as np\n+import mantid.simpleapi as api\n+from mantid.simpleapi import DNSFlippingRatioCorr\n+\n+\n+class DNSFlippingRatioCorrTest(unittest.TestCase):\n+    workspaces = []\n+    __sf_bkgrws = None\n+    __nsf_bkgrws = None\n+    __sf_nicrws = None\n+    __nsf_nicrws = None\n+\n+    def _create_fake_workspace(self, wsname, dataY, flipper):\n+        \"\"\"\n+        creates DNS workspace with fake data\n+        \"\"\"\n+        ndet = 24\n+        dataX = np.zeros(2*ndet)\n+        dataX.fill(4.2 + 0.00001)\n+        dataX[::2] -= 0.000002\n+        dataE = np.sqrt(dataY)\n+        # create workspace\n+        api.CreateWorkspace(OutputWorkspace=wsname, DataX=dataX, DataY=dataY,\n+                            DataE=dataE, NSpec=ndet, UnitX=\"Wavelength\")\n+        outws = api.mtd[wsname]\n+        api.LoadInstrument(outws, InstrumentName='DNS')","path":"Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/DNSFlippingRatioCorrTest.py","position":29,"original_position":29,"commit_id":"566b2afb160a9ca9cec2ebde9648c24c72bc3b43","original_commit_id":"9bfd9400430ad5c368a91e4cc732e024ac93bfb7","user":{"login":"mganeva","id":7290767,"avatar_url":"https://avatars.githubusercontent.com/u/7290767?v=3","gravatar_id":"","url":"https://api.github.com/users/mganeva","html_url":"https://github.com/mganeva","followers_url":"https://api.github.com/users/mganeva/followers","following_url":"https://api.github.com/users/mganeva/following{/other_user}","gists_url":"https://api.github.com/users/mganeva/gists{/gist_id}","starred_url":"https://api.github.com/users/mganeva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mganeva/subscriptions","organizations_url":"https://api.github.com/users/mganeva/orgs","repos_url":"https://api.github.com/users/mganeva/repos","events_url":"https://api.github.com/users/mganeva/events{/privacy}","received_events_url":"https://api.github.com/users/mganeva/received_events","type":"User","site_admin":false},"body":"Thank you for recommendation. Since this function is any way subject for refactoring (because I want to make it generic for testing of all DNS algorithms), I will take a look whether it is possible to make it faster. For my unittests is important to have a connection to the real DNS instrument to avoid problems if IDF will be changed.","created_at":"2015-08-17T13:02:17Z","updated_at":"2015-08-17T13:02:17Z","html_url":"https://github.com/mantidproject/mantid/pull/13379#discussion_r37184731","pull_request_url":"https://api.github.com/repos/mantidproject/mantid/pulls/13379","_links":{"self":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/comments/37184731"},"html":{"href":"https://github.com/mantidproject/mantid/pull/13379#discussion_r37184731"},"pull_request":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/13379"}}},"pull_request":{"url":"https://api.github.com/repos/mantidproject/mantid/pulls/13379","id":42345938,"html_url":"https://github.com/mantidproject/mantid/pull/13379","diff_url":"https://github.com/mantidproject/mantid/pull/13379.diff","patch_url":"https://github.com/mantidproject/mantid/pull/13379.patch","issue_url":"https://api.github.com/repos/mantidproject/mantid/issues/13379","number":13379,"state":"open","locked":false,"title":"DNS flipping ratio correction","user":{"login":"mganeva","id":7290767,"avatar_url":"https://avatars.githubusercontent.com/u/7290767?v=3","gravatar_id":"","url":"https://api.github.com/users/mganeva","html_url":"https://github.com/mganeva","followers_url":"https://api.github.com/users/mganeva/followers","following_url":"https://api.github.com/users/mganeva/following{/other_user}","gists_url":"https://api.github.com/users/mganeva/gists{/gist_id}","starred_url":"https://api.github.com/users/mganeva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mganeva/subscriptions","organizations_url":"https://api.github.com/users/mganeva/orgs","repos_url":"https://api.github.com/users/mganeva/repos","events_url":"https://api.github.com/users/mganeva/events{/privacy}","received_events_url":"https://api.github.com/users/mganeva/received_events","type":"User","site_admin":false},"body":"Algorithm to perform the flipping ratio correction on DNS data.\r\n\r\nCan be tested on the fake workspaces (see unittests), but let me know if you need some DNS data for testing.\r\n","created_at":"2015-08-13T12:45:36Z","updated_at":"2015-08-17T13:02:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09210645bd52b955ece006ab4e9163ac86d158cd","assignee":{"login":"FedeMPouzols","id":5257172,"avatar_url":"https://avatars.githubusercontent.com/u/5257172?v=3","gravatar_id":"","url":"https://api.github.com/users/FedeMPouzols","html_url":"https://github.com/FedeMPouzols","followers_url":"https://api.github.com/users/FedeMPouzols/followers","following_url":"https://api.github.com/users/FedeMPouzols/following{/other_user}","gists_url":"https://api.github.com/users/FedeMPouzols/gists{/gist_id}","starred_url":"https://api.github.com/users/FedeMPouzols/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FedeMPouzols/subscriptions","organizations_url":"https://api.github.com/users/FedeMPouzols/orgs","repos_url":"https://api.github.com/users/FedeMPouzols/repos","events_url":"https://api.github.com/users/FedeMPouzols/events{/privacy}","received_events_url":"https://api.github.com/users/FedeMPouzols/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mantidproject/mantid/milestones/3","html_url":"https://github.com/mantidproject/mantid/milestones/Release%203.5","labels_url":"https://api.github.com/repos/mantidproject/mantid/milestones/3/labels","id":1058985,"number":3,"title":"Release 3.5","description":"This is a placeholder in git for the [trac Release 3.5 milestone](http://trac.mantidproject.org/mantid/milestone/Release%203.5)","creator":{"login":"peterfpeterson","id":404003,"avatar_url":"https://avatars.githubusercontent.com/u/404003?v=3","gravatar_id":"","url":"https://api.github.com/users/peterfpeterson","html_url":"https://github.com/peterfpeterson","followers_url":"https://api.github.com/users/peterfpeterson/followers","following_url":"https://api.github.com/users/peterfpeterson/following{/other_user}","gists_url":"https://api.github.com/users/peterfpeterson/gists{/gist_id}","starred_url":"https://api.github.com/users/peterfpeterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterfpeterson/subscriptions","organizations_url":"https://api.github.com/users/peterfpeterson/orgs","repos_url":"https://api.github.com/users/peterfpeterson/repos","events_url":"https://api.github.com/users/peterfpeterson/events{/privacy}","received_events_url":"https://api.github.com/users/peterfpeterson/received_events","type":"User","site_admin":false},"open_issues":417,"closed_issues":846,"state":"open","created_at":"2015-04-08T18:44:37Z","updated_at":"2015-08-17T12:55:02Z","due_on":"2015-10-01T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mantidproject/mantid/pulls/13379/commits","review_comments_url":"https://api.github.com/repos/mantidproject/mantid/pulls/13379/comments","review_comment_url":"https://api.github.com/repos/mantidproject/mantid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mantidproject/mantid/issues/13379/comments","statuses_url":"https://api.github.com/repos/mantidproject/mantid/statuses/566b2afb160a9ca9cec2ebde9648c24c72bc3b43","head":{"label":"mganeva:dns_flipping_ratio_corr","ref":"dns_flipping_ratio_corr","sha":"566b2afb160a9ca9cec2ebde9648c24c72bc3b43","user":{"login":"mganeva","id":7290767,"avatar_url":"https://avatars.githubusercontent.com/u/7290767?v=3","gravatar_id":"","url":"https://api.github.com/users/mganeva","html_url":"https://github.com/mganeva","followers_url":"https://api.github.com/users/mganeva/followers","following_url":"https://api.github.com/users/mganeva/following{/other_user}","gists_url":"https://api.github.com/users/mganeva/gists{/gist_id}","starred_url":"https://api.github.com/users/mganeva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mganeva/subscriptions","organizations_url":"https://api.github.com/users/mganeva/orgs","repos_url":"https://api.github.com/users/mganeva/repos","events_url":"https://api.github.com/users/mganeva/events{/privacy}","received_events_url":"https://api.github.com/users/mganeva/received_events","type":"User","site_admin":false},"repo":{"id":18762481,"name":"mantid","full_name":"mganeva/mantid","owner":{"login":"mganeva","id":7290767,"avatar_url":"https://avatars.githubusercontent.com/u/7290767?v=3","gravatar_id":"","url":"https://api.github.com/users/mganeva","html_url":"https://github.com/mganeva","followers_url":"https://api.github.com/users/mganeva/followers","following_url":"https://api.github.com/users/mganeva/following{/other_user}","gists_url":"https://api.github.com/users/mganeva/gists{/gist_id}","starred_url":"https://api.github.com/users/mganeva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mganeva/subscriptions","organizations_url":"https://api.github.com/users/mganeva/orgs","repos_url":"https://api.github.com/users/mganeva/repos","events_url":"https://api.github.com/users/mganeva/events{/privacy}","received_events_url":"https://api.github.com/users/mganeva/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mganeva/mantid","description":"Main repository for Mantid code","fork":true,"url":"https://api.github.com/repos/mganeva/mantid","forks_url":"https://api.github.com/repos/mganeva/mantid/forks","keys_url":"https://api.github.com/repos/mganeva/mantid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mganeva/mantid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mganeva/mantid/teams","hooks_url":"https://api.github.com/repos/mganeva/mantid/hooks","issue_events_url":"https://api.github.com/repos/mganeva/mantid/issues/events{/number}","events_url":"https://api.github.com/repos/mganeva/mantid/events","assignees_url":"https://api.github.com/repos/mganeva/mantid/assignees{/user}","branches_url":"https://api.github.com/repos/mganeva/mantid/branches{/branch}","tags_url":"https://api.github.com/repos/mganeva/mantid/tags","blobs_url":"https://api.github.com/repos/mganeva/mantid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mganeva/mantid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mganeva/mantid/git/refs{/sha}","trees_url":"https://api.github.com/repos/mganeva/mantid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mganeva/mantid/statuses/{sha}","languages_url":"https://api.github.com/repos/mganeva/mantid/languages","stargazers_url":"https://api.github.com/repos/mganeva/mantid/stargazers","contributors_url":"https://api.github.com/repos/mganeva/mantid/contributors","subscribers_url":"https://api.github.com/repos/mganeva/mantid/subscribers","subscription_url":"https://api.github.com/repos/mganeva/mantid/subscription","commits_url":"https://api.github.com/repos/mganeva/mantid/commits{/sha}","git_commits_url":"https://api.github.com/repos/mganeva/mantid/git/commits{/sha}","comments_url":"https://api.github.com/repos/mganeva/mantid/comments{/number}","issue_comment_url":"https://api.github.com/repos/mganeva/mantid/issues/comments{/number}","contents_url":"https://api.github.com/repos/mganeva/mantid/contents/{+path}","compare_url":"https://api.github.com/repos/mganeva/mantid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mganeva/mantid/merges","archive_url":"https://api.github.com/repos/mganeva/mantid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mganeva/mantid/downloads","issues_url":"https://api.github.com/repos/mganeva/mantid/issues{/number}","pulls_url":"https://api.github.com/repos/mganeva/mantid/pulls{/number}","milestones_url":"https://api.github.com/repos/mganeva/mantid/milestones{/number}","notifications_url":"https://api.github.com/repos/mganeva/mantid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mganeva/mantid/labels{/name}","releases_url":"https://api.github.com/repos/mganeva/mantid/releases{/id}","created_at":"2014-04-14T13:56:33Z","updated_at":"2015-04-27T08:07:21Z","pushed_at":"2015-08-17T12:56:47Z","git_url":"git://github.com/mganeva/mantid.git","ssh_url":"git@github.com:mganeva/mantid.git","clone_url":"https://github.com/mganeva/mantid.git","svn_url":"https://github.com/mganeva/mantid","homepage":"www.mantidproject.org","size":306438,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mantidproject:master","ref":"master","sha":"82867f719c2ab11c5aca1db8cb4071aa52a75fa7","user":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars.githubusercontent.com/u/671496?v=3","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"repo":{"id":2594116,"name":"mantid","full_name":"mantidproject/mantid","owner":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars.githubusercontent.com/u/671496?v=3","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mantidproject/mantid","description":"Main repository for Mantid code","fork":false,"url":"https://api.github.com/repos/mantidproject/mantid","forks_url":"https://api.github.com/repos/mantidproject/mantid/forks","keys_url":"https://api.github.com/repos/mantidproject/mantid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mantidproject/mantid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mantidproject/mantid/teams","hooks_url":"https://api.github.com/repos/mantidproject/mantid/hooks","issue_events_url":"https://api.github.com/repos/mantidproject/mantid/issues/events{/number}","events_url":"https://api.github.com/repos/mantidproject/mantid/events","assignees_url":"https://api.github.com/repos/mantidproject/mantid/assignees{/user}","branches_url":"https://api.github.com/repos/mantidproject/mantid/branches{/branch}","tags_url":"https://api.github.com/repos/mantidproject/mantid/tags","blobs_url":"https://api.github.com/repos/mantidproject/mantid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mantidproject/mantid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mantidproject/mantid/git/refs{/sha}","trees_url":"https://api.github.com/repos/mantidproject/mantid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mantidproject/mantid/statuses/{sha}","languages_url":"https://api.github.com/repos/mantidproject/mantid/languages","stargazers_url":"https://api.github.com/repos/mantidproject/mantid/stargazers","contributors_url":"https://api.github.com/repos/mantidproject/mantid/contributors","subscribers_url":"https://api.github.com/repos/mantidproject/mantid/subscribers","subscription_url":"https://api.github.com/repos/mantidproject/mantid/subscription","commits_url":"https://api.github.com/repos/mantidproject/mantid/commits{/sha}","git_commits_url":"https://api.github.com/repos/mantidproject/mantid/git/commits{/sha}","comments_url":"https://api.github.com/repos/mantidproject/mantid/comments{/number}","issue_comment_url":"https://api.github.com/repos/mantidproject/mantid/issues/comments{/number}","contents_url":"https://api.github.com/repos/mantidproject/mantid/contents/{+path}","compare_url":"https://api.github.com/repos/mantidproject/mantid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mantidproject/mantid/merges","archive_url":"https://api.github.com/repos/mantidproject/mantid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mantidproject/mantid/downloads","issues_url":"https://api.github.com/repos/mantidproject/mantid/issues{/number}","pulls_url":"https://api.github.com/repos/mantidproject/mantid/pulls{/number}","milestones_url":"https://api.github.com/repos/mantidproject/mantid/milestones{/number}","notifications_url":"https://api.github.com/repos/mantidproject/mantid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mantidproject/mantid/labels{/name}","releases_url":"https://api.github.com/repos/mantidproject/mantid/releases{/id}","created_at":"2011-10-17T19:07:38Z","updated_at":"2015-07-29T09:48:16Z","pushed_at":"2015-08-17T12:56:47Z","git_url":"git://github.com/mantidproject/mantid.git","ssh_url":"git@github.com:mantidproject/mantid.git","clone_url":"https://github.com/mantidproject/mantid.git","svn_url":"https://github.com/mantidproject/mantid","homepage":"www.mantidproject.org","size":546111,"stargazers_count":29,"watchers_count":29,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":1477,"forks":19,"open_issues":1477,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/13379"},"html":{"href":"https://github.com/mantidproject/mantid/pull/13379"},"issue":{"href":"https://api.github.com/repos/mantidproject/mantid/issues/13379"},"comments":{"href":"https://api.github.com/repos/mantidproject/mantid/issues/13379/comments"},"review_comments":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/13379/comments"},"review_comment":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/13379/commits"},"statuses":{"href":"https://api.github.com/repos/mantidproject/mantid/statuses/566b2afb160a9ca9cec2ebde9648c24c72bc3b43"}}}}