{"action":"created","comment":{"url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/pulls/comments/75597222","id":75597222,"diff_hunk":"@@ -309,129 +245,127 @@ def search_overseer_thread(args, new_location_queue, pause_bit, encryption_lib_p\n                 except Empty:\n                     pass\n \n-            # if we are only scanning for pokestops/gyms, then increase step radius to visibility range\n-            if args.no_pokemon:\n-                step_distance = 0.9\n-            else:\n-                step_distance = 0.07\n-\n-            log.info('Scan Distance is %.2f km', step_distance)\n-\n-            # update our list of coords\n-            locations = list(generate_location_steps(current_location, args.step_limit, step_distance))\n-\n-            # repopulate our spawn points\n-            if args.spawnpoints_only:\n-                # We need to get all spawnpoints in range. This is a square 70m * step_limit * 2\n-                sp_dist = 0.07 * 2 * args.step_limit\n-                log.debug('Spawnpoint search radius: %f', sp_dist)\n-                # generate coords of the midpoints of each edge of the square\n-                south, west = get_new_coords(current_location, sp_dist, 180), get_new_coords(current_location, sp_dist, 270)\n-                north, east = get_new_coords(current_location, sp_dist, 0), get_new_coords(current_location, sp_dist, 90)\n-                # Use the midpoints to arrive at the corners\n-                log.debug('Searching for spawnpoints between %f, %f and %f, %f', south[0], west[1], north[0], east[1])\n-                spawnpoints = set((d['latitude'], d['longitude']) for d in Pokemon.get_spawnpoints(south[0], west[1], north[0], east[1]))\n-                if len(spawnpoints) == 0:\n-                    log.warning('No spawnpoints found in the specified area! (Did you forget to run a normal scan in this area first?)')\n-\n-                def any_spawnpoints_in_range(coords):\n-                    return any(geopy.distance.distance(coords, x).meters <= 70 for x in spawnpoints)\n+        # If there are no search_items_queue either the loop has finished (or been\n+        # cleared above) -- either way, time to fill it back up\n+        if search_items_queue.empty():\n+            log.debug('Search queue empty, restarting loop')\n \n-                locations = [coords for coords in locations if any_spawnpoints_in_range(coords)]\n+            # locations = [((lat, lng, alt), ts_appears, ts_leaves),...]\n+            if method == 'hex':\n+                locations = get_hex_location_list(args, current_location)\n+            else:\n+                locations = get_sps_location_list(args, current_location)\n \n             if len(locations) == 0:\n                 log.warning('Nothing to scan!')\n \n-        # If there are no search_items_queue either the loop has finished (or been\n-        # cleared above) -- either way, time to fill it back up\n-        if search_items_queue.empty():\n-            log.debug('Search queue empty, restarting loop')\n+            threadStatus['Overseer']['message'] = 'Queuing steps'\n             for step, step_location in enumerate(locations, 1):","path":"pogom/search.py","position":308,"original_position":308,"commit_id":"9f5426df16aaeaf798d5ba3fff90a2ba444c32d3","original_commit_id":"9f5426df16aaeaf798d5ba3fff90a2ba444c32d3","user":{"login":"justsomedudeonthenet","id":20652372,"avatar_url":"https://avatars.githubusercontent.com/u/20652372?v=3","gravatar_id":"","url":"https://api.github.com/users/justsomedudeonthenet","html_url":"https://github.com/justsomedudeonthenet","followers_url":"https://api.github.com/users/justsomedudeonthenet/followers","following_url":"https://api.github.com/users/justsomedudeonthenet/following{/other_user}","gists_url":"https://api.github.com/users/justsomedudeonthenet/gists{/gist_id}","starred_url":"https://api.github.com/users/justsomedudeonthenet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justsomedudeonthenet/subscriptions","organizations_url":"https://api.github.com/users/justsomedudeonthenet/orgs","repos_url":"https://api.github.com/users/justsomedudeonthenet/repos","events_url":"https://api.github.com/users/justsomedudeonthenet/events{/privacy}","received_events_url":"https://api.github.com/users/justsomedudeonthenet/received_events","type":"User","site_admin":false},"body":"Dumping all the spawnpoints into the queue at once will make it harder to see if your workers are keeping up, since you can't just look for Queue = 0.  I don't know what the best way to address that would be though.","created_at":"2016-08-21T15:45:14Z","updated_at":"2016-08-21T15:45:14Z","html_url":"https://github.com/PokemonGoMap/PokemonGo-Map/pull/901#discussion_r75597222","pull_request_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/pulls/901","_links":{"self":{"href":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/pulls/comments/75597222"},"html":{"href":"https://github.com/PokemonGoMap/PokemonGo-Map/pull/901#discussion_r75597222"},"pull_request":{"href":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/pulls/901"}}},"pull_request":{"url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/pulls/901","id":82097299,"html_url":"https://github.com/PokemonGoMap/PokemonGo-Map/pull/901","diff_url":"https://github.com/PokemonGoMap/PokemonGo-Map/pull/901.diff","patch_url":"https://github.com/PokemonGoMap/PokemonGo-Map/pull/901.patch","issue_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/issues/901","number":901,"state":"open","locked":false,"title":"Search Refactor","user":{"login":"chuyskywalker","id":131800,"avatar_url":"https://avatars.githubusercontent.com/u/131800?v=3","gravatar_id":"","url":"https://api.github.com/users/chuyskywalker","html_url":"https://github.com/chuyskywalker","followers_url":"https://api.github.com/users/chuyskywalker/followers","following_url":"https://api.github.com/users/chuyskywalker/following{/other_user}","gists_url":"https://api.github.com/users/chuyskywalker/gists{/gist_id}","starred_url":"https://api.github.com/users/chuyskywalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuyskywalker/subscriptions","organizations_url":"https://api.github.com/users/chuyskywalker/orgs","repos_url":"https://api.github.com/users/chuyskywalker/repos","events_url":"https://api.github.com/users/chuyskywalker/events{/privacy}","received_events_url":"https://api.github.com/users/chuyskywalker/received_events","type":"User","site_admin":false},"body":"Ok. So.\r\n\r\n- `search.py` has a boat load of duplication in it\r\n- The two search modes are incongruent with one another (one populates the queue in a go, the other hold the loop open) which leads to...\r\n- The two search modes have different feature sets (for example, sps doesn't support pausing)\r\n- Sleep timers are a confused mess\r\n- The spawn point search code is woefully under documented (in-line)\r\n- There is a lot of \"magic\" geolocation manipulation code present\r\n\r\nI've spent a bucket load of time here to produce...\r\n\r\n- The pairs of overseer and worker search methods have been merged\r\n- The method for looping through points has been aligned in both cases\r\n- SPS mode now supports pausing and location changes correctly\r\n- The logic behind spawnpoint scanning has been better documented inline and explained\r\n- `scan_delay` now works in a more expected manner: after a thread finishes _everything_, it will sleep for the exact number of seconds set\r\n- Cleaned up the `-ps` display a bit (much prettys)\r\n- Removed a lot of the custom _(copy/pasted?)_ geolocation coordinate code and replaced it with geopy instead (much better, way easier to read)\r\n- Moving some methods to more sensible files (transform.py got a few new neighbors)\r\n\r\nThis is a pretty big refactor, but to keep feature set in parity, it's needed. Adding SPS was really good, but to keep the app sane, we need to address the **massive** tech debt it incurred to just shove it in.","created_at":"2016-08-21T05:19:38Z","updated_at":"2016-08-21T15:45:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d67514d4fcf6b7b5d603ccdeb8280bfca498964","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/pulls/901/commits","review_comments_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/pulls/901/comments","review_comment_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/issues/901/comments","statuses_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/statuses/9f5426df16aaeaf798d5ba3fff90a2ba444c32d3","head":{"label":"PokemonGoMap:drying","ref":"drying","sha":"9f5426df16aaeaf798d5ba3fff90a2ba444c32d3","user":{"login":"PokemonGoMap","id":20848202,"avatar_url":"https://avatars.githubusercontent.com/u/20848202?v=3","gravatar_id":"","url":"https://api.github.com/users/PokemonGoMap","html_url":"https://github.com/PokemonGoMap","followers_url":"https://api.github.com/users/PokemonGoMap/followers","following_url":"https://api.github.com/users/PokemonGoMap/following{/other_user}","gists_url":"https://api.github.com/users/PokemonGoMap/gists{/gist_id}","starred_url":"https://api.github.com/users/PokemonGoMap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PokemonGoMap/subscriptions","organizations_url":"https://api.github.com/users/PokemonGoMap/orgs","repos_url":"https://api.github.com/users/PokemonGoMap/repos","events_url":"https://api.github.com/users/PokemonGoMap/events{/privacy}","received_events_url":"https://api.github.com/users/PokemonGoMap/received_events","type":"Organization","site_admin":false},"repo":{"id":64970925,"name":"PokemonGo-Map","full_name":"PokemonGoMap/PokemonGo-Map","owner":{"login":"PokemonGoMap","id":20848202,"avatar_url":"https://avatars.githubusercontent.com/u/20848202?v=3","gravatar_id":"","url":"https://api.github.com/users/PokemonGoMap","html_url":"https://github.com/PokemonGoMap","followers_url":"https://api.github.com/users/PokemonGoMap/followers","following_url":"https://api.github.com/users/PokemonGoMap/following{/other_user}","gists_url":"https://api.github.com/users/PokemonGoMap/gists{/gist_id}","starred_url":"https://api.github.com/users/PokemonGoMap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PokemonGoMap/subscriptions","organizations_url":"https://api.github.com/users/PokemonGoMap/orgs","repos_url":"https://api.github.com/users/PokemonGoMap/repos","events_url":"https://api.github.com/users/PokemonGoMap/events{/privacy}","received_events_url":"https://api.github.com/users/PokemonGoMap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PokemonGoMap/PokemonGo-Map","description":"🌏 Live visualization of all the pokemon in your area... and more!","fork":false,"url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map","forks_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/forks","keys_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/teams","hooks_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/hooks","issue_events_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/issues/events{/number}","events_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/events","assignees_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/assignees{/user}","branches_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/branches{/branch}","tags_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/tags","blobs_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/git/refs{/sha}","trees_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/statuses/{sha}","languages_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/languages","stargazers_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/stargazers","contributors_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/contributors","subscribers_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/subscribers","subscription_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/subscription","commits_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/commits{/sha}","git_commits_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/git/commits{/sha}","comments_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/comments{/number}","issue_comment_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/issues/comments{/number}","contents_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/contents/{+path}","compare_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/merges","archive_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/downloads","issues_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/issues{/number}","pulls_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/pulls{/number}","milestones_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/milestones{/number}","notifications_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/labels{/name}","releases_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/releases{/id}","deployments_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/deployments","created_at":"2016-08-04T22:18:49Z","updated_at":"2016-08-21T15:17:47Z","pushed_at":"2016-08-21T14:14:13Z","git_url":"git://github.com/PokemonGoMap/PokemonGo-Map.git","ssh_url":"git@github.com:PokemonGoMap/PokemonGo-Map.git","clone_url":"https://github.com/PokemonGoMap/PokemonGo-Map.git","svn_url":"https://github.com/PokemonGoMap/PokemonGo-Map","homepage":"","size":28572,"stargazers_count":1923,"watchers_count":1923,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":977,"mirror_url":null,"open_issues_count":147,"forks":977,"open_issues":147,"watchers":1923,"default_branch":"develop"}},"base":{"label":"PokemonGoMap:develop","ref":"develop","sha":"77a44905dc3e7cf92f2de7b12b756bc654994fdd","user":{"login":"PokemonGoMap","id":20848202,"avatar_url":"https://avatars.githubusercontent.com/u/20848202?v=3","gravatar_id":"","url":"https://api.github.com/users/PokemonGoMap","html_url":"https://github.com/PokemonGoMap","followers_url":"https://api.github.com/users/PokemonGoMap/followers","following_url":"https://api.github.com/users/PokemonGoMap/following{/other_user}","gists_url":"https://api.github.com/users/PokemonGoMap/gists{/gist_id}","starred_url":"https://api.github.com/users/PokemonGoMap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PokemonGoMap/subscriptions","organizations_url":"https://api.github.com/users/PokemonGoMap/orgs","repos_url":"https://api.github.com/users/PokemonGoMap/repos","events_url":"https://api.github.com/users/PokemonGoMap/events{/privacy}","received_events_url":"https://api.github.com/users/PokemonGoMap/received_events","type":"Organization","site_admin":false},"repo":{"id":64970925,"name":"PokemonGo-Map","full_name":"PokemonGoMap/PokemonGo-Map","owner":{"login":"PokemonGoMap","id":20848202,"avatar_url":"https://avatars.githubusercontent.com/u/20848202?v=3","gravatar_id":"","url":"https://api.github.com/users/PokemonGoMap","html_url":"https://github.com/PokemonGoMap","followers_url":"https://api.github.com/users/PokemonGoMap/followers","following_url":"https://api.github.com/users/PokemonGoMap/following{/other_user}","gists_url":"https://api.github.com/users/PokemonGoMap/gists{/gist_id}","starred_url":"https://api.github.com/users/PokemonGoMap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PokemonGoMap/subscriptions","organizations_url":"https://api.github.com/users/PokemonGoMap/orgs","repos_url":"https://api.github.com/users/PokemonGoMap/repos","events_url":"https://api.github.com/users/PokemonGoMap/events{/privacy}","received_events_url":"https://api.github.com/users/PokemonGoMap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PokemonGoMap/PokemonGo-Map","description":"🌏 Live visualization of all the pokemon in your area... and more!","fork":false,"url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map","forks_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/forks","keys_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/teams","hooks_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/hooks","issue_events_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/issues/events{/number}","events_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/events","assignees_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/assignees{/user}","branches_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/branches{/branch}","tags_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/tags","blobs_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/git/refs{/sha}","trees_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/statuses/{sha}","languages_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/languages","stargazers_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/stargazers","contributors_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/contributors","subscribers_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/subscribers","subscription_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/subscription","commits_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/commits{/sha}","git_commits_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/git/commits{/sha}","comments_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/comments{/number}","issue_comment_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/issues/comments{/number}","contents_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/contents/{+path}","compare_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/merges","archive_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/downloads","issues_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/issues{/number}","pulls_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/pulls{/number}","milestones_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/milestones{/number}","notifications_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/labels{/name}","releases_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/releases{/id}","deployments_url":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/deployments","created_at":"2016-08-04T22:18:49Z","updated_at":"2016-08-21T15:17:47Z","pushed_at":"2016-08-21T14:14:13Z","git_url":"git://github.com/PokemonGoMap/PokemonGo-Map.git","ssh_url":"git@github.com:PokemonGoMap/PokemonGo-Map.git","clone_url":"https://github.com/PokemonGoMap/PokemonGo-Map.git","svn_url":"https://github.com/PokemonGoMap/PokemonGo-Map","homepage":"","size":28572,"stargazers_count":1923,"watchers_count":1923,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":977,"mirror_url":null,"open_issues_count":147,"forks":977,"open_issues":147,"watchers":1923,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/pulls/901"},"html":{"href":"https://github.com/PokemonGoMap/PokemonGo-Map/pull/901"},"issue":{"href":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/issues/901"},"comments":{"href":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/issues/901/comments"},"review_comments":{"href":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/pulls/901/comments"},"review_comment":{"href":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/pulls/901/commits"},"statuses":{"href":"https://api.github.com/repos/PokemonGoMap/PokemonGo-Map/statuses/9f5426df16aaeaf798d5ba3fff90a2ba444c32d3"}}}}
{"actor":{"display_login":"justsomedudeonthenet"}}