{"action":"created","comment":{"url":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/comments/42114254","id":42114254,"diff_hunk":"@@ -48,3 +49,28 @@ def fit(data, distribution='norm'):\n     '''\n     params = getattr(_st, distribution).fit(data)\n     return params, _st.kstest(data, distribution, params)\n+\n+\n+def optimal_distribution(data):\n+    '''Calculate the parameters of a fit of different distributions to a data set\n+       and returns the distribution of the minimal ks-distance.\n+\n+    Parameters:\n+        data: array of data points to be fitted\n+\n+    Returns:\n+        tuple (optimal, parameters) of data to fitted distribution\n+\n+    Note:\n+        Uses Kolmogorov-Smirnov test to estimate distance and p-value.\n+\n+        The distributions that are tested are uniform, normal and exponential.\n+    '''\n+\n+    distr_to_check = ['norm', 'expon', 'uniform']","path":"neurom/stats.py","position":30,"original_position":30,"commit_id":"8ba6e75cba1ceda770baa53f75184865a52478e5","original_commit_id":"8ba6e75cba1ceda770baa53f75184865a52478e5","user":{"login":"lidakanari","id":14071443,"avatar_url":"https://avatars.githubusercontent.com/u/14071443?v=3","gravatar_id":"","url":"https://api.github.com/users/lidakanari","html_url":"https://github.com/lidakanari","followers_url":"https://api.github.com/users/lidakanari/followers","following_url":"https://api.github.com/users/lidakanari/following{/other_user}","gists_url":"https://api.github.com/users/lidakanari/gists{/gist_id}","starred_url":"https://api.github.com/users/lidakanari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lidakanari/subscriptions","organizations_url":"https://api.github.com/users/lidakanari/orgs","repos_url":"https://api.github.com/users/lidakanari/repos","events_url":"https://api.github.com/users/lidakanari/events{/privacy}","received_events_url":"https://api.github.com/users/lidakanari/received_events","type":"User","site_admin":false},"body":"Yes, that could be useful for generalization.","created_at":"2015-10-15T11:50:00Z","updated_at":"2015-10-15T11:50:00Z","html_url":"https://github.com/BlueBrain/NeuroM/pull/108#discussion_r42114254","pull_request_url":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/108","_links":{"self":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/comments/42114254"},"html":{"href":"https://github.com/BlueBrain/NeuroM/pull/108#discussion_r42114254"},"pull_request":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/108"}}},"pull_request":{"url":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/108","id":47774914,"html_url":"https://github.com/BlueBrain/NeuroM/pull/108","diff_url":"https://github.com/BlueBrain/NeuroM/pull/108.diff","patch_url":"https://github.com/BlueBrain/NeuroM/pull/108.patch","issue_url":"https://api.github.com/repos/BlueBrain/NeuroM/issues/108","number":108,"state":"open","locked":false,"title":"Add optimal distribution fit in stats and Fix pylint errors with numpy in local make test","user":{"login":"lidakanari","id":14071443,"avatar_url":"https://avatars.githubusercontent.com/u/14071443?v=3","gravatar_id":"","url":"https://api.github.com/users/lidakanari","html_url":"https://github.com/lidakanari","followers_url":"https://api.github.com/users/lidakanari/followers","following_url":"https://api.github.com/users/lidakanari/following{/other_user}","gists_url":"https://api.github.com/users/lidakanari/gists{/gist_id}","starred_url":"https://api.github.com/users/lidakanari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lidakanari/subscriptions","organizations_url":"https://api.github.com/users/lidakanari/orgs","repos_url":"https://api.github.com/users/lidakanari/repos","events_url":"https://api.github.com/users/lidakanari/events{/privacy}","received_events_url":"https://api.github.com/users/lidakanari/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-15T11:36:42Z","updated_at":"2015-10-15T11:50:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c239a3eb6a3094807d1cce8275dd109057643455","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/108/commits","review_comments_url":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/108/comments","review_comment_url":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BlueBrain/NeuroM/issues/108/comments","statuses_url":"https://api.github.com/repos/BlueBrain/NeuroM/statuses/8ba6e75cba1ceda770baa53f75184865a52478e5","head":{"label":"lidakanari:master","ref":"master","sha":"8ba6e75cba1ceda770baa53f75184865a52478e5","user":{"login":"lidakanari","id":14071443,"avatar_url":"https://avatars.githubusercontent.com/u/14071443?v=3","gravatar_id":"","url":"https://api.github.com/users/lidakanari","html_url":"https://github.com/lidakanari","followers_url":"https://api.github.com/users/lidakanari/followers","following_url":"https://api.github.com/users/lidakanari/following{/other_user}","gists_url":"https://api.github.com/users/lidakanari/gists{/gist_id}","starred_url":"https://api.github.com/users/lidakanari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lidakanari/subscriptions","organizations_url":"https://api.github.com/users/lidakanari/orgs","repos_url":"https://api.github.com/users/lidakanari/repos","events_url":"https://api.github.com/users/lidakanari/events{/privacy}","received_events_url":"https://api.github.com/users/lidakanari/received_events","type":"User","site_admin":false},"repo":{"id":43776839,"name":"NeuroM","full_name":"lidakanari/NeuroM","owner":{"login":"lidakanari","id":14071443,"avatar_url":"https://avatars.githubusercontent.com/u/14071443?v=3","gravatar_id":"","url":"https://api.github.com/users/lidakanari","html_url":"https://github.com/lidakanari","followers_url":"https://api.github.com/users/lidakanari/followers","following_url":"https://api.github.com/users/lidakanari/following{/other_user}","gists_url":"https://api.github.com/users/lidakanari/gists{/gist_id}","starred_url":"https://api.github.com/users/lidakanari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lidakanari/subscriptions","organizations_url":"https://api.github.com/users/lidakanari/orgs","repos_url":"https://api.github.com/users/lidakanari/repos","events_url":"https://api.github.com/users/lidakanari/events{/privacy}","received_events_url":"https://api.github.com/users/lidakanari/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lidakanari/NeuroM","description":"Neuronal Morphology Viewing and Analysis Tool","fork":true,"url":"https://api.github.com/repos/lidakanari/NeuroM","forks_url":"https://api.github.com/repos/lidakanari/NeuroM/forks","keys_url":"https://api.github.com/repos/lidakanari/NeuroM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lidakanari/NeuroM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lidakanari/NeuroM/teams","hooks_url":"https://api.github.com/repos/lidakanari/NeuroM/hooks","issue_events_url":"https://api.github.com/repos/lidakanari/NeuroM/issues/events{/number}","events_url":"https://api.github.com/repos/lidakanari/NeuroM/events","assignees_url":"https://api.github.com/repos/lidakanari/NeuroM/assignees{/user}","branches_url":"https://api.github.com/repos/lidakanari/NeuroM/branches{/branch}","tags_url":"https://api.github.com/repos/lidakanari/NeuroM/tags","blobs_url":"https://api.github.com/repos/lidakanari/NeuroM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lidakanari/NeuroM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lidakanari/NeuroM/git/refs{/sha}","trees_url":"https://api.github.com/repos/lidakanari/NeuroM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lidakanari/NeuroM/statuses/{sha}","languages_url":"https://api.github.com/repos/lidakanari/NeuroM/languages","stargazers_url":"https://api.github.com/repos/lidakanari/NeuroM/stargazers","contributors_url":"https://api.github.com/repos/lidakanari/NeuroM/contributors","subscribers_url":"https://api.github.com/repos/lidakanari/NeuroM/subscribers","subscription_url":"https://api.github.com/repos/lidakanari/NeuroM/subscription","commits_url":"https://api.github.com/repos/lidakanari/NeuroM/commits{/sha}","git_commits_url":"https://api.github.com/repos/lidakanari/NeuroM/git/commits{/sha}","comments_url":"https://api.github.com/repos/lidakanari/NeuroM/comments{/number}","issue_comment_url":"https://api.github.com/repos/lidakanari/NeuroM/issues/comments{/number}","contents_url":"https://api.github.com/repos/lidakanari/NeuroM/contents/{+path}","compare_url":"https://api.github.com/repos/lidakanari/NeuroM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lidakanari/NeuroM/merges","archive_url":"https://api.github.com/repos/lidakanari/NeuroM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lidakanari/NeuroM/downloads","issues_url":"https://api.github.com/repos/lidakanari/NeuroM/issues{/number}","pulls_url":"https://api.github.com/repos/lidakanari/NeuroM/pulls{/number}","milestones_url":"https://api.github.com/repos/lidakanari/NeuroM/milestones{/number}","notifications_url":"https://api.github.com/repos/lidakanari/NeuroM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lidakanari/NeuroM/labels{/name}","releases_url":"https://api.github.com/repos/lidakanari/NeuroM/releases{/id}","created_at":"2015-10-06T20:32:37Z","updated_at":"2015-10-06T20:32:38Z","pushed_at":"2015-10-15T11:35:45Z","git_url":"git://github.com/lidakanari/NeuroM.git","ssh_url":"git@github.com:lidakanari/NeuroM.git","clone_url":"https://github.com/lidakanari/NeuroM.git","svn_url":"https://github.com/lidakanari/NeuroM","homepage":null,"size":2232,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"BlueBrain:master","ref":"master","sha":"77a1eaa859b79401e02acd4e4eb56326224d92ad","user":{"login":"BlueBrain","id":1479142,"avatar_url":"https://avatars.githubusercontent.com/u/1479142?v=3","gravatar_id":"","url":"https://api.github.com/users/BlueBrain","html_url":"https://github.com/BlueBrain","followers_url":"https://api.github.com/users/BlueBrain/followers","following_url":"https://api.github.com/users/BlueBrain/following{/other_user}","gists_url":"https://api.github.com/users/BlueBrain/gists{/gist_id}","starred_url":"https://api.github.com/users/BlueBrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlueBrain/subscriptions","organizations_url":"https://api.github.com/users/BlueBrain/orgs","repos_url":"https://api.github.com/users/BlueBrain/repos","events_url":"https://api.github.com/users/BlueBrain/events{/privacy}","received_events_url":"https://api.github.com/users/BlueBrain/received_events","type":"Organization","site_admin":false},"repo":{"id":34906350,"name":"NeuroM","full_name":"BlueBrain/NeuroM","owner":{"login":"BlueBrain","id":1479142,"avatar_url":"https://avatars.githubusercontent.com/u/1479142?v=3","gravatar_id":"","url":"https://api.github.com/users/BlueBrain","html_url":"https://github.com/BlueBrain","followers_url":"https://api.github.com/users/BlueBrain/followers","following_url":"https://api.github.com/users/BlueBrain/following{/other_user}","gists_url":"https://api.github.com/users/BlueBrain/gists{/gist_id}","starred_url":"https://api.github.com/users/BlueBrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlueBrain/subscriptions","organizations_url":"https://api.github.com/users/BlueBrain/orgs","repos_url":"https://api.github.com/users/BlueBrain/repos","events_url":"https://api.github.com/users/BlueBrain/events{/privacy}","received_events_url":"https://api.github.com/users/BlueBrain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BlueBrain/NeuroM","description":"Neuronal Morphology Viewing and Analysis Tool","fork":false,"url":"https://api.github.com/repos/BlueBrain/NeuroM","forks_url":"https://api.github.com/repos/BlueBrain/NeuroM/forks","keys_url":"https://api.github.com/repos/BlueBrain/NeuroM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BlueBrain/NeuroM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BlueBrain/NeuroM/teams","hooks_url":"https://api.github.com/repos/BlueBrain/NeuroM/hooks","issue_events_url":"https://api.github.com/repos/BlueBrain/NeuroM/issues/events{/number}","events_url":"https://api.github.com/repos/BlueBrain/NeuroM/events","assignees_url":"https://api.github.com/repos/BlueBrain/NeuroM/assignees{/user}","branches_url":"https://api.github.com/repos/BlueBrain/NeuroM/branches{/branch}","tags_url":"https://api.github.com/repos/BlueBrain/NeuroM/tags","blobs_url":"https://api.github.com/repos/BlueBrain/NeuroM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BlueBrain/NeuroM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BlueBrain/NeuroM/git/refs{/sha}","trees_url":"https://api.github.com/repos/BlueBrain/NeuroM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BlueBrain/NeuroM/statuses/{sha}","languages_url":"https://api.github.com/repos/BlueBrain/NeuroM/languages","stargazers_url":"https://api.github.com/repos/BlueBrain/NeuroM/stargazers","contributors_url":"https://api.github.com/repos/BlueBrain/NeuroM/contributors","subscribers_url":"https://api.github.com/repos/BlueBrain/NeuroM/subscribers","subscription_url":"https://api.github.com/repos/BlueBrain/NeuroM/subscription","commits_url":"https://api.github.com/repos/BlueBrain/NeuroM/commits{/sha}","git_commits_url":"https://api.github.com/repos/BlueBrain/NeuroM/git/commits{/sha}","comments_url":"https://api.github.com/repos/BlueBrain/NeuroM/comments{/number}","issue_comment_url":"https://api.github.com/repos/BlueBrain/NeuroM/issues/comments{/number}","contents_url":"https://api.github.com/repos/BlueBrain/NeuroM/contents/{+path}","compare_url":"https://api.github.com/repos/BlueBrain/NeuroM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BlueBrain/NeuroM/merges","archive_url":"https://api.github.com/repos/BlueBrain/NeuroM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BlueBrain/NeuroM/downloads","issues_url":"https://api.github.com/repos/BlueBrain/NeuroM/issues{/number}","pulls_url":"https://api.github.com/repos/BlueBrain/NeuroM/pulls{/number}","milestones_url":"https://api.github.com/repos/BlueBrain/NeuroM/milestones{/number}","notifications_url":"https://api.github.com/repos/BlueBrain/NeuroM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BlueBrain/NeuroM/labels{/name}","releases_url":"https://api.github.com/repos/BlueBrain/NeuroM/releases{/id}","created_at":"2015-05-01T14:21:43Z","updated_at":"2015-10-09T22:02:31Z","pushed_at":"2015-10-15T11:36:42Z","git_url":"git://github.com/BlueBrain/NeuroM.git","ssh_url":"git@github.com:BlueBrain/NeuroM.git","clone_url":"https://github.com/BlueBrain/NeuroM.git","svn_url":"https://github.com/BlueBrain/NeuroM","homepage":null,"size":2947,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/108"},"html":{"href":"https://github.com/BlueBrain/NeuroM/pull/108"},"issue":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/issues/108"},"comments":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/issues/108/comments"},"review_comments":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/108/comments"},"review_comment":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/108/commits"},"statuses":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/statuses/8ba6e75cba1ceda770baa53f75184865a52478e5"}}}}