{"action":"created","comment":{"url":"https://api.github.com/repos/UT-CHG/BET/pulls/comments/27980249","id":27980249,"diff_hunk":"@@ -124,20 +127,28 @@ def prob(samples, data, rho_D_M, d_distr_samples, lam_domain, d_Tree=None):\n         a pointer from emulated samples to samples (in parameter space)\n \n     \"\"\"\n+    if len(samples.shape) == 1:\n+        samples = np.expand_dims(samples, axis=1) \n+    if len(data.shape) == 1:\n+        data = np.expand_dims(data, axis=1) \n+\n     # Calculate pointers and volumes\n     (P, _, io_ptr, emulate_ptr) = prob_emulated(samples, data,\n             rho_D_M, d_distr_samples, lam_domain, None, d_Tree)\n     \n     # Apply the standard MC approximation \n-    lam_vol = np.ones((samples.shape[0],))\n+    lam_vol = np.ones((samples.shape[0],1))\n     # Calculate Probabilities\n     P = np.zeros((samples.shape[0],))\n+    # TODO Fix issue of unecessary mpi call\n+\n     for i in range(rho_D_M.shape[0]):\n         Itemp = np.equal(io_ptr, i)\n         Itemp_sum = np.sum(lam_vol[Itemp])\n         Itemp_sum = comm.allreduce(Itemp_sum, op=MPI.SUM)\n         if Itemp_sum > 0:\n             P[Itemp] = rho_D_M[i]*lam_vol[Itemp]/Itemp_sum \n+    lam_vol = (1.0/float(samples.shape[0]))*np.ones((samples.shape[0],1))","path":"bet/calculateP/calculateP.py","position":38,"original_position":38,"commit_id":"7a7f604a09cbcae830c5363f7cb01a0fa48883ed","original_commit_id":"7a7f604a09cbcae830c5363f7cb01a0fa48883ed","user":{"login":"lcgraham","id":3008749,"avatar_url":"https://avatars.githubusercontent.com/u/3008749?v=3","gravatar_id":"","url":"https://api.github.com/users/lcgraham","html_url":"https://github.com/lcgraham","followers_url":"https://api.github.com/users/lcgraham/followers","following_url":"https://api.github.com/users/lcgraham/following{/other_user}","gists_url":"https://api.github.com/users/lcgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/lcgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcgraham/subscriptions","organizations_url":"https://api.github.com/users/lcgraham/orgs","repos_url":"https://api.github.com/users/lcgraham/repos","events_url":"https://api.github.com/users/lcgraham/events{/privacy}","received_events_url":"https://api.github.com/users/lcgraham/received_events","type":"User","site_admin":false},"body":"Same comment about shape. Also as long as one number in the calculation is a float all of the numbers should be floats so I don't think you need to cast samples.shape[0] as float.","created_at":"2015-04-08T15:23:04Z","updated_at":"2015-04-08T15:23:04Z","html_url":"https://github.com/UT-CHG/BET/pull/40#discussion_r27980249","pull_request_url":"https://api.github.com/repos/UT-CHG/BET/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/UT-CHG/BET/pulls/comments/27980249"},"html":{"href":"https://github.com/UT-CHG/BET/pull/40#discussion_r27980249"},"pull_request":{"href":"https://api.github.com/repos/UT-CHG/BET/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/UT-CHG/BET/pulls/40","id":32829705,"html_url":"https://github.com/UT-CHG/BET/pull/40","diff_url":"https://github.com/UT-CHG/BET/pull/40.diff","patch_url":"https://github.com/UT-CHG/BET/pull/40.patch","issue_url":"https://api.github.com/repos/UT-CHG/BET/issues/40","number":40,"state":"open","locked":false,"title":"Adds tests and minor changes to audit branch","user":{"login":"smattis","id":997385,"avatar_url":"https://avatars.githubusercontent.com/u/997385?v=3","gravatar_id":"","url":"https://api.github.com/users/smattis","html_url":"https://github.com/smattis","followers_url":"https://api.github.com/users/smattis/followers","following_url":"https://api.github.com/users/smattis/following{/other_user}","gists_url":"https://api.github.com/users/smattis/gists{/gist_id}","starred_url":"https://api.github.com/users/smattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smattis/subscriptions","organizations_url":"https://api.github.com/users/smattis/orgs","repos_url":"https://api.github.com/users/smattis/repos","events_url":"https://api.github.com/users/smattis/events{/privacy}","received_events_url":"https://api.github.com/users/smattis/received_events","type":"User","site_admin":false},"body":"Tests for calculateP, postTools, and plotP are added along with minor changes to other files.","created_at":"2015-04-08T05:30:51Z","updated_at":"2015-04-08T15:23:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea992754a2689bf0b98a7eddfe503a187d26ba30","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/UT-CHG/BET/pulls/40/commits","review_comments_url":"https://api.github.com/repos/UT-CHG/BET/pulls/40/comments","review_comment_url":"https://api.github.com/repos/UT-CHG/BET/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UT-CHG/BET/issues/40/comments","statuses_url":"https://api.github.com/repos/UT-CHG/BET/statuses/7a7f604a09cbcae830c5363f7cb01a0fa48883ed","head":{"label":"smattis:audit","ref":"audit","sha":"7a7f604a09cbcae830c5363f7cb01a0fa48883ed","user":{"login":"smattis","id":997385,"avatar_url":"https://avatars.githubusercontent.com/u/997385?v=3","gravatar_id":"","url":"https://api.github.com/users/smattis","html_url":"https://github.com/smattis","followers_url":"https://api.github.com/users/smattis/followers","following_url":"https://api.github.com/users/smattis/following{/other_user}","gists_url":"https://api.github.com/users/smattis/gists{/gist_id}","starred_url":"https://api.github.com/users/smattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smattis/subscriptions","organizations_url":"https://api.github.com/users/smattis/orgs","repos_url":"https://api.github.com/users/smattis/repos","events_url":"https://api.github.com/users/smattis/events{/privacy}","received_events_url":"https://api.github.com/users/smattis/received_events","type":"User","site_admin":false},"repo":{"id":31750830,"name":"BET-1","full_name":"smattis/BET-1","owner":{"login":"smattis","id":997385,"avatar_url":"https://avatars.githubusercontent.com/u/997385?v=3","gravatar_id":"","url":"https://api.github.com/users/smattis","html_url":"https://github.com/smattis","followers_url":"https://api.github.com/users/smattis/followers","following_url":"https://api.github.com/users/smattis/following{/other_user}","gists_url":"https://api.github.com/users/smattis/gists{/gist_id}","starred_url":"https://api.github.com/users/smattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smattis/subscriptions","organizations_url":"https://api.github.com/users/smattis/orgs","repos_url":"https://api.github.com/users/smattis/repos","events_url":"https://api.github.com/users/smattis/events{/privacy}","received_events_url":"https://api.github.com/users/smattis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smattis/BET-1","description":"Butler, Estep, Tavener Method - A python based package for measure-theoretic stochastic inverse and forward problems.","fork":true,"url":"https://api.github.com/repos/smattis/BET-1","forks_url":"https://api.github.com/repos/smattis/BET-1/forks","keys_url":"https://api.github.com/repos/smattis/BET-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smattis/BET-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smattis/BET-1/teams","hooks_url":"https://api.github.com/repos/smattis/BET-1/hooks","issue_events_url":"https://api.github.com/repos/smattis/BET-1/issues/events{/number}","events_url":"https://api.github.com/repos/smattis/BET-1/events","assignees_url":"https://api.github.com/repos/smattis/BET-1/assignees{/user}","branches_url":"https://api.github.com/repos/smattis/BET-1/branches{/branch}","tags_url":"https://api.github.com/repos/smattis/BET-1/tags","blobs_url":"https://api.github.com/repos/smattis/BET-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smattis/BET-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smattis/BET-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/smattis/BET-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smattis/BET-1/statuses/{sha}","languages_url":"https://api.github.com/repos/smattis/BET-1/languages","stargazers_url":"https://api.github.com/repos/smattis/BET-1/stargazers","contributors_url":"https://api.github.com/repos/smattis/BET-1/contributors","subscribers_url":"https://api.github.com/repos/smattis/BET-1/subscribers","subscription_url":"https://api.github.com/repos/smattis/BET-1/subscription","commits_url":"https://api.github.com/repos/smattis/BET-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/smattis/BET-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/smattis/BET-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/smattis/BET-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/smattis/BET-1/contents/{+path}","compare_url":"https://api.github.com/repos/smattis/BET-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smattis/BET-1/merges","archive_url":"https://api.github.com/repos/smattis/BET-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smattis/BET-1/downloads","issues_url":"https://api.github.com/repos/smattis/BET-1/issues{/number}","pulls_url":"https://api.github.com/repos/smattis/BET-1/pulls{/number}","milestones_url":"https://api.github.com/repos/smattis/BET-1/milestones{/number}","notifications_url":"https://api.github.com/repos/smattis/BET-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smattis/BET-1/labels{/name}","releases_url":"https://api.github.com/repos/smattis/BET-1/releases{/id}","created_at":"2015-03-06T03:31:06Z","updated_at":"2015-04-06T17:05:23Z","pushed_at":"2015-04-08T05:23:39Z","git_url":"git://github.com/smattis/BET-1.git","ssh_url":"git@github.com:smattis/BET-1.git","clone_url":"https://github.com/smattis/BET-1.git","svn_url":"https://github.com/smattis/BET-1","homepage":"http://ut-chg.github.io/BET","size":1021,"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":"UT-CHG:audit","ref":"audit","sha":"2371a557d57df886eeee059a9bafaab2c6a4ce14","user":{"login":"UT-CHG","id":8753973,"avatar_url":"https://avatars.githubusercontent.com/u/8753973?v=3","gravatar_id":"","url":"https://api.github.com/users/UT-CHG","html_url":"https://github.com/UT-CHG","followers_url":"https://api.github.com/users/UT-CHG/followers","following_url":"https://api.github.com/users/UT-CHG/following{/other_user}","gists_url":"https://api.github.com/users/UT-CHG/gists{/gist_id}","starred_url":"https://api.github.com/users/UT-CHG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UT-CHG/subscriptions","organizations_url":"https://api.github.com/users/UT-CHG/orgs","repos_url":"https://api.github.com/users/UT-CHG/repos","events_url":"https://api.github.com/users/UT-CHG/events{/privacy}","received_events_url":"https://api.github.com/users/UT-CHG/received_events","type":"Organization","site_admin":false},"repo":{"id":18813599,"name":"BET","full_name":"UT-CHG/BET","owner":{"login":"UT-CHG","id":8753973,"avatar_url":"https://avatars.githubusercontent.com/u/8753973?v=3","gravatar_id":"","url":"https://api.github.com/users/UT-CHG","html_url":"https://github.com/UT-CHG","followers_url":"https://api.github.com/users/UT-CHG/followers","following_url":"https://api.github.com/users/UT-CHG/following{/other_user}","gists_url":"https://api.github.com/users/UT-CHG/gists{/gist_id}","starred_url":"https://api.github.com/users/UT-CHG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UT-CHG/subscriptions","organizations_url":"https://api.github.com/users/UT-CHG/orgs","repos_url":"https://api.github.com/users/UT-CHG/repos","events_url":"https://api.github.com/users/UT-CHG/events{/privacy}","received_events_url":"https://api.github.com/users/UT-CHG/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UT-CHG/BET","description":"Butler, Estep, Tavener Method - A python based package for measure-theoretic stochastic inverse and forward problems.","fork":false,"url":"https://api.github.com/repos/UT-CHG/BET","forks_url":"https://api.github.com/repos/UT-CHG/BET/forks","keys_url":"https://api.github.com/repos/UT-CHG/BET/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UT-CHG/BET/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UT-CHG/BET/teams","hooks_url":"https://api.github.com/repos/UT-CHG/BET/hooks","issue_events_url":"https://api.github.com/repos/UT-CHG/BET/issues/events{/number}","events_url":"https://api.github.com/repos/UT-CHG/BET/events","assignees_url":"https://api.github.com/repos/UT-CHG/BET/assignees{/user}","branches_url":"https://api.github.com/repos/UT-CHG/BET/branches{/branch}","tags_url":"https://api.github.com/repos/UT-CHG/BET/tags","blobs_url":"https://api.github.com/repos/UT-CHG/BET/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UT-CHG/BET/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UT-CHG/BET/git/refs{/sha}","trees_url":"https://api.github.com/repos/UT-CHG/BET/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UT-CHG/BET/statuses/{sha}","languages_url":"https://api.github.com/repos/UT-CHG/BET/languages","stargazers_url":"https://api.github.com/repos/UT-CHG/BET/stargazers","contributors_url":"https://api.github.com/repos/UT-CHG/BET/contributors","subscribers_url":"https://api.github.com/repos/UT-CHG/BET/subscribers","subscription_url":"https://api.github.com/repos/UT-CHG/BET/subscription","commits_url":"https://api.github.com/repos/UT-CHG/BET/commits{/sha}","git_commits_url":"https://api.github.com/repos/UT-CHG/BET/git/commits{/sha}","comments_url":"https://api.github.com/repos/UT-CHG/BET/comments{/number}","issue_comment_url":"https://api.github.com/repos/UT-CHG/BET/issues/comments{/number}","contents_url":"https://api.github.com/repos/UT-CHG/BET/contents/{+path}","compare_url":"https://api.github.com/repos/UT-CHG/BET/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UT-CHG/BET/merges","archive_url":"https://api.github.com/repos/UT-CHG/BET/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UT-CHG/BET/downloads","issues_url":"https://api.github.com/repos/UT-CHG/BET/issues{/number}","pulls_url":"https://api.github.com/repos/UT-CHG/BET/pulls{/number}","milestones_url":"https://api.github.com/repos/UT-CHG/BET/milestones{/number}","notifications_url":"https://api.github.com/repos/UT-CHG/BET/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UT-CHG/BET/labels{/name}","releases_url":"https://api.github.com/repos/UT-CHG/BET/releases{/id}","created_at":"2014-04-15T19:51:31Z","updated_at":"2015-04-01T00:35:16Z","pushed_at":"2015-04-08T05:30:51Z","git_url":"git://github.com/UT-CHG/BET.git","ssh_url":"git@github.com:UT-CHG/BET.git","clone_url":"https://github.com/UT-CHG/BET.git","svn_url":"https://github.com/UT-CHG/BET","homepage":"http://ut-chg.github.io/BET","size":1909,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":9,"forks":3,"open_issues":9,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UT-CHG/BET/pulls/40"},"html":{"href":"https://github.com/UT-CHG/BET/pull/40"},"issue":{"href":"https://api.github.com/repos/UT-CHG/BET/issues/40"},"comments":{"href":"https://api.github.com/repos/UT-CHG/BET/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/UT-CHG/BET/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/UT-CHG/BET/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UT-CHG/BET/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/UT-CHG/BET/statuses/7a7f604a09cbcae830c5363f7cb01a0fa48883ed"}}}}