{"action":"created","comment":{"url":"https://api.github.com/repos/desihub/desisurvey/pulls/comments/36125262","id":36125262,"diff_hunk":"@@ -241,6 +241,11 @@ def get_next_field(dateobs, skylevel, seeing, transparency, previoustiles,\n     #- Trim tiles_array to those within 15 degrees of the meridian\n     igood = np.where( (last-15 <= tiles_array['RA']) & (tiles_array['RA'] <= last+15) )[0]\n     tiles_array = tiles_array[igood]\n+    \n+    #- Remove previously observed tiles\n+    obs = np.in1d( tiles_array['TILEID'], previoustiles )\n+    inotobs = np.where(obs == False)\n+    tiles_array = tiles_array[inotobs]","path":"py/desisurvey/nextfield.py","position":8,"original_position":8,"commit_id":"fc84903c87897c3cc42824242ba1be378bc878f7","original_commit_id":"fc84903c87897c3cc42824242ba1be378bc878f7","user":{"login":"sbailey","id":218471,"avatar_url":"https://avatars.githubusercontent.com/u/218471?v=3","gravatar_id":"","url":"https://api.github.com/users/sbailey","html_url":"https://github.com/sbailey","followers_url":"https://api.github.com/users/sbailey/followers","following_url":"https://api.github.com/users/sbailey/following{/other_user}","gists_url":"https://api.github.com/users/sbailey/gists{/gist_id}","starred_url":"https://api.github.com/users/sbailey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbailey/subscriptions","organizations_url":"https://api.github.com/users/sbailey/orgs","repos_url":"https://api.github.com/users/sbailey/repos","events_url":"https://api.github.com/users/sbailey/events{/privacy}","received_events_url":"https://api.github.com/users/sbailey/received_events","type":"User","site_admin":false},"body":"Good use of array logic instead of a loop, but consider using np.in1d(... invert=True) instead of the np.where line:\r\n\r\n    notobs = np.in1d(tiles_array['TILEID'], previoustiles, invert=True)\r\n    tiles_array = tiles_array[notobs]\r\n\r\nNote that filtering tiles_array[notobs] can accept either a boolean array (like this case) or an array of integer indices; you don't have to convert the boolean array to indices with np.where before using it to filter the array.","created_at":"2015-08-03T20:08:02Z","updated_at":"2015-08-03T20:08:02Z","html_url":"https://github.com/desihub/desisurvey/pull/3#discussion_r36125262","pull_request_url":"https://api.github.com/repos/desihub/desisurvey/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/desihub/desisurvey/pulls/comments/36125262"},"html":{"href":"https://github.com/desihub/desisurvey/pull/3#discussion_r36125262"},"pull_request":{"href":"https://api.github.com/repos/desihub/desisurvey/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/desihub/desisurvey/pulls/3","id":41499475,"html_url":"https://github.com/desihub/desisurvey/pull/3","diff_url":"https://github.com/desihub/desisurvey/pull/3.diff","patch_url":"https://github.com/desihub/desisurvey/pull/3.patch","issue_url":"https://api.github.com/repos/desihub/desisurvey/issues/3","number":3,"state":"open","locked":false,"title":"Unittest rightanswer","user":{"login":"dpearson1983","id":13033457,"avatar_url":"https://avatars.githubusercontent.com/u/13033457?v=3","gravatar_id":"","url":"https://api.github.com/users/dpearson1983","html_url":"https://github.com/dpearson1983","followers_url":"https://api.github.com/users/dpearson1983/followers","following_url":"https://api.github.com/users/dpearson1983/following{/other_user}","gists_url":"https://api.github.com/users/dpearson1983/gists{/gist_id}","starred_url":"https://api.github.com/users/dpearson1983/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpearson1983/subscriptions","organizations_url":"https://api.github.com/users/dpearson1983/orgs","repos_url":"https://api.github.com/users/dpearson1983/repos","events_url":"https://api.github.com/users/dpearson1983/events{/privacy}","received_events_url":"https://api.github.com/users/dpearson1983/received_events","type":"User","site_admin":false},"body":"Added a test to make sure changes don't affect the answer given by get_next_field. Added removal of tiles with IDs listed in previoustiles. Fixed an omission in the get_next_field call in the test_previoustiles. All tests now pass.","created_at":"2015-08-03T19:13:29Z","updated_at":"2015-08-03T20:08:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"13490e7bca3e5003585a27cf82a4caa6ae41e87e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/desihub/desisurvey/pulls/3/commits","review_comments_url":"https://api.github.com/repos/desihub/desisurvey/pulls/3/comments","review_comment_url":"https://api.github.com/repos/desihub/desisurvey/pulls/comments{/number}","comments_url":"https://api.github.com/repos/desihub/desisurvey/issues/3/comments","statuses_url":"https://api.github.com/repos/desihub/desisurvey/statuses/fc84903c87897c3cc42824242ba1be378bc878f7","head":{"label":"desihub:unittest_rightanswer","ref":"unittest_rightanswer","sha":"fc84903c87897c3cc42824242ba1be378bc878f7","user":{"login":"desihub","id":9540621,"avatar_url":"https://avatars.githubusercontent.com/u/9540621?v=3","gravatar_id":"","url":"https://api.github.com/users/desihub","html_url":"https://github.com/desihub","followers_url":"https://api.github.com/users/desihub/followers","following_url":"https://api.github.com/users/desihub/following{/other_user}","gists_url":"https://api.github.com/users/desihub/gists{/gist_id}","starred_url":"https://api.github.com/users/desihub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desihub/subscriptions","organizations_url":"https://api.github.com/users/desihub/orgs","repos_url":"https://api.github.com/users/desihub/repos","events_url":"https://api.github.com/users/desihub/events{/privacy}","received_events_url":"https://api.github.com/users/desihub/received_events","type":"Organization","site_admin":false},"repo":{"id":36086075,"name":"desisurvey","full_name":"desihub/desisurvey","owner":{"login":"desihub","id":9540621,"avatar_url":"https://avatars.githubusercontent.com/u/9540621?v=3","gravatar_id":"","url":"https://api.github.com/users/desihub","html_url":"https://github.com/desihub","followers_url":"https://api.github.com/users/desihub/followers","following_url":"https://api.github.com/users/desihub/following{/other_user}","gists_url":"https://api.github.com/users/desihub/gists{/gist_id}","starred_url":"https://api.github.com/users/desihub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desihub/subscriptions","organizations_url":"https://api.github.com/users/desihub/orgs","repos_url":"https://api.github.com/users/desihub/repos","events_url":"https://api.github.com/users/desihub/events{/privacy}","received_events_url":"https://api.github.com/users/desihub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/desihub/desisurvey","description":"Code for desi survey planning and implementation","fork":false,"url":"https://api.github.com/repos/desihub/desisurvey","forks_url":"https://api.github.com/repos/desihub/desisurvey/forks","keys_url":"https://api.github.com/repos/desihub/desisurvey/keys{/key_id}","collaborators_url":"https://api.github.com/repos/desihub/desisurvey/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/desihub/desisurvey/teams","hooks_url":"https://api.github.com/repos/desihub/desisurvey/hooks","issue_events_url":"https://api.github.com/repos/desihub/desisurvey/issues/events{/number}","events_url":"https://api.github.com/repos/desihub/desisurvey/events","assignees_url":"https://api.github.com/repos/desihub/desisurvey/assignees{/user}","branches_url":"https://api.github.com/repos/desihub/desisurvey/branches{/branch}","tags_url":"https://api.github.com/repos/desihub/desisurvey/tags","blobs_url":"https://api.github.com/repos/desihub/desisurvey/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/desihub/desisurvey/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/desihub/desisurvey/git/refs{/sha}","trees_url":"https://api.github.com/repos/desihub/desisurvey/git/trees{/sha}","statuses_url":"https://api.github.com/repos/desihub/desisurvey/statuses/{sha}","languages_url":"https://api.github.com/repos/desihub/desisurvey/languages","stargazers_url":"https://api.github.com/repos/desihub/desisurvey/stargazers","contributors_url":"https://api.github.com/repos/desihub/desisurvey/contributors","subscribers_url":"https://api.github.com/repos/desihub/desisurvey/subscribers","subscription_url":"https://api.github.com/repos/desihub/desisurvey/subscription","commits_url":"https://api.github.com/repos/desihub/desisurvey/commits{/sha}","git_commits_url":"https://api.github.com/repos/desihub/desisurvey/git/commits{/sha}","comments_url":"https://api.github.com/repos/desihub/desisurvey/comments{/number}","issue_comment_url":"https://api.github.com/repos/desihub/desisurvey/issues/comments{/number}","contents_url":"https://api.github.com/repos/desihub/desisurvey/contents/{+path}","compare_url":"https://api.github.com/repos/desihub/desisurvey/compare/{base}...{head}","merges_url":"https://api.github.com/repos/desihub/desisurvey/merges","archive_url":"https://api.github.com/repos/desihub/desisurvey/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/desihub/desisurvey/downloads","issues_url":"https://api.github.com/repos/desihub/desisurvey/issues{/number}","pulls_url":"https://api.github.com/repos/desihub/desisurvey/pulls{/number}","milestones_url":"https://api.github.com/repos/desihub/desisurvey/milestones{/number}","notifications_url":"https://api.github.com/repos/desihub/desisurvey/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/desihub/desisurvey/labels{/name}","releases_url":"https://api.github.com/repos/desihub/desisurvey/releases{/id}","created_at":"2015-05-22T17:32:10Z","updated_at":"2015-07-22T10:04:08Z","pushed_at":"2015-08-03T19:26:32Z","git_url":"git://github.com/desihub/desisurvey.git","ssh_url":"git@github.com:desihub/desisurvey.git","clone_url":"https://github.com/desihub/desisurvey.git","svn_url":"https://github.com/desihub/desisurvey","homepage":null,"size":220,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"desihub:master","ref":"master","sha":"1003ae3565806f15090b6ab686fe8f8e1da2872a","user":{"login":"desihub","id":9540621,"avatar_url":"https://avatars.githubusercontent.com/u/9540621?v=3","gravatar_id":"","url":"https://api.github.com/users/desihub","html_url":"https://github.com/desihub","followers_url":"https://api.github.com/users/desihub/followers","following_url":"https://api.github.com/users/desihub/following{/other_user}","gists_url":"https://api.github.com/users/desihub/gists{/gist_id}","starred_url":"https://api.github.com/users/desihub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desihub/subscriptions","organizations_url":"https://api.github.com/users/desihub/orgs","repos_url":"https://api.github.com/users/desihub/repos","events_url":"https://api.github.com/users/desihub/events{/privacy}","received_events_url":"https://api.github.com/users/desihub/received_events","type":"Organization","site_admin":false},"repo":{"id":36086075,"name":"desisurvey","full_name":"desihub/desisurvey","owner":{"login":"desihub","id":9540621,"avatar_url":"https://avatars.githubusercontent.com/u/9540621?v=3","gravatar_id":"","url":"https://api.github.com/users/desihub","html_url":"https://github.com/desihub","followers_url":"https://api.github.com/users/desihub/followers","following_url":"https://api.github.com/users/desihub/following{/other_user}","gists_url":"https://api.github.com/users/desihub/gists{/gist_id}","starred_url":"https://api.github.com/users/desihub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desihub/subscriptions","organizations_url":"https://api.github.com/users/desihub/orgs","repos_url":"https://api.github.com/users/desihub/repos","events_url":"https://api.github.com/users/desihub/events{/privacy}","received_events_url":"https://api.github.com/users/desihub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/desihub/desisurvey","description":"Code for desi survey planning and implementation","fork":false,"url":"https://api.github.com/repos/desihub/desisurvey","forks_url":"https://api.github.com/repos/desihub/desisurvey/forks","keys_url":"https://api.github.com/repos/desihub/desisurvey/keys{/key_id}","collaborators_url":"https://api.github.com/repos/desihub/desisurvey/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/desihub/desisurvey/teams","hooks_url":"https://api.github.com/repos/desihub/desisurvey/hooks","issue_events_url":"https://api.github.com/repos/desihub/desisurvey/issues/events{/number}","events_url":"https://api.github.com/repos/desihub/desisurvey/events","assignees_url":"https://api.github.com/repos/desihub/desisurvey/assignees{/user}","branches_url":"https://api.github.com/repos/desihub/desisurvey/branches{/branch}","tags_url":"https://api.github.com/repos/desihub/desisurvey/tags","blobs_url":"https://api.github.com/repos/desihub/desisurvey/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/desihub/desisurvey/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/desihub/desisurvey/git/refs{/sha}","trees_url":"https://api.github.com/repos/desihub/desisurvey/git/trees{/sha}","statuses_url":"https://api.github.com/repos/desihub/desisurvey/statuses/{sha}","languages_url":"https://api.github.com/repos/desihub/desisurvey/languages","stargazers_url":"https://api.github.com/repos/desihub/desisurvey/stargazers","contributors_url":"https://api.github.com/repos/desihub/desisurvey/contributors","subscribers_url":"https://api.github.com/repos/desihub/desisurvey/subscribers","subscription_url":"https://api.github.com/repos/desihub/desisurvey/subscription","commits_url":"https://api.github.com/repos/desihub/desisurvey/commits{/sha}","git_commits_url":"https://api.github.com/repos/desihub/desisurvey/git/commits{/sha}","comments_url":"https://api.github.com/repos/desihub/desisurvey/comments{/number}","issue_comment_url":"https://api.github.com/repos/desihub/desisurvey/issues/comments{/number}","contents_url":"https://api.github.com/repos/desihub/desisurvey/contents/{+path}","compare_url":"https://api.github.com/repos/desihub/desisurvey/compare/{base}...{head}","merges_url":"https://api.github.com/repos/desihub/desisurvey/merges","archive_url":"https://api.github.com/repos/desihub/desisurvey/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/desihub/desisurvey/downloads","issues_url":"https://api.github.com/repos/desihub/desisurvey/issues{/number}","pulls_url":"https://api.github.com/repos/desihub/desisurvey/pulls{/number}","milestones_url":"https://api.github.com/repos/desihub/desisurvey/milestones{/number}","notifications_url":"https://api.github.com/repos/desihub/desisurvey/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/desihub/desisurvey/labels{/name}","releases_url":"https://api.github.com/repos/desihub/desisurvey/releases{/id}","created_at":"2015-05-22T17:32:10Z","updated_at":"2015-07-22T10:04:08Z","pushed_at":"2015-08-03T19:26:32Z","git_url":"git://github.com/desihub/desisurvey.git","ssh_url":"git@github.com:desihub/desisurvey.git","clone_url":"https://github.com/desihub/desisurvey.git","svn_url":"https://github.com/desihub/desisurvey","homepage":null,"size":220,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/desihub/desisurvey/pulls/3"},"html":{"href":"https://github.com/desihub/desisurvey/pull/3"},"issue":{"href":"https://api.github.com/repos/desihub/desisurvey/issues/3"},"comments":{"href":"https://api.github.com/repos/desihub/desisurvey/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/desihub/desisurvey/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/desihub/desisurvey/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/desihub/desisurvey/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/desihub/desisurvey/statuses/fc84903c87897c3cc42824242ba1be378bc878f7"}}}}