You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Switch to @_deprecated decorator; drop sys._getframe walk
Replaces nine `_warn_deprecated("name")` first-line calls with `@_deprecated`
above the function definition. The decorator does three things:
1. Validates `func.__name__ in _REPLACEMENTS` at import time, so a missing
mapping fails loudly instead of producing a KeyError on the first user
call.
2. Drops the stringly-typed `_warn_deprecated("get_iv")` call sites — the
name now flows from `func.__name__`, so a typo can't drift from the
real symbol.
3. Replaces the `sys._getframe` stack walk with a thread-local re-entrancy
flag. Because the decorator wraps the whole function call (not just the
warn line), the flag's lifetime spans nested wrapper invocations
correctly. No CPython implementation detail required.
Tighten the NEWS.md entry and drop the unused `requests_mock` fixture from
`test_warn_message_includes_replacement` (it never made an HTTP request).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: NEWS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
**05/06/2026:** Each remaining active function in `dataretrieval.nwis` now emits a per-function `DeprecationWarning`that names its `waterdata` replacement (`get_dv` → `get_daily`, `get_iv` → `get_continuous`, `get_info` / `what_sites` → `get_monitoring_locations`, `get_stats` → `get_stats_por` / `get_stats_date_range`, `get_discharge_peaks` → `get_peaks`, `get_ratings` → `get_ratings`, `get_record` / `query_waterdata` / `query_waterservices` → the appropriate `waterdata.get_*()` helper). The `nwis` module is scheduled for removal on or after **2027-05-06**.
1
+
**05/06/2026:** Each remaining active function in `dataretrieval.nwis` now emits a per-function `DeprecationWarning`naming the `waterdata` replacement to migrate to (visible the first time users call each getter). The `nwis` module is scheduled for removal on or after **2027-05-06**.
2
2
3
3
**05/05/2026:** Added `waterdata.get_combined_metadata(...)` — wraps the Water Data API's `combined-metadata` collection, which joins the monitoring-locations catalog with the time-series-metadata catalog and returns one row per (location, parameter, statistic) inventory entry. This is the most flexible "what data is available" endpoint in the API: any location attribute (state, HUC, site type, drainage area, well-construction depth, …) can be combined with any time-series attribute (parameter code, statistic, data type, period of record, …) in a single query. Mirrors R's `read_waterdata_combined_meta`.
0 commit comments