{"action":"created","comment":{"url":"https://api.github.com/repos/fatiando/fatiando/pulls/comments/47400547","id":47400547,"diff_hunk":"@@ -0,0 +1,83 @@\n+import numpy as np\n+from fatiando import mesher,gridder\n+from fatiando.gravmag import prism\n+from numpy.testing import assert_array_almost_equal as assert_almost\n+from nose.tools import assert_raises\n+from nose.tools import assert_equal\n+\n+def test_fails_if_bad_pad_operation():\n+    'gridder.pad_array fails if given a bad padding array operation option'\n+    p = 'foo'\n+    s = (100,100)\n+    x,y,z = gridder.regular((-1000.,1000.,-1000.,1000.),s,z=-150)\n+    g = z.reshape(s)\n+    assert_raises(ValueError,gridder.pad_array,g,padtype=p)\n+\n+def test_pad_and_unpad_equal_2d():\n+    'gridder.pad_array and subsequent .unpad_array gives original array: 2D'\n+    s = (100,101)\n+    x,y,z = gridder.regular((-5000.,5000.,-5000.,5000.),s,z=-150)\n+    model = [mesher.Prism(-4000,-3000,-4000,-3000,0,2000,{'density':1000}),\n+        mesher.Prism(-1000,1000,-1000,1000,0,2000,{'density':-900}),\n+        mesher.Prism(2000,4000,3000,4000,0,2000,{'density':1300})]\n+    gz = prism.gz(x,y,z,model)\n+    gz = gz.reshape(s)","path":"test/test_gridder_padarray.py","position":24,"original_position":24,"commit_id":"6d161e9058d0b00b4457ee8e0c717e0542cf84f3","original_commit_id":"6d161e9058d0b00b4457ee8e0c717e0542cf84f3","user":{"login":"drandykass","id":15897239,"avatar_url":"https://avatars.githubusercontent.com/u/15897239?v=3","gravatar_id":"","url":"https://api.github.com/users/drandykass","html_url":"https://github.com/drandykass","followers_url":"https://api.github.com/users/drandykass/followers","following_url":"https://api.github.com/users/drandykass/following{/other_user}","gists_url":"https://api.github.com/users/drandykass/gists{/gist_id}","starred_url":"https://api.github.com/users/drandykass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drandykass/subscriptions","organizations_url":"https://api.github.com/users/drandykass/orgs","repos_url":"https://api.github.com/users/drandykass/repos","events_url":"https://api.github.com/users/drandykass/events{/privacy}","received_events_url":"https://api.github.com/users/drandykass/received_events","type":"User","site_admin":false},"body":"Do you have objection to using the Rosenbrock function as an example?","created_at":"2015-12-11T20:21:50Z","updated_at":"2015-12-11T20:21:50Z","html_url":"https://github.com/fatiando/fatiando/pull/239#discussion_r47400547","pull_request_url":"https://api.github.com/repos/fatiando/fatiando/pulls/239","_links":{"self":{"href":"https://api.github.com/repos/fatiando/fatiando/pulls/comments/47400547"},"html":{"href":"https://github.com/fatiando/fatiando/pull/239#discussion_r47400547"},"pull_request":{"href":"https://api.github.com/repos/fatiando/fatiando/pulls/239"}}},"pull_request":{"url":"https://api.github.com/repos/fatiando/fatiando/pulls/239","id":52465932,"html_url":"https://github.com/fatiando/fatiando/pull/239","diff_url":"https://github.com/fatiando/fatiando/pull/239.diff","patch_url":"https://github.com/fatiando/fatiando/pull/239.patch","issue_url":"https://api.github.com/repos/fatiando/fatiando/issues/239","number":239,"state":"open","locked":false,"title":"Pad arrays","user":{"login":"drandykass","id":15897239,"avatar_url":"https://avatars.githubusercontent.com/u/15897239?v=3","gravatar_id":"","url":"https://api.github.com/users/drandykass","html_url":"https://github.com/drandykass","followers_url":"https://api.github.com/users/drandykass/followers","following_url":"https://api.github.com/users/drandykass/following{/other_user}","gists_url":"https://api.github.com/users/drandykass/gists{/gist_id}","starred_url":"https://api.github.com/users/drandykass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drandykass/subscriptions","organizations_url":"https://api.github.com/users/drandykass/orgs","repos_url":"https://api.github.com/users/drandykass/repos","events_url":"https://api.github.com/users/drandykass/events{/privacy}","received_events_url":"https://api.github.com/users/drandykass/received_events","type":"User","site_admin":false},"body":"This is an incomplete pull request for the addition of array padding and unpadding routines to gridder.\r\n\r\nSome talking points:\r\n--The padding function expects the array to be of the same dimension as intended--that is, no 'flattened' arrays.\r\n--The unpadding function currently is set up to return unpadded coordinate vectors.  However, I think that may be completely unnecessary.\r\n--Still working on cleaning up the docs, the actual code, and need to create the test functions.\r\n\r\nUpdate 03-12-2015 (@leouieda): Added the checklist below.\r\n\r\n## Checklist:\r\n\r\n- [x] Make tests for new code\r\n- [x] Create/update docstrings\r\n- [x] Include relevant equations and citations in docstrings\r\n- [x] Code follows PEP8 style conventions\r\n- [x] Code and docs have been spellchecked\r\n- [x] Include new dependencies in docs, requirements.txt, README, and .travis.yml\r\n- [x] Documentation builds properly\r\n- [x] All tests pass\r\n- [x] Can be merged\r\n- [ ] Changelog entry (leave for last)\r\n- [x] Firt-time contributor? Add yourself to `doc/contributors.rst` (leave for last)\r\n","created_at":"2015-12-02T22:45:05Z","updated_at":"2015-12-11T20:21:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9a6ba6e881963a3f1c78dac34ff46b122c523c0","assignee":{"login":"leouieda","id":290082,"avatar_url":"https://avatars.githubusercontent.com/u/290082?v=3","gravatar_id":"","url":"https://api.github.com/users/leouieda","html_url":"https://github.com/leouieda","followers_url":"https://api.github.com/users/leouieda/followers","following_url":"https://api.github.com/users/leouieda/following{/other_user}","gists_url":"https://api.github.com/users/leouieda/gists{/gist_id}","starred_url":"https://api.github.com/users/leouieda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leouieda/subscriptions","organizations_url":"https://api.github.com/users/leouieda/orgs","repos_url":"https://api.github.com/users/leouieda/repos","events_url":"https://api.github.com/users/leouieda/events{/privacy}","received_events_url":"https://api.github.com/users/leouieda/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/fatiando/fatiando/milestones/5","html_url":"https://github.com/fatiando/fatiando/milestones/0.5","labels_url":"https://api.github.com/repos/fatiando/fatiando/milestones/5/labels","id":1058824,"number":5,"title":"0.5","description":"","creator":{"login":"leouieda","id":290082,"avatar_url":"https://avatars.githubusercontent.com/u/290082?v=3","gravatar_id":"","url":"https://api.github.com/users/leouieda","html_url":"https://github.com/leouieda","followers_url":"https://api.github.com/users/leouieda/followers","following_url":"https://api.github.com/users/leouieda/following{/other_user}","gists_url":"https://api.github.com/users/leouieda/gists{/gist_id}","starred_url":"https://api.github.com/users/leouieda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leouieda/subscriptions","organizations_url":"https://api.github.com/users/leouieda/orgs","repos_url":"https://api.github.com/users/leouieda/repos","events_url":"https://api.github.com/users/leouieda/events{/privacy}","received_events_url":"https://api.github.com/users/leouieda/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":2,"state":"open","created_at":"2015-04-08T17:49:16Z","updated_at":"2015-12-11T12:15:08Z","due_on":"2016-07-01T03:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/fatiando/fatiando/pulls/239/commits","review_comments_url":"https://api.github.com/repos/fatiando/fatiando/pulls/239/comments","review_comment_url":"https://api.github.com/repos/fatiando/fatiando/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fatiando/fatiando/issues/239/comments","statuses_url":"https://api.github.com/repos/fatiando/fatiando/statuses/6d161e9058d0b00b4457ee8e0c717e0542cf84f3","head":{"label":"drandykass:pad_arrays","ref":"pad_arrays","sha":"6d161e9058d0b00b4457ee8e0c717e0542cf84f3","user":{"login":"drandykass","id":15897239,"avatar_url":"https://avatars.githubusercontent.com/u/15897239?v=3","gravatar_id":"","url":"https://api.github.com/users/drandykass","html_url":"https://github.com/drandykass","followers_url":"https://api.github.com/users/drandykass/followers","following_url":"https://api.github.com/users/drandykass/following{/other_user}","gists_url":"https://api.github.com/users/drandykass/gists{/gist_id}","starred_url":"https://api.github.com/users/drandykass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drandykass/subscriptions","organizations_url":"https://api.github.com/users/drandykass/orgs","repos_url":"https://api.github.com/users/drandykass/repos","events_url":"https://api.github.com/users/drandykass/events{/privacy}","received_events_url":"https://api.github.com/users/drandykass/received_events","type":"User","site_admin":false},"repo":{"id":46436425,"name":"fatiando","full_name":"drandykass/fatiando","owner":{"login":"drandykass","id":15897239,"avatar_url":"https://avatars.githubusercontent.com/u/15897239?v=3","gravatar_id":"","url":"https://api.github.com/users/drandykass","html_url":"https://github.com/drandykass","followers_url":"https://api.github.com/users/drandykass/followers","following_url":"https://api.github.com/users/drandykass/following{/other_user}","gists_url":"https://api.github.com/users/drandykass/gists{/gist_id}","starred_url":"https://api.github.com/users/drandykass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drandykass/subscriptions","organizations_url":"https://api.github.com/users/drandykass/orgs","repos_url":"https://api.github.com/users/drandykass/repos","events_url":"https://api.github.com/users/drandykass/events{/privacy}","received_events_url":"https://api.github.com/users/drandykass/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/drandykass/fatiando","description":"Python toolkit for modeling and inversion in geophysics","fork":true,"url":"https://api.github.com/repos/drandykass/fatiando","forks_url":"https://api.github.com/repos/drandykass/fatiando/forks","keys_url":"https://api.github.com/repos/drandykass/fatiando/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drandykass/fatiando/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drandykass/fatiando/teams","hooks_url":"https://api.github.com/repos/drandykass/fatiando/hooks","issue_events_url":"https://api.github.com/repos/drandykass/fatiando/issues/events{/number}","events_url":"https://api.github.com/repos/drandykass/fatiando/events","assignees_url":"https://api.github.com/repos/drandykass/fatiando/assignees{/user}","branches_url":"https://api.github.com/repos/drandykass/fatiando/branches{/branch}","tags_url":"https://api.github.com/repos/drandykass/fatiando/tags","blobs_url":"https://api.github.com/repos/drandykass/fatiando/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drandykass/fatiando/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drandykass/fatiando/git/refs{/sha}","trees_url":"https://api.github.com/repos/drandykass/fatiando/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drandykass/fatiando/statuses/{sha}","languages_url":"https://api.github.com/repos/drandykass/fatiando/languages","stargazers_url":"https://api.github.com/repos/drandykass/fatiando/stargazers","contributors_url":"https://api.github.com/repos/drandykass/fatiando/contributors","subscribers_url":"https://api.github.com/repos/drandykass/fatiando/subscribers","subscription_url":"https://api.github.com/repos/drandykass/fatiando/subscription","commits_url":"https://api.github.com/repos/drandykass/fatiando/commits{/sha}","git_commits_url":"https://api.github.com/repos/drandykass/fatiando/git/commits{/sha}","comments_url":"https://api.github.com/repos/drandykass/fatiando/comments{/number}","issue_comment_url":"https://api.github.com/repos/drandykass/fatiando/issues/comments{/number}","contents_url":"https://api.github.com/repos/drandykass/fatiando/contents/{+path}","compare_url":"https://api.github.com/repos/drandykass/fatiando/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drandykass/fatiando/merges","archive_url":"https://api.github.com/repos/drandykass/fatiando/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drandykass/fatiando/downloads","issues_url":"https://api.github.com/repos/drandykass/fatiando/issues{/number}","pulls_url":"https://api.github.com/repos/drandykass/fatiando/pulls{/number}","milestones_url":"https://api.github.com/repos/drandykass/fatiando/milestones{/number}","notifications_url":"https://api.github.com/repos/drandykass/fatiando/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drandykass/fatiando/labels{/name}","releases_url":"https://api.github.com/repos/drandykass/fatiando/releases{/id}","created_at":"2015-11-18T17:45:19Z","updated_at":"2015-11-18T17:45:21Z","pushed_at":"2015-12-04T15:31:48Z","git_url":"git://github.com/drandykass/fatiando.git","ssh_url":"git@github.com:drandykass/fatiando.git","clone_url":"https://github.com/drandykass/fatiando.git","svn_url":"https://github.com/drandykass/fatiando","homepage":"http://www.fatiando.org","size":15838,"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":"fatiando:master","ref":"master","sha":"1ea9fc2280c8ce682d46b1b1ef8af2acf098af2f","user":{"login":"fatiando","id":8174113,"avatar_url":"https://avatars.githubusercontent.com/u/8174113?v=3","gravatar_id":"","url":"https://api.github.com/users/fatiando","html_url":"https://github.com/fatiando","followers_url":"https://api.github.com/users/fatiando/followers","following_url":"https://api.github.com/users/fatiando/following{/other_user}","gists_url":"https://api.github.com/users/fatiando/gists{/gist_id}","starred_url":"https://api.github.com/users/fatiando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fatiando/subscriptions","organizations_url":"https://api.github.com/users/fatiando/orgs","repos_url":"https://api.github.com/users/fatiando/repos","events_url":"https://api.github.com/users/fatiando/events{/privacy}","received_events_url":"https://api.github.com/users/fatiando/received_events","type":"Organization","site_admin":false},"repo":{"id":7919054,"name":"fatiando","full_name":"fatiando/fatiando","owner":{"login":"fatiando","id":8174113,"avatar_url":"https://avatars.githubusercontent.com/u/8174113?v=3","gravatar_id":"","url":"https://api.github.com/users/fatiando","html_url":"https://github.com/fatiando","followers_url":"https://api.github.com/users/fatiando/followers","following_url":"https://api.github.com/users/fatiando/following{/other_user}","gists_url":"https://api.github.com/users/fatiando/gists{/gist_id}","starred_url":"https://api.github.com/users/fatiando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fatiando/subscriptions","organizations_url":"https://api.github.com/users/fatiando/orgs","repos_url":"https://api.github.com/users/fatiando/repos","events_url":"https://api.github.com/users/fatiando/events{/privacy}","received_events_url":"https://api.github.com/users/fatiando/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fatiando/fatiando","description":"Python toolkit for modeling and inversion in geophysics","fork":false,"url":"https://api.github.com/repos/fatiando/fatiando","forks_url":"https://api.github.com/repos/fatiando/fatiando/forks","keys_url":"https://api.github.com/repos/fatiando/fatiando/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fatiando/fatiando/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fatiando/fatiando/teams","hooks_url":"https://api.github.com/repos/fatiando/fatiando/hooks","issue_events_url":"https://api.github.com/repos/fatiando/fatiando/issues/events{/number}","events_url":"https://api.github.com/repos/fatiando/fatiando/events","assignees_url":"https://api.github.com/repos/fatiando/fatiando/assignees{/user}","branches_url":"https://api.github.com/repos/fatiando/fatiando/branches{/branch}","tags_url":"https://api.github.com/repos/fatiando/fatiando/tags","blobs_url":"https://api.github.com/repos/fatiando/fatiando/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fatiando/fatiando/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fatiando/fatiando/git/refs{/sha}","trees_url":"https://api.github.com/repos/fatiando/fatiando/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fatiando/fatiando/statuses/{sha}","languages_url":"https://api.github.com/repos/fatiando/fatiando/languages","stargazers_url":"https://api.github.com/repos/fatiando/fatiando/stargazers","contributors_url":"https://api.github.com/repos/fatiando/fatiando/contributors","subscribers_url":"https://api.github.com/repos/fatiando/fatiando/subscribers","subscription_url":"https://api.github.com/repos/fatiando/fatiando/subscription","commits_url":"https://api.github.com/repos/fatiando/fatiando/commits{/sha}","git_commits_url":"https://api.github.com/repos/fatiando/fatiando/git/commits{/sha}","comments_url":"https://api.github.com/repos/fatiando/fatiando/comments{/number}","issue_comment_url":"https://api.github.com/repos/fatiando/fatiando/issues/comments{/number}","contents_url":"https://api.github.com/repos/fatiando/fatiando/contents/{+path}","compare_url":"https://api.github.com/repos/fatiando/fatiando/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fatiando/fatiando/merges","archive_url":"https://api.github.com/repos/fatiando/fatiando/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fatiando/fatiando/downloads","issues_url":"https://api.github.com/repos/fatiando/fatiando/issues{/number}","pulls_url":"https://api.github.com/repos/fatiando/fatiando/pulls{/number}","milestones_url":"https://api.github.com/repos/fatiando/fatiando/milestones{/number}","notifications_url":"https://api.github.com/repos/fatiando/fatiando/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fatiando/fatiando/labels{/name}","releases_url":"https://api.github.com/repos/fatiando/fatiando/releases{/id}","created_at":"2013-01-30T16:57:15Z","updated_at":"2015-12-11T12:14:10Z","pushed_at":"2015-12-11T15:41:11Z","git_url":"git://github.com/fatiando/fatiando.git","ssh_url":"git@github.com:fatiando/fatiando.git","clone_url":"https://github.com/fatiando/fatiando.git","svn_url":"https://github.com/fatiando/fatiando","homepage":"http://www.fatiando.org","size":175904,"stargazers_count":43,"watchers_count":43,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":89,"forks":35,"open_issues":89,"watchers":43,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fatiando/fatiando/pulls/239"},"html":{"href":"https://github.com/fatiando/fatiando/pull/239"},"issue":{"href":"https://api.github.com/repos/fatiando/fatiando/issues/239"},"comments":{"href":"https://api.github.com/repos/fatiando/fatiando/issues/239/comments"},"review_comments":{"href":"https://api.github.com/repos/fatiando/fatiando/pulls/239/comments"},"review_comment":{"href":"https://api.github.com/repos/fatiando/fatiando/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fatiando/fatiando/pulls/239/commits"},"statuses":{"href":"https://api.github.com/repos/fatiando/fatiando/statuses/6d161e9058d0b00b4457ee8e0c717e0542cf84f3"}}}}