{"action":"created","issue":{"url":"https://api.github.com/repos/astroplanners/astroplan/issues/26","labels_url":"https://api.github.com/repos/astroplanners/astroplan/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/astroplanners/astroplan/issues/26/comments","events_url":"https://api.github.com/repos/astroplanners/astroplan/issues/26/events","html_url":"https://github.com/astroplanners/astroplan/pull/26","id":95259179,"number":26,"title":"Sites","user":{"login":"bmorris3","id":3497584,"avatar_url":"https://avatars.githubusercontent.com/u/3497584?v=3","gravatar_id":"","url":"https://api.github.com/users/bmorris3","html_url":"https://github.com/bmorris3","followers_url":"https://api.github.com/users/bmorris3/followers","following_url":"https://api.github.com/users/bmorris3/following{/other_user}","gists_url":"https://api.github.com/users/bmorris3/gists{/gist_id}","starred_url":"https://api.github.com/users/bmorris3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmorris3/subscriptions","organizations_url":"https://api.github.com/users/bmorris3/orgs","repos_url":"https://api.github.com/users/bmorris3/repos","events_url":"https://api.github.com/users/bmorris3/events{/privacy}","received_events_url":"https://api.github.com/users/bmorris3/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/astroplanners/astroplan/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/astroplanners/astroplan/labels/final-review","name":"final-review","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"eteq","id":346587,"avatar_url":"https://avatars.githubusercontent.com/u/346587?v=3","gravatar_id":"","url":"https://api.github.com/users/eteq","html_url":"https://github.com/eteq","followers_url":"https://api.github.com/users/eteq/followers","following_url":"https://api.github.com/users/eteq/following{/other_user}","gists_url":"https://api.github.com/users/eteq/gists{/gist_id}","starred_url":"https://api.github.com/users/eteq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eteq/subscriptions","organizations_url":"https://api.github.com/users/eteq/orgs","repos_url":"https://api.github.com/users/eteq/repos","events_url":"https://api.github.com/users/eteq/events{/privacy}","received_events_url":"https://api.github.com/users/eteq/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/astroplanners/astroplan/milestones/1","html_url":"https://github.com/astroplanners/astroplan/milestones/0.1%20release","labels_url":"https://api.github.com/repos/astroplanners/astroplan/milestones/1/labels","id":1087263,"number":1,"title":"0.1 release","description":"First release","creator":{"login":"cdeil","id":852409,"avatar_url":"https://avatars.githubusercontent.com/u/852409?v=3","gravatar_id":"","url":"https://api.github.com/users/cdeil","html_url":"https://github.com/cdeil","followers_url":"https://api.github.com/users/cdeil/followers","following_url":"https://api.github.com/users/cdeil/following{/other_user}","gists_url":"https://api.github.com/users/cdeil/gists{/gist_id}","starred_url":"https://api.github.com/users/cdeil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdeil/subscriptions","organizations_url":"https://api.github.com/users/cdeil/orgs","repos_url":"https://api.github.com/users/cdeil/repos","events_url":"https://api.github.com/users/cdeil/events{/privacy}","received_events_url":"https://api.github.com/users/cdeil/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":8,"state":"open","created_at":"2015-04-28T11:35:13Z","updated_at":"2015-07-22T19:03:27Z","due_on":"2015-08-09T22:00:00Z","closed_at":null},"comments":23,"created_at":"2015-07-15T18:24:24Z","updated_at":"2015-07-23T16:51:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/astroplanners/astroplan/pulls/26","html_url":"https://github.com/astroplanners/astroplan/pull/26","diff_url":"https://github.com/astroplanners/astroplan/pull/26.diff","patch_url":"https://github.com/astroplanners/astroplan/pull/26.patch"},"body":"I've implemented here a simple site importing tool, as the basis for discussion amongst @astroplanners/astroplanners-contributors on what we want our site tool to look like. A user can get an `EarthLocation` object for known observatories with the following syntax: \r\n```python\r\n>>> from astroplan import get_site, Observer\r\n>>> keck = get_site('Keck')\r\n>>> obs = Observer(location=keck)\r\n>>> print(keck.to_geodetic())\r\n(<Longitude -155.47833333333332 deg>, <Latitude 19.828333333333326 deg>, \r\n <Quantity 4160.000000000752 m>)\r\n```\r\nThere are several aliases for each observatory, and if the queried name is not recognized, a `KeyError` is raised with an informative error message that suggests fuzzy matches (using `difflib`, thanks @adrn!). For example, searching for `'keck obs'` raises the following error:\r\n\r\n```python\r\nIn [1]: import astroplan; astroplan.get_site(str('keck obs'))\r\n---------------------------------------------------------------------------\r\nKeyError                                  Traceback (most recent call last)\r\n<ipython-input-1-7986be699dec> in <module>()\r\n----> 1 import astroplan; astroplan.get_site(str('keck obs'))\r\n\r\nastroplan/astroplan/core.py in get_site(site_name)\r\n    126             errmsg = ('Site not in database. `use get_site_names()` to see '\r\n    127                       'available sites.')\r\n--> 128         raise KeyError(errmsg)\r\n    129 \r\n    130     return _site_db[site_name.lower()]\r\n\r\nKeyError: u\"Site not in database. `use get_site_names()` to see available sites. \r\nDid you mean: 'keck observatory', 'keck'?\"\r\n```"},"comment":{"url":"https://api.github.com/repos/astroplanners/astroplan/issues/comments/124165792","html_url":"https://github.com/astroplanners/astroplan/pull/26#issuecomment-124165792","issue_url":"https://api.github.com/repos/astroplanners/astroplan/issues/26","id":124165792,"user":{"login":"bmorris3","id":3497584,"avatar_url":"https://avatars.githubusercontent.com/u/3497584?v=3","gravatar_id":"","url":"https://api.github.com/users/bmorris3","html_url":"https://github.com/bmorris3","followers_url":"https://api.github.com/users/bmorris3/followers","following_url":"https://api.github.com/users/bmorris3/following{/other_user}","gists_url":"https://api.github.com/users/bmorris3/gists{/gist_id}","starred_url":"https://api.github.com/users/bmorris3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmorris3/subscriptions","organizations_url":"https://api.github.com/users/bmorris3/orgs","repos_url":"https://api.github.com/users/bmorris3/repos","events_url":"https://api.github.com/users/bmorris3/events{/privacy}","received_events_url":"https://api.github.com/users/bmorris3/received_events","type":"User","site_admin":false},"created_at":"2015-07-23T16:51:03Z","updated_at":"2015-07-23T16:51:03Z","body":"@eteq: Rebased, passed, and good to go, methinks."}}