Skip to content

chore!: remove the nadp module and the deprecated samples shim (1.2.0)#330

Merged
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:chore/remove-nadp-samples
Jun 23, 2026
Merged

chore!: remove the nadp module and the deprecated samples shim (1.2.0)#330
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:chore/remove-nadp-samples

Conversation

@thodson-usgs

Copy link
Copy Markdown
Collaborator

Summary

Ahead of the 1.2.0 release (which allows breaking changes), this removes two long-deprecated modules and every reference to them except the changelog.

  • dataretrieval.nadp — deprecated 2026-05-01 (scheduled for removal on/after 2026-11-01). NADP is not a USGS data source; retrieve NADP data directly from https://nadp.slh.wisc.edu/.
  • dataretrieval.samples — the get_usgs_samples shim that only emitted a DeprecationWarning and forwarded to the modern getter. Use waterdata.get_samples() instead.

The modern waterdata.get_samples() / get_samples_summary() and their demo notebooks are untouched — only the deprecated samples shim is removed.

Changes

Deleted

  • dataretrieval/nadp.py, dataretrieval/samples.py
  • tests/nadp_test.py (was module-skipped)
  • docs/source/reference/nadp.rst

Reference cleanup

  • dataretrieval/__init__.py — removed nadp/samples from the eager imports, __all__, and the module-list docstring.
  • dataretrieval/exceptions.py, dataretrieval/utils.py — dropped nadp from the "every service module" / "shared by" docstrings.
  • docs/source/reference/index.rst — removed the nadp toctree entry.
  • docs/source/userguide/dataportals.rst — removed the two NADP network rows (National Trends Network, Mercury Deposition Network); kept the USGS Samples portal row (still served by waterdata.get_samples).
  • AGENTS.md — removed the tests/nadp_test.py note.
  • NEWS.md — added a dated 1.2.0 breaking-change entry; existing historical NADP/samples changelog lines left intact (per "remove all references except the changelog").

Breaking change

import dataretrieval.nadp and import dataretrieval.samples now raise ModuleNotFoundError; samples.get_usgs_samples is gone. Migrate samples callers to waterdata.get_samples().

Verification

  • import dataretrieval is clean and __all__ no longer lists nadp/samples; dataretrieval.nadp / dataretrieval.samples raise ModuleNotFoundError, while wqp / waterdata (incl. get_samples) still import.
  • No remaining source references to nadp or the deprecated samples module (changelog excepted) — verified by git grep.
  • ruff + mypy --strict clean; 492 tests collect with no import errors.

🤖 Generated with Claude Code

Ahead of the 1.2.0 release (which allows breaking changes), remove two
deprecated modules and every reference to them except the changelog:

- `dataretrieval.nadp` — deprecated 2026-05-01. NADP is not a USGS data source;
  retrieve NADP data directly from https://nadp.slh.wisc.edu/.
- `dataretrieval.samples` — the `get_usgs_samples` shim that only forwarded to
  `waterdata.get_samples()`. Use `waterdata.get_samples()` directly.

Deleted: both modules, `tests/nadp_test.py`, and their reference doc pages
`docs/source/reference/{nadp,samples}.rst`. Updated references: the `nadp`
API-toctree entry, the two NADP rows in the data-portals table, the
`nadp`/`samples` entries in `dataretrieval/__init__` (imports, `__all__`, the
module-list docstring), the `nadp` mentions in the shared `exceptions`/`utils`
docstrings, and the `nadp_test` note in AGENTS.md. A NEWS.md entry records the
removal.

The modern `waterdata.get_samples()` / `get_samples_summary()` and their demo
notebooks are untouched — only the deprecated `samples` shim is removed.
(Rebased onto main: the `ngwmn` module + OGC engine added in DOI-USGS#324 are kept; the
`samples.rst` autodoc page main added for the now-removed module is dropped.)

BREAKING CHANGE: `import dataretrieval.nadp` and `import dataretrieval.samples`
now raise ModuleNotFoundError; `samples.get_usgs_samples` is gone — use
`waterdata.get_samples()`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sjb14HkwuCydKSKMsaXsgd
@thodson-usgs thodson-usgs force-pushed the chore/remove-nadp-samples branch from 8c0c793 to 5633e2c Compare June 23, 2026 22:26
@thodson-usgs thodson-usgs marked this pull request as ready for review June 23, 2026 22:45
@thodson-usgs thodson-usgs merged commit 566ef86 into DOI-USGS:main Jun 23, 2026
9 checks passed
@thodson-usgs thodson-usgs deleted the chore/remove-nadp-samples branch June 23, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant