jaredwo / obsio

obsio is a Python package that provides a consistent generic interface for accessing weather and climate observations from multiple different data providers.
GNU General Public License v3.0
17 stars 7 forks source link

pandas updates and updated error catching #5

Open dschneiderch opened 3 years ago

dschneiderch commented 3 years ago

Hi Jared, I guess you aren't really working on this anymore but it's a shame because as you know most hydrologists don't have the skills to create this sorely needed tool! a couple fixes for nrcs downloader that are mostly updates to pandas

  1. pd.sortlevel() is now pd.sort_index()
  2. pd datetime won't accept the unicode coming from suds so I used repr() to get the string representation where needed. maybe there is a better way?

at least the suds error is resolved in v1.4.x so closes #3

this resolves the issues I was having downloading station metadata. Running the example in the README isn't working due to a missing ghcn files and I couldn't download the data from nrcs with read_obs() (it was returning an empty df, no error)

dschneiderch commented 3 years ago

The last commit fixes the example in teh README. Instead of catching an OSERROR I changed it to a FileNotFoundError - based on the string your were searching for I think thats what you were doing. if the file didn't exist catch the error and download it. I don't know if any other errors are likely there besides filenotfound

closes #2