Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geocoding location lookup #4

Merged
merged 24 commits into from
Aug 3, 2018
Merged

Geocoding location lookup #4

merged 24 commits into from
Aug 3, 2018

Commits on Aug 1, 2018

  1. Geocoding

    I've made it so that we can look up locations and fetch the closest station.
    This adds a dependency of `geopy`.
    This ignores several edge cases. Namely, it assumes a flat earth with rectangular coordinates corresponding to the latitude and longitude. I am assuming these edge cases will not be noticeable.
    
    Expected behavior:
    ```
    user: !noaa tide 8722588
    scubot: <a listing for station #8722588>
    
    user: !noaa tide 32.8548228,-79.9614
    hxtk committed Aug 1, 2018
    Configuration menu
    Copy the full SHA
    1958bd3 View commit details
    Browse the repository at this point in the history
  2. Fix coordinates regex

    I improved the regular expression for matching latitude/longitude coordinate pairs to remove an edge case where they were separated by only a comma and no space.
    
    To continue the expected behavior listing on the previous commit:
    
    ```
    user: !noaa tide 8722588
    scubot: <listing for station #8722588>
    
    user: !noaa tide "33.6926725,-78.8841985"
    scubot: <listing for station #8661000, Myrtle Beach, SC>
    
    user: !noaa tide "Myrtle Beach, SC"
    scubot: <listing for station #8661000, Myrtle Beach, SC>
    ```
    hxtk committed Aug 1, 2018
    Configuration menu
    Copy the full SHA
    e23bd35 View commit details
    Browse the repository at this point in the history
  3. Bump minor version

    hxtk committed Aug 1, 2018
    Configuration menu
    Copy the full SHA
    34a27fc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    658b559 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    eba1fe9 View commit details
    Browse the repository at this point in the history
  6. Add fetching from cache

    the-emerald committed Aug 1, 2018
    Configuration menu
    Copy the full SHA
    ea6f24f View commit details
    Browse the repository at this point in the history
  7. Fix minor issues

    the-emerald committed Aug 1, 2018
    Configuration menu
    Copy the full SHA
    2ab27c4 View commit details
    Browse the repository at this point in the history
  8. Add scraping script

    the-emerald committed Aug 1, 2018
    Configuration menu
    Copy the full SHA
    2e3e738 View commit details
    Browse the repository at this point in the history
  9. Remove erroneous self reference

    Static methods decorated with `@staticmethod` aren't attached to a class instance and therefore aren't (and indeed can't be) passed a reference to `self`
    hxtk committed Aug 1, 2018
    Configuration menu
    Copy the full SHA
    ef2457f View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2018

  1. Configuration menu
    Copy the full SHA
    e2a3df1 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2018

  1. Initial fetch from NOAA instead of geocoding API

    I've found the NOAA website's listing for the latitude and longitude of their stations. This removes a great deal of strain from the geocoding API, which is good because our initial fetch was extremely taxing on the geocoder.
    
    It will still be necessary to merge this branch with the branch that has database caching, as NOAA's response times result in the globe taking several hours to initialize.
    hxtk committed Aug 3, 2018
    Configuration menu
    Copy the full SHA
    37306db View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1 from suclearnub/master

    Adding basic station caching
    hxtk committed Aug 3, 2018
    Configuration menu
    Copy the full SHA
    a77cd8e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fb1b095 View commit details
    Browse the repository at this point in the history
  4. Merge pull request #2 from hxtk/hxtk-scraped-geocoding

    Geocoding from NOAA instead of nominatim
    hxtk committed Aug 3, 2018
    Configuration menu
    Copy the full SHA
    0e304d3 View commit details
    Browse the repository at this point in the history
  5. Dependency injection of TinyDB

    hxtk committed Aug 3, 2018
    Configuration menu
    Copy the full SHA
    ba876de View commit details
    Browse the repository at this point in the history
  6. Dependency Injection of database

    The object structure prior to this change did not make it easy to isolate the `StationGlobe` class, whether for testing or prefetching the database cache. I have separated it using dependency injection patterns.
    
    NOTE: This breaks the initialization on L150. Waiting for @suclearnub to provide more information on the NOAA.module_db object scope to fix that
    hxtk committed Aug 3, 2018
    Configuration menu
    Copy the full SHA
    96ac94d View commit details
    Browse the repository at this point in the history
  7. Dependency injection initialization

    Fix initialization of the updated `StationGlobe` object from the previous commit.
    Also I've moved the work into a method to eliminate import side effects.
    hxtk committed Aug 3, 2018
    Configuration menu
    Copy the full SHA
    401063a View commit details
    Browse the repository at this point in the history
  8. Merge pull request #3 from hxtk/database-dependency-injection

    Dependency Injection of database
    hxtk committed Aug 3, 2018
    Configuration menu
    Copy the full SHA
    a7c57ca View commit details
    Browse the repository at this point in the history
  9. minor text fixes

    hxtk committed Aug 3, 2018
    Configuration menu
    Copy the full SHA
    34c4817 View commit details
    Browse the repository at this point in the history
  10. Fix caching

    TinyDB was incompatible with the `Station` object so I created serialization methods to convert between it and a standard Python dictionary.
    hxtk committed Aug 3, 2018
    Configuration menu
    Copy the full SHA
    e8af027 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    d9c5acb View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    ff9ed80 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    4fcfd06 View commit details
    Browse the repository at this point in the history
  14. Fix scraper and search

    Scraper was parsing latitude and longitude incorrectly.
    Search always returned the last station, regardless of which one was closest.
    
    Both of those issues have been resolved in this commit.
    hxtk committed Aug 3, 2018
    Configuration menu
    Copy the full SHA
    ec9d505 View commit details
    Browse the repository at this point in the history