{"action":"created","comment":{"url":"https://api.github.com/repos/CartoDB/crankshaft/pulls/comments/57800643","id":57800643,"diff_hunk":"@@ -11,7 +11,52 @@\n \n # High level interface ---------------------------------------\n \n-def moran_local(subquery, attr, significance, num_ngbrs, permutations, geom_column, id_col, w_type):\n+def moran(subquery, attr_name, permutations, geom_col, id_col, w_type, num_ngbrs):\n+    \"\"\"\n+    Moran's I (global)\n+    Implementation building neighors with a PostGIS database and Moran's I core clusters with PySAL.\n+    Andy Eschbacher\n+    \"\"\"\n+    qvals = {\"id_col\": id_col,\n+             \"attr1\": attr_name,\n+             \"geom_col\": geom_col,\n+             \"subquery\": subquery,\n+             \"num_ngbrs\": num_ngbrs}\n+\n+    q = get_query(w_type, qvals)","path":"src/py/crankshaft/crankshaft/clustering/moran.py","position":17,"original_position":17,"commit_id":"06f5cf9951719ad413e22a3a3e924360ff180046","original_commit_id":"06f5cf9951719ad413e22a3a3e924360ff180046","user":{"login":"stuartlynn","id":209838,"avatar_url":"https://avatars.githubusercontent.com/u/209838?v=3","gravatar_id":"","url":"https://api.github.com/users/stuartlynn","html_url":"https://github.com/stuartlynn","followers_url":"https://api.github.com/users/stuartlynn/followers","following_url":"https://api.github.com/users/stuartlynn/following{/other_user}","gists_url":"https://api.github.com/users/stuartlynn/gists{/gist_id}","starred_url":"https://api.github.com/users/stuartlynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuartlynn/subscriptions","organizations_url":"https://api.github.com/users/stuartlynn/orgs","repos_url":"https://api.github.com/users/stuartlynn/repos","events_url":"https://api.github.com/users/stuartlynn/events{/privacy}","received_events_url":"https://api.github.com/users/stuartlynn/received_events","type":"User","site_admin":false},"body":"Or construct_neighbor_weights perhaps if thats what get_query is doing?","created_at":"2016-03-29T21:06:19Z","updated_at":"2016-03-29T21:06:19Z","html_url":"https://github.com/CartoDB/crankshaft/pull/19#discussion_r57800643","pull_request_url":"https://api.github.com/repos/CartoDB/crankshaft/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/CartoDB/crankshaft/pulls/comments/57800643"},"html":{"href":"https://github.com/CartoDB/crankshaft/pull/19#discussion_r57800643"},"pull_request":{"href":"https://api.github.com/repos/CartoDB/crankshaft/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/CartoDB/crankshaft/pulls/19","id":63731290,"html_url":"https://github.com/CartoDB/crankshaft/pull/19","diff_url":"https://github.com/CartoDB/crankshaft/pull/19.diff","patch_url":"https://github.com/CartoDB/crankshaft/pull/19.patch","issue_url":"https://api.github.com/repos/CartoDB/crankshaft/issues/19","number":19,"state":"open","locked":false,"title":"Restructure moran redux","user":{"login":"ohasselblad","id":1041056,"avatar_url":"https://avatars.githubusercontent.com/u/1041056?v=3","gravatar_id":"","url":"https://api.github.com/users/ohasselblad","html_url":"https://github.com/ohasselblad","followers_url":"https://api.github.com/users/ohasselblad/followers","following_url":"https://api.github.com/users/ohasselblad/following{/other_user}","gists_url":"https://api.github.com/users/ohasselblad/gists{/gist_id}","starred_url":"https://api.github.com/users/ohasselblad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ohasselblad/subscriptions","organizations_url":"https://api.github.com/users/ohasselblad/orgs","repos_url":"https://api.github.com/users/ohasselblad/repos","events_url":"https://api.github.com/users/ohasselblad/events{/privacy}","received_events_url":"https://api.github.com/users/ohasselblad/received_events","type":"User","site_admin":false},"body":"Restructure clustering functions to remove significance\r\n\r\nCR @stuartlynn, please","created_at":"2016-03-22T14:43:56Z","updated_at":"2016-03-29T21:06:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"46b95a4b96edb927a5db3e01d504dccc12fee01d","assignee":{"login":"stuartlynn","id":209838,"avatar_url":"https://avatars.githubusercontent.com/u/209838?v=3","gravatar_id":"","url":"https://api.github.com/users/stuartlynn","html_url":"https://github.com/stuartlynn","followers_url":"https://api.github.com/users/stuartlynn/followers","following_url":"https://api.github.com/users/stuartlynn/following{/other_user}","gists_url":"https://api.github.com/users/stuartlynn/gists{/gist_id}","starred_url":"https://api.github.com/users/stuartlynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuartlynn/subscriptions","organizations_url":"https://api.github.com/users/stuartlynn/orgs","repos_url":"https://api.github.com/users/stuartlynn/repos","events_url":"https://api.github.com/users/stuartlynn/events{/privacy}","received_events_url":"https://api.github.com/users/stuartlynn/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/CartoDB/crankshaft/pulls/19/commits","review_comments_url":"https://api.github.com/repos/CartoDB/crankshaft/pulls/19/comments","review_comment_url":"https://api.github.com/repos/CartoDB/crankshaft/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CartoDB/crankshaft/issues/19/comments","statuses_url":"https://api.github.com/repos/CartoDB/crankshaft/statuses/06f5cf9951719ad413e22a3a3e924360ff180046","head":{"label":"CartoDB:restructure-moran-redux","ref":"restructure-moran-redux","sha":"06f5cf9951719ad413e22a3a3e924360ff180046","user":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"repo":{"id":51753449,"name":"crankshaft","full_name":"CartoDB/crankshaft","owner":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CartoDB/crankshaft","description":"","fork":false,"url":"https://api.github.com/repos/CartoDB/crankshaft","forks_url":"https://api.github.com/repos/CartoDB/crankshaft/forks","keys_url":"https://api.github.com/repos/CartoDB/crankshaft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CartoDB/crankshaft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CartoDB/crankshaft/teams","hooks_url":"https://api.github.com/repos/CartoDB/crankshaft/hooks","issue_events_url":"https://api.github.com/repos/CartoDB/crankshaft/issues/events{/number}","events_url":"https://api.github.com/repos/CartoDB/crankshaft/events","assignees_url":"https://api.github.com/repos/CartoDB/crankshaft/assignees{/user}","branches_url":"https://api.github.com/repos/CartoDB/crankshaft/branches{/branch}","tags_url":"https://api.github.com/repos/CartoDB/crankshaft/tags","blobs_url":"https://api.github.com/repos/CartoDB/crankshaft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CartoDB/crankshaft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CartoDB/crankshaft/git/refs{/sha}","trees_url":"https://api.github.com/repos/CartoDB/crankshaft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CartoDB/crankshaft/statuses/{sha}","languages_url":"https://api.github.com/repos/CartoDB/crankshaft/languages","stargazers_url":"https://api.github.com/repos/CartoDB/crankshaft/stargazers","contributors_url":"https://api.github.com/repos/CartoDB/crankshaft/contributors","subscribers_url":"https://api.github.com/repos/CartoDB/crankshaft/subscribers","subscription_url":"https://api.github.com/repos/CartoDB/crankshaft/subscription","commits_url":"https://api.github.com/repos/CartoDB/crankshaft/commits{/sha}","git_commits_url":"https://api.github.com/repos/CartoDB/crankshaft/git/commits{/sha}","comments_url":"https://api.github.com/repos/CartoDB/crankshaft/comments{/number}","issue_comment_url":"https://api.github.com/repos/CartoDB/crankshaft/issues/comments{/number}","contents_url":"https://api.github.com/repos/CartoDB/crankshaft/contents/{+path}","compare_url":"https://api.github.com/repos/CartoDB/crankshaft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CartoDB/crankshaft/merges","archive_url":"https://api.github.com/repos/CartoDB/crankshaft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CartoDB/crankshaft/downloads","issues_url":"https://api.github.com/repos/CartoDB/crankshaft/issues{/number}","pulls_url":"https://api.github.com/repos/CartoDB/crankshaft/pulls{/number}","milestones_url":"https://api.github.com/repos/CartoDB/crankshaft/milestones{/number}","notifications_url":"https://api.github.com/repos/CartoDB/crankshaft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CartoDB/crankshaft/labels{/name}","releases_url":"https://api.github.com/repos/CartoDB/crankshaft/releases{/id}","deployments_url":"https://api.github.com/repos/CartoDB/crankshaft/deployments","created_at":"2016-02-15T12:16:51Z","updated_at":"2016-03-16T10:15:53Z","pushed_at":"2016-03-29T19:34:39Z","git_url":"git://github.com/CartoDB/crankshaft.git","ssh_url":"git@github.com:CartoDB/crankshaft.git","clone_url":"https://github.com/CartoDB/crankshaft.git","svn_url":"https://github.com/CartoDB/crankshaft","homepage":null,"size":173,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":16,"forks":1,"open_issues":16,"watchers":1,"default_branch":"develop"}},"base":{"label":"CartoDB:develop","ref":"develop","sha":"8762f6ca1c244da06fe24cef946bbcac10ddde94","user":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"repo":{"id":51753449,"name":"crankshaft","full_name":"CartoDB/crankshaft","owner":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CartoDB/crankshaft","description":"","fork":false,"url":"https://api.github.com/repos/CartoDB/crankshaft","forks_url":"https://api.github.com/repos/CartoDB/crankshaft/forks","keys_url":"https://api.github.com/repos/CartoDB/crankshaft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CartoDB/crankshaft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CartoDB/crankshaft/teams","hooks_url":"https://api.github.com/repos/CartoDB/crankshaft/hooks","issue_events_url":"https://api.github.com/repos/CartoDB/crankshaft/issues/events{/number}","events_url":"https://api.github.com/repos/CartoDB/crankshaft/events","assignees_url":"https://api.github.com/repos/CartoDB/crankshaft/assignees{/user}","branches_url":"https://api.github.com/repos/CartoDB/crankshaft/branches{/branch}","tags_url":"https://api.github.com/repos/CartoDB/crankshaft/tags","blobs_url":"https://api.github.com/repos/CartoDB/crankshaft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CartoDB/crankshaft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CartoDB/crankshaft/git/refs{/sha}","trees_url":"https://api.github.com/repos/CartoDB/crankshaft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CartoDB/crankshaft/statuses/{sha}","languages_url":"https://api.github.com/repos/CartoDB/crankshaft/languages","stargazers_url":"https://api.github.com/repos/CartoDB/crankshaft/stargazers","contributors_url":"https://api.github.com/repos/CartoDB/crankshaft/contributors","subscribers_url":"https://api.github.com/repos/CartoDB/crankshaft/subscribers","subscription_url":"https://api.github.com/repos/CartoDB/crankshaft/subscription","commits_url":"https://api.github.com/repos/CartoDB/crankshaft/commits{/sha}","git_commits_url":"https://api.github.com/repos/CartoDB/crankshaft/git/commits{/sha}","comments_url":"https://api.github.com/repos/CartoDB/crankshaft/comments{/number}","issue_comment_url":"https://api.github.com/repos/CartoDB/crankshaft/issues/comments{/number}","contents_url":"https://api.github.com/repos/CartoDB/crankshaft/contents/{+path}","compare_url":"https://api.github.com/repos/CartoDB/crankshaft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CartoDB/crankshaft/merges","archive_url":"https://api.github.com/repos/CartoDB/crankshaft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CartoDB/crankshaft/downloads","issues_url":"https://api.github.com/repos/CartoDB/crankshaft/issues{/number}","pulls_url":"https://api.github.com/repos/CartoDB/crankshaft/pulls{/number}","milestones_url":"https://api.github.com/repos/CartoDB/crankshaft/milestones{/number}","notifications_url":"https://api.github.com/repos/CartoDB/crankshaft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CartoDB/crankshaft/labels{/name}","releases_url":"https://api.github.com/repos/CartoDB/crankshaft/releases{/id}","deployments_url":"https://api.github.com/repos/CartoDB/crankshaft/deployments","created_at":"2016-02-15T12:16:51Z","updated_at":"2016-03-16T10:15:53Z","pushed_at":"2016-03-29T19:34:39Z","git_url":"git://github.com/CartoDB/crankshaft.git","ssh_url":"git@github.com:CartoDB/crankshaft.git","clone_url":"https://github.com/CartoDB/crankshaft.git","svn_url":"https://github.com/CartoDB/crankshaft","homepage":null,"size":173,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":16,"forks":1,"open_issues":16,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CartoDB/crankshaft/pulls/19"},"html":{"href":"https://github.com/CartoDB/crankshaft/pull/19"},"issue":{"href":"https://api.github.com/repos/CartoDB/crankshaft/issues/19"},"comments":{"href":"https://api.github.com/repos/CartoDB/crankshaft/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/CartoDB/crankshaft/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/CartoDB/crankshaft/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CartoDB/crankshaft/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/CartoDB/crankshaft/statuses/06f5cf9951719ad413e22a3a3e924360ff180046"}}}}