Skip to content

Commit 51ac674

Browse files
thodson-usgsclaude
andauthored
Deprecate nadp module ahead of 2026-11-01 removal (#243)
Each public function in `dataretrieval.nadp` (`get_annual_MDN_map`, `get_annual_NTN_map`, `get_zip`) now emits a `DeprecationWarning` on call, pointing users to retrieve NADP data directly from https://nadp.slh.wisc.edu/. NADP is not a USGS service, and the module has been lightly maintained (with several long-standing TODOs that were never picked up); keeping it in `dataretrieval` is out of scope for a USGS water-data package. The module is scheduled for removal on or after 2026-11-01 (six months after this deprecation lands), tracked in the linked issue. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8cbff61 commit 51ac674

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
**05/01/2026:** The `nadp` module is now deprecated. Calling any of `get_annual_MDN_map`, `get_annual_NTN_map`, or `get_zip` will emit a `DeprecationWarning`. The module is scheduled for removal on or after **2026-11-01**. NADP is not a USGS data source; users should retrieve NADP data directly from https://nadp.slh.wisc.edu/.
2+
13
**04/23/2026:** Added `waterdata.get_nearest_continuous(targets, ...)` — for each of N target timestamps, fetches the single continuous observation closest to that timestamp in one HTTP round-trip (auto-chunked when the resulting CQL filter is long, via the facility added in #238). The helper is designed for workflows that pair many discrete-measurement timestamps with surrounding instantaneous data, which the OGC `time` parameter can't express since it only accepts one instant or one interval per request. Ties at window midpoints are resolved per a configurable `on_tie` ∈ {`"first"`, `"last"`, `"mean"`}; the default `window="PT7M30S"` matches a 15-minute continuous gauge.
24

35
**04/22/2026:** Highlights since the `v1.1.0` release (2025-11-26), which shipped the `waterdata` module:

dataretrieval/nadp.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,22 @@
3131

3232
import io
3333
import re
34+
import warnings
3435
import zipfile
3536

3637
import requests
3738

39+
_DEPRECATION_MESSAGE = (
40+
"The `nadp` module is deprecated and will be removed from `dataretrieval` "
41+
"on or after 2026-11-01. NADP is not a USGS data source; please retrieve "
42+
"NADP data directly from https://nadp.slh.wisc.edu/."
43+
)
44+
45+
46+
def _warn_deprecated():
47+
warnings.warn(_DEPRECATION_MESSAGE, DeprecationWarning, stacklevel=3)
48+
49+
3850
NADP_URL = "https://nadp.slh.wisc.edu"
3951
NADP_MAP_EXT = "filelib/maps"
4052

@@ -107,6 +119,8 @@ def get_annual_MDN_map(measurement_type, year, path):
107119
... )
108120
109121
"""
122+
_warn_deprecated()
123+
110124
url = f"{NADP_URL}/{NADP_MAP_EXT}/MDN/grids/"
111125

112126
filename = f"Hg_{measurement_type}_{year}.zip"
@@ -160,6 +174,8 @@ def get_annual_NTN_map(measurement_type, measurement=None, year=None, path="."):
160174
... )
161175
162176
"""
177+
_warn_deprecated()
178+
163179
url = f"{NADP_URL}/{NADP_MAP_EXT}/NTN/grids/{year}/"
164180

165181
filename = f"{measurement_type}_{year}.zip"
@@ -195,6 +211,8 @@ def get_zip(url, filename):
195211
finish docstring
196212
197213
"""
214+
_warn_deprecated()
215+
198216
req = requests.get(url + filename)
199217
req.raise_for_status()
200218

0 commit comments

Comments
 (0)