{"action":"created","comment":{"url":"https://api.github.com/repos/snoplusuk/echidna/pulls/comments/38857672","id":38857672,"diff_hunk":"@@ -0,0 +1,608 @@\n+import numpy\n+import rat\n+import echidna.calc.constants as const\n+\n+\n+def function_factory(dimension, **kwargs):\n+    '''Factory function that returns a dsextract class\n+    corresponding to the dimension (i.e. DS parameter)\n+    that is being extracted.\n+\n+    Args:\n+      dimension (str): to extract from a RAT DS/ntuple file.\n+      \\**kwargs (dict): to be passed to and checked by the extractor.\n+\n+    Raises:\n+      IndexError: dimension is an unknown parameter\n+\n+    Retuns:\n+      Extractor object.\n+    '''\n+    if dimension == \"energy_mc\":\n+        return EnergyExtractMC(**kwargs)\n+    elif dimension == \"energy_reco\":\n+        return EnergyExtractReco(**kwargs)\n+    elif dimension == \"energy_truth\":\n+        return EnergyExtractTruth(**kwargs)\n+    elif dimension == \"radial_mc\":\n+        return RadialExtractMC(**kwargs)\n+    elif dimension == \"radial_reco\":\n+        return RadialExtractReco(**kwargs)\n+    elif dimension == \"radial3_mc\":\n+        return Radial3ExtractMC(**kwargs)\n+    elif dimension == \"radial3_reco\":\n+        return Radial3ExtractReco(**kwargs)\n+    else:\n+        raise IndexError(\"Unknown parameter: %s\" % dimension)\n+\n+\n+class Extractor(object):\n+    '''Base class for extractor classes.\n+\n+    Args:\n+      name (str): of the dimension\n+      fid_r (float): Fiducial radius. Applies a cut to remove","path":"echidna/core/dsextract.py","position":44,"original_position":44,"commit_id":"d5c10d41f98857b8f89c010fd7677a65d4e58ce0","original_commit_id":"d5c10d41f98857b8f89c010fd7677a65d4e58ce0","user":{"login":"ashleyrback","id":1931666,"avatar_url":"https://avatars.githubusercontent.com/u/1931666?v=3","gravatar_id":"","url":"https://api.github.com/users/ashleyrback","html_url":"https://github.com/ashleyrback","followers_url":"https://api.github.com/users/ashleyrback/followers","following_url":"https://api.github.com/users/ashleyrback/following{/other_user}","gists_url":"https://api.github.com/users/ashleyrback/gists{/gist_id}","starred_url":"https://api.github.com/users/ashleyrback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashleyrback/subscriptions","organizations_url":"https://api.github.com/users/ashleyrback/orgs","repos_url":"https://api.github.com/users/ashleyrback/repos","events_url":"https://api.github.com/users/ashleyrback/events{/privacy}","received_events_url":"https://api.github.com/users/ashleyrback/received_events","type":"User","site_admin":false},"body":"I'm not sure about the `fid_r` as a variable name. Was there a reason for choosing `fid_r` over something like `fv_radius` that we had before? You still use `av_radius` elsewhere. It's completely personal preference, but I just feel `fv_radius` is more explicit than `fid_r`.","created_at":"2015-09-07T12:21:58Z","updated_at":"2015-09-07T12:21:58Z","html_url":"https://github.com/snoplusuk/echidna/pull/76#discussion_r38857672","pull_request_url":"https://api.github.com/repos/snoplusuk/echidna/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/snoplusuk/echidna/pulls/comments/38857672"},"html":{"href":"https://github.com/snoplusuk/echidna/pull/76#discussion_r38857672"},"pull_request":{"href":"https://api.github.com/repos/snoplusuk/echidna/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/snoplusuk/echidna/pulls/76","id":42371342,"html_url":"https://github.com/snoplusuk/echidna/pull/76","diff_url":"https://github.com/snoplusuk/echidna/pull/76.diff","patch_url":"https://github.com/snoplusuk/echidna/pull/76.patch","issue_url":"https://api.github.com/repos/snoplusuk/echidna/issues/76","number":76,"state":"open","locked":false,"title":"Config V2.0","user":{"login":"jwaterfield","id":1927874,"avatar_url":"https://avatars.githubusercontent.com/u/1927874?v=3","gravatar_id":"","url":"https://api.github.com/users/jwaterfield","html_url":"https://github.com/jwaterfield","followers_url":"https://api.github.com/users/jwaterfield/followers","following_url":"https://api.github.com/users/jwaterfield/following{/other_user}","gists_url":"https://api.github.com/users/jwaterfield/gists{/gist_id}","starred_url":"https://api.github.com/users/jwaterfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwaterfield/subscriptions","organizations_url":"https://api.github.com/users/jwaterfield/orgs","repos_url":"https://api.github.com/users/jwaterfield/repos","events_url":"https://api.github.com/users/jwaterfield/events{/privacy}","received_events_url":"https://api.github.com/users/jwaterfield/received_events","type":"User","site_admin":false},"body":"New version of echidna which uses config files to specify dimensions to allow users to define their own variables. Supersedes #68 ","created_at":"2015-08-13T16:34:53Z","updated_at":"2015-09-07T12:21:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"52c1248c577843086996d0ab35f05860c1c0788f","assignee":{"login":"ashleyrback","id":1931666,"avatar_url":"https://avatars.githubusercontent.com/u/1931666?v=3","gravatar_id":"","url":"https://api.github.com/users/ashleyrback","html_url":"https://github.com/ashleyrback","followers_url":"https://api.github.com/users/ashleyrback/followers","following_url":"https://api.github.com/users/ashleyrback/following{/other_user}","gists_url":"https://api.github.com/users/ashleyrback/gists{/gist_id}","starred_url":"https://api.github.com/users/ashleyrback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashleyrback/subscriptions","organizations_url":"https://api.github.com/users/ashleyrback/orgs","repos_url":"https://api.github.com/users/ashleyrback/repos","events_url":"https://api.github.com/users/ashleyrback/events{/privacy}","received_events_url":"https://api.github.com/users/ashleyrback/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/snoplusuk/echidna/pulls/76/commits","review_comments_url":"https://api.github.com/repos/snoplusuk/echidna/pulls/76/comments","review_comment_url":"https://api.github.com/repos/snoplusuk/echidna/pulls/comments{/number}","comments_url":"https://api.github.com/repos/snoplusuk/echidna/issues/76/comments","statuses_url":"https://api.github.com/repos/snoplusuk/echidna/statuses/d5c10d41f98857b8f89c010fd7677a65d4e58ce0","head":{"label":"jwaterfield:config","ref":"config","sha":"d5c10d41f98857b8f89c010fd7677a65d4e58ce0","user":{"login":"jwaterfield","id":1927874,"avatar_url":"https://avatars.githubusercontent.com/u/1927874?v=3","gravatar_id":"","url":"https://api.github.com/users/jwaterfield","html_url":"https://github.com/jwaterfield","followers_url":"https://api.github.com/users/jwaterfield/followers","following_url":"https://api.github.com/users/jwaterfield/following{/other_user}","gists_url":"https://api.github.com/users/jwaterfield/gists{/gist_id}","starred_url":"https://api.github.com/users/jwaterfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwaterfield/subscriptions","organizations_url":"https://api.github.com/users/jwaterfield/orgs","repos_url":"https://api.github.com/users/jwaterfield/repos","events_url":"https://api.github.com/users/jwaterfield/events{/privacy}","received_events_url":"https://api.github.com/users/jwaterfield/received_events","type":"User","site_admin":false},"repo":{"id":29021580,"name":"echidna","full_name":"jwaterfield/echidna","owner":{"login":"jwaterfield","id":1927874,"avatar_url":"https://avatars.githubusercontent.com/u/1927874?v=3","gravatar_id":"","url":"https://api.github.com/users/jwaterfield","html_url":"https://github.com/jwaterfield","followers_url":"https://api.github.com/users/jwaterfield/followers","following_url":"https://api.github.com/users/jwaterfield/following{/other_user}","gists_url":"https://api.github.com/users/jwaterfield/gists{/gist_id}","starred_url":"https://api.github.com/users/jwaterfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwaterfield/subscriptions","organizations_url":"https://api.github.com/users/jwaterfield/orgs","repos_url":"https://api.github.com/users/jwaterfield/repos","events_url":"https://api.github.com/users/jwaterfield/events{/privacy}","received_events_url":"https://api.github.com/users/jwaterfield/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jwaterfield/echidna","description":"","fork":true,"url":"https://api.github.com/repos/jwaterfield/echidna","forks_url":"https://api.github.com/repos/jwaterfield/echidna/forks","keys_url":"https://api.github.com/repos/jwaterfield/echidna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jwaterfield/echidna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jwaterfield/echidna/teams","hooks_url":"https://api.github.com/repos/jwaterfield/echidna/hooks","issue_events_url":"https://api.github.com/repos/jwaterfield/echidna/issues/events{/number}","events_url":"https://api.github.com/repos/jwaterfield/echidna/events","assignees_url":"https://api.github.com/repos/jwaterfield/echidna/assignees{/user}","branches_url":"https://api.github.com/repos/jwaterfield/echidna/branches{/branch}","tags_url":"https://api.github.com/repos/jwaterfield/echidna/tags","blobs_url":"https://api.github.com/repos/jwaterfield/echidna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jwaterfield/echidna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jwaterfield/echidna/git/refs{/sha}","trees_url":"https://api.github.com/repos/jwaterfield/echidna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jwaterfield/echidna/statuses/{sha}","languages_url":"https://api.github.com/repos/jwaterfield/echidna/languages","stargazers_url":"https://api.github.com/repos/jwaterfield/echidna/stargazers","contributors_url":"https://api.github.com/repos/jwaterfield/echidna/contributors","subscribers_url":"https://api.github.com/repos/jwaterfield/echidna/subscribers","subscription_url":"https://api.github.com/repos/jwaterfield/echidna/subscription","commits_url":"https://api.github.com/repos/jwaterfield/echidna/commits{/sha}","git_commits_url":"https://api.github.com/repos/jwaterfield/echidna/git/commits{/sha}","comments_url":"https://api.github.com/repos/jwaterfield/echidna/comments{/number}","issue_comment_url":"https://api.github.com/repos/jwaterfield/echidna/issues/comments{/number}","contents_url":"https://api.github.com/repos/jwaterfield/echidna/contents/{+path}","compare_url":"https://api.github.com/repos/jwaterfield/echidna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jwaterfield/echidna/merges","archive_url":"https://api.github.com/repos/jwaterfield/echidna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jwaterfield/echidna/downloads","issues_url":"https://api.github.com/repos/jwaterfield/echidna/issues{/number}","pulls_url":"https://api.github.com/repos/jwaterfield/echidna/pulls{/number}","milestones_url":"https://api.github.com/repos/jwaterfield/echidna/milestones{/number}","notifications_url":"https://api.github.com/repos/jwaterfield/echidna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jwaterfield/echidna/labels{/name}","releases_url":"https://api.github.com/repos/jwaterfield/echidna/releases{/id}","created_at":"2015-01-09T15:20:10Z","updated_at":"2015-04-28T13:39:15Z","pushed_at":"2015-09-01T15:09:10Z","git_url":"git://github.com/jwaterfield/echidna.git","ssh_url":"git@github.com:jwaterfield/echidna.git","clone_url":"https://github.com/jwaterfield/echidna.git","svn_url":"https://github.com/jwaterfield/echidna","homepage":null,"size":739,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"snoplusuk:master","ref":"master","sha":"724af684b5cc554874d1fe4096901025176fd71c","user":{"login":"snoplusuk","id":9432162,"avatar_url":"https://avatars.githubusercontent.com/u/9432162?v=3","gravatar_id":"","url":"https://api.github.com/users/snoplusuk","html_url":"https://github.com/snoplusuk","followers_url":"https://api.github.com/users/snoplusuk/followers","following_url":"https://api.github.com/users/snoplusuk/following{/other_user}","gists_url":"https://api.github.com/users/snoplusuk/gists{/gist_id}","starred_url":"https://api.github.com/users/snoplusuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoplusuk/subscriptions","organizations_url":"https://api.github.com/users/snoplusuk/orgs","repos_url":"https://api.github.com/users/snoplusuk/repos","events_url":"https://api.github.com/users/snoplusuk/events{/privacy}","received_events_url":"https://api.github.com/users/snoplusuk/received_events","type":"Organization","site_admin":false},"repo":{"id":25868677,"name":"echidna","full_name":"snoplusuk/echidna","owner":{"login":"snoplusuk","id":9432162,"avatar_url":"https://avatars.githubusercontent.com/u/9432162?v=3","gravatar_id":"","url":"https://api.github.com/users/snoplusuk","html_url":"https://github.com/snoplusuk","followers_url":"https://api.github.com/users/snoplusuk/followers","following_url":"https://api.github.com/users/snoplusuk/following{/other_user}","gists_url":"https://api.github.com/users/snoplusuk/gists{/gist_id}","starred_url":"https://api.github.com/users/snoplusuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoplusuk/subscriptions","organizations_url":"https://api.github.com/users/snoplusuk/orgs","repos_url":"https://api.github.com/users/snoplusuk/repos","events_url":"https://api.github.com/users/snoplusuk/events{/privacy}","received_events_url":"https://api.github.com/users/snoplusuk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/snoplusuk/echidna","description":"","fork":false,"url":"https://api.github.com/repos/snoplusuk/echidna","forks_url":"https://api.github.com/repos/snoplusuk/echidna/forks","keys_url":"https://api.github.com/repos/snoplusuk/echidna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/snoplusuk/echidna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/snoplusuk/echidna/teams","hooks_url":"https://api.github.com/repos/snoplusuk/echidna/hooks","issue_events_url":"https://api.github.com/repos/snoplusuk/echidna/issues/events{/number}","events_url":"https://api.github.com/repos/snoplusuk/echidna/events","assignees_url":"https://api.github.com/repos/snoplusuk/echidna/assignees{/user}","branches_url":"https://api.github.com/repos/snoplusuk/echidna/branches{/branch}","tags_url":"https://api.github.com/repos/snoplusuk/echidna/tags","blobs_url":"https://api.github.com/repos/snoplusuk/echidna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/snoplusuk/echidna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/snoplusuk/echidna/git/refs{/sha}","trees_url":"https://api.github.com/repos/snoplusuk/echidna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/snoplusuk/echidna/statuses/{sha}","languages_url":"https://api.github.com/repos/snoplusuk/echidna/languages","stargazers_url":"https://api.github.com/repos/snoplusuk/echidna/stargazers","contributors_url":"https://api.github.com/repos/snoplusuk/echidna/contributors","subscribers_url":"https://api.github.com/repos/snoplusuk/echidna/subscribers","subscription_url":"https://api.github.com/repos/snoplusuk/echidna/subscription","commits_url":"https://api.github.com/repos/snoplusuk/echidna/commits{/sha}","git_commits_url":"https://api.github.com/repos/snoplusuk/echidna/git/commits{/sha}","comments_url":"https://api.github.com/repos/snoplusuk/echidna/comments{/number}","issue_comment_url":"https://api.github.com/repos/snoplusuk/echidna/issues/comments{/number}","contents_url":"https://api.github.com/repos/snoplusuk/echidna/contents/{+path}","compare_url":"https://api.github.com/repos/snoplusuk/echidna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/snoplusuk/echidna/merges","archive_url":"https://api.github.com/repos/snoplusuk/echidna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/snoplusuk/echidna/downloads","issues_url":"https://api.github.com/repos/snoplusuk/echidna/issues{/number}","pulls_url":"https://api.github.com/repos/snoplusuk/echidna/pulls{/number}","milestones_url":"https://api.github.com/repos/snoplusuk/echidna/milestones{/number}","notifications_url":"https://api.github.com/repos/snoplusuk/echidna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/snoplusuk/echidna/labels{/name}","releases_url":"https://api.github.com/repos/snoplusuk/echidna/releases{/id}","created_at":"2014-10-28T12:40:38Z","updated_at":"2015-06-25T12:50:34Z","pushed_at":"2015-09-01T15:09:10Z","git_url":"git://github.com/snoplusuk/echidna.git","ssh_url":"git@github.com:snoplusuk/echidna.git","clone_url":"https://github.com/snoplusuk/echidna.git","svn_url":"https://github.com/snoplusuk/echidna","homepage":null,"size":1452,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":11,"mirror_url":null,"open_issues_count":9,"forks":11,"open_issues":9,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/snoplusuk/echidna/pulls/76"},"html":{"href":"https://github.com/snoplusuk/echidna/pull/76"},"issue":{"href":"https://api.github.com/repos/snoplusuk/echidna/issues/76"},"comments":{"href":"https://api.github.com/repos/snoplusuk/echidna/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/snoplusuk/echidna/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/snoplusuk/echidna/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/snoplusuk/echidna/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/snoplusuk/echidna/statuses/d5c10d41f98857b8f89c010fd7677a65d4e58ce0"}}}}