supermanzer / NDBC

Repository for housing Python code for fetching, parsing, and loading NDBC data into a local Python object for analysis.
MIT License
13 stars 4 forks source link

get_data() method fails when querying station SAUF1 #32

Closed supermanzer closed 3 years ago

supermanzer commented 3 years ago

A user has reported issues with using the get_data() function when querying the standard meteorological data URLs. The failure to receive a successful response leads to a long running loop of looking back through previous years, likely a result of the earlier fix applied to catch edge cases where the month or months being requested cross a year (e.g. getting most recent Nov, Dec, Jan, Feb).

Work done so far:

supermanzer commented 3 years ago

Issue appears related to station ID values that contain text characters. NDBC uses all lower case in their URLs despite using all upper case when presenting the text. This should be a simple fix, just transform whatever the user enters as station_id to a lower case string.

The looping issue is a tad more problematic. The simple answer would be to include a counter of some sort but I would rather find a solution without adding more values/variables to an already rather overloaded class. Somewhat related to #33

vanosg commented 3 years ago

Thanks for knocking this out so quickly!