|
35 | 35 | model="wu-public-supply-wd", |
36 | 36 | variable=["pswdtot", "pswdgw", "pswdsw"], |
37 | 37 | state="RI", |
38 | | - startdate="2020-01", |
39 | | - timeres="monthly", |
| 38 | + start_date="2020-01", |
| 39 | + time_resolution="monthly", |
40 | 40 | ) |
41 | 41 |
|
42 | 42 | """ |
@@ -96,9 +96,9 @@ def get_wateruse( |
96 | 96 | state: str | int | Iterable[str | int] | None = None, |
97 | 97 | county: str | Iterable[str] | None = None, |
98 | 98 | huc: str | Iterable[str] | None = None, |
99 | | - timeres: str | None = None, |
100 | | - startdate: str | None = None, |
101 | | - enddate: str | None = None, |
| 99 | + time_resolution: str | None = None, |
| 100 | + start_date: str | None = None, |
| 101 | + end_date: str | None = None, |
102 | 102 | intersection: str = "overlap", |
103 | 103 | limit: int = 600, |
104 | 104 | ssl_check: bool = True, |
@@ -146,15 +146,15 @@ def get_wateruse( |
146 | 146 |
|
147 | 147 | Provide exactly one of ``state``, ``county``, or ``huc`` (each may be a |
148 | 148 | single value or a list). |
149 | | - timeres : string, optional |
| 149 | + time_resolution : string, optional |
150 | 150 | Temporal resolution: ``"monthly"``, ``"annualcy"`` (annual, calendar |
151 | 151 | year), or ``"annualwy"`` (annual, water year). See |
152 | 152 | :data:`TIME_RESOLUTIONS`. |
153 | | - startdate : string, optional |
| 153 | + start_date : string, optional |
154 | 154 | Start of the query window, formatted ``"YYYY"`` for annual data or |
155 | 155 | ``"YYYY-MM"`` for monthly data. |
156 | | - enddate : string, optional |
157 | | - End of the query window, in the same format as ``startdate``. |
| 156 | + end_date : string, optional |
| 157 | + End of the query window, in the same format as ``start_date``. |
158 | 158 | intersection : string, optional |
159 | 159 | How to select HUC12s that straddle the queried-area boundary: |
160 | 160 | ``"overlap"`` (any overlap, the default) or ``"envelop"`` (fully |
@@ -199,18 +199,21 @@ def get_wateruse( |
199 | 199 | ... model="wu-public-supply-wd", |
200 | 200 | ... variable=["pswdtot", "pswdgw", "pswdsw"], |
201 | 201 | ... state="RI", |
202 | | - ... startdate="2020-01", |
203 | | - ... timeres="monthly", |
| 202 | + ... start_date="2020-01", |
| 203 | + ... time_resolution="monthly", |
204 | 204 | ... ) |
205 | 205 |
|
206 | 206 | """ |
| 207 | + # The public parameters are idiomatic snake_case (consistent with |
| 208 | + # ``waterdata.get_samples``); the NWDC service expects compact lowercase |
| 209 | + # query names, so map to those here as the request is built. |
207 | 210 | base_params: dict[str, Any] = { |
208 | 211 | "format": "csv", |
209 | 212 | "model": model, |
210 | 213 | "variable": to_str(variable), |
211 | | - "timeres": timeres, |
212 | | - "startdate": startdate, |
213 | | - "enddate": enddate, |
| 214 | + "timeres": time_resolution, |
| 215 | + "startdate": start_date, |
| 216 | + "enddate": end_date, |
214 | 217 | "intersection": intersection, |
215 | 218 | "limit": limit, |
216 | 219 | } |
|
0 commit comments