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
Avoid attempt to parse reservoir metadata page for gages without this data
Testing Goals
Successfully return available metadata for LGR gage
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)
Steps
Testing Goals
Breaking Changes
None
Priority
Low