MBKEngineers / collect

MBK Python scripts for scraping water data from the web
MIT License
3 stars 1 forks source link

BUG: get_reservoir_metadata('LGR') fails due to expected reservoir metadata #86

Closed narlesky closed 1 year ago

narlesky commented 1 year ago

Description

An IndexError is raised for certain gages including 'LGR' when parsing the expected reservoir metadata. CDEC system includes a link to reservoir info on the station data page: https://cdec.water.ca.gov/dynamicapp/profile?s=LGR&type=res (currently 500 error on CDEC site). If we check the web status of the URL before attempting to parse the content, we can avoid this error and ensure we are only returning valid station metadata.

Minimum Working Example (MWE)

from collect.dwr import cdec
cdec.get_reservoir_metadata('LGR')

Steps

Testing Goals

Breaking Changes

None

Priority

Low