Skip to content

docs: fix WQP README example unpacking and stale install instructions#296

Merged
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:docs/fix-broken-examples
May 29, 2026
Merged

docs: fix WQP README example unpacking and stale install instructions#296
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:docs/fix-broken-examples

Conversation

@thodson-usgs
Copy link
Copy Markdown
Collaborator

Summary

Two documentation fixes for copy-paste-broken examples, each verified against the live API / repo. Docs only — no code changes.

README — WQP examples discarded the metadata tuple

wqp.what_sites(...) and wqp.get_results(...) return (DataFrame, WQP_Metadata), but the examples assigned the whole tuple to sites / results, so len(sites) / len(results) always printed 2 (the tuple length), not the row count.

Fix: unpack sites, metadata = ... / results, metadata = ... (matching the Water Data examples above). Verified live — the corrected snippet prints Found 25573 stream monitoring sites in Wisconsin and Retrieved 163 temperature measurements.

docs/source/meta/installing.rst — referenced removed requirements*.txt

Dependencies moved to pyproject.toml, but the install guide still pointed at requirements.txt / requirements-dev.txt (which don't exist) and instructed pip install -r requirements-dev.txt.

Fix: the intro now points at pyproject.toml ([project.dependencies] + [project.optional-dependencies]); the developer install becomes pip install -e ".[test,doc,nldi]" (extras confirmed present in pyproject.toml); removed the two dangling rst link targets.

NLDI examples — checked and intentionally left unchanged

A review had flagged the README's nldi.get_basin(feature_source='comid', ...) / get_flowlines(feature_source='comid', ...) as broken. Checked against the live NLDI API: comid is a valid source and both calls return data (get_basin → 1 feature, get_flowlines → 7 flowlines). No change made.

🤖 Generated with Claude Code

README WQP examples assigned the (DataFrame, metadata) tuple to a single name,
so `len(sites)` / `len(results)` printed 2 (the tuple length) instead of the
row count. Unpack to `sites, metadata = ...` / `results, metadata = ...`
(verified live: prints 25573 sites / 163 measurements).

docs/source/meta/installing.rst referenced requirements.txt and
requirements-dev.txt, which no longer exist — dependencies moved to
pyproject.toml. Point the intro at [project.dependencies] and
[project.optional-dependencies], replace the dev-install step with
`pip install -e ".[test,doc,nldi]"`, and drop the two dangling rst link
targets.

The NLDI README examples (feature_source='comid') were checked against the
live NLDI API and work as written (get_basin -> 1 feature, get_flowlines -> 7
flowlines), so they are intentionally left unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@thodson-usgs thodson-usgs marked this pull request as ready for review May 29, 2026 21:26
@thodson-usgs thodson-usgs merged commit 9cf7251 into DOI-USGS:main May 29, 2026
8 checks passed
@thodson-usgs thodson-usgs deleted the docs/fix-broken-examples branch May 29, 2026 21:26
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