File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
# `dataretrieval` package developed by USGS is used for the USGS stations: https://usgs-python.github.io/dataretrieval/
2
2
#
3
- # This pacakge is a thin wrapper around NWIS _REST API: https://waterservices.usgs.gov/rest/
3
+ # This package is a thin wrapper around NWIS _REST API: https://waterservices.usgs.gov/rest/
4
4
# We take the return values from `dataretrieval` to be the original data
5
5
from __future__ import annotations
6
6
22
22
import pandas as pd
23
23
import xarray as xr
24
24
from dataretrieval import nwis
25
- from dataretrieval .codes import state_codes
25
+ from dataretrieval .codes import state_codes as _DATARETRIEVAL_STATE_CODES
26
26
from dataretrieval .utils import BaseMetadata
27
27
from shapely .geometry import MultiPolygon
28
28
from shapely .geometry import Polygon
43
43
# This will stop working if pandas switches its versioning scheme to CalVer or something...
44
44
_PANDAS_MAJOR_VERSION = int (importlib .metadata .version ("pandas" ).split ("." )[0 ])
45
45
46
+ # https://github.com/DOI-USGS/dataretrieval-python/compare/v1.0.8...v1.0.9
47
+ if isinstance (_DATARETRIEVAL_STATE_CODES , list ):
48
+ STATE_CODES = sorted (_DATARETRIEVAL_STATE_CODES )
49
+ else :
50
+ STATE_CODES = sorted (_DATARETRIEVAL_STATE_CODES .values ())
51
+
46
52
# constants
47
53
USGS_OUTPUT_OF_INTEREST = (
48
54
"elevation" , # Overlaps some of the specific codes below
@@ -156,7 +162,7 @@ def _get_all_usgs_stations(normalize: bool = True) -> gpd.GeoDataFrame:
156
162
"hasDataType" : dtp ,
157
163
}
158
164
for st , dtp in product (
159
- state_codes ,
165
+ STATE_CODES ,
160
166
USGS_OUTPUT_TYPE ,
161
167
)
162
168
],
You can’t perform that action at this time.
0 commit comments