Skip to content

docs: migrate userguide, examples, and notebooks to the Water Data API#290

Merged
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:waterdata-docs
May 26, 2026
Merged

docs: migrate userguide, examples, and notebooks to the Water Data API#290
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:waterdata-docs

Conversation

@thodson-usgs
Copy link
Copy Markdown
Collaborator

@thodson-usgs thodson-usgs commented May 26, 2026

Migrates the documentation and demo notebooks off the deprecated nwis module onto the waterdata module (USGS Water Data API).

Changes

  • userguide/timeconventions — rewritten for the Water Data API datetime model: time is a column (tz-aware UTC for continuous data, tz-naive for daily), with the .dt.tz_convert idiom.
  • examples/readme_examples + siteinfo_examples — ported to get_continuous / get_monitoring_locations / get_time_series_metadata.
  • demo notebooks — migrated to the waterdata API (USGS-prefixed monitoring-location ids; get_daily, get_continuous, get_field_measurements, get_peaks, get_ratings, get_stats_*, get_samples), with titles, narratives, and argument lists rewritten to match the code. WaterUse stays on legacy nwis.get_water_use with a note (no Water Data API equivalent yet).
  • renamed the demo notebooks to lead with their module — USGS_WaterData_*, USGS_NLDI, USGS_NWIS_WaterUse — and renamed the peak-flow trends demo to peak_streamflow_trends.
  • nldi — the nationwide get_features_by_data_source example is marked # doctest: +SKIP (it streams every nwissite feature).
  • Sphinx warnings — fixed get_channel bullet-list RST, the duplicated get_monitoring_locations "list of codes" link, the NWIS_Metadata duplicate object description, the deprecated display_version theme option, the missing _static/ directory, and a WaterData_demo heading level.

Verification

  • sphinx-build -b doctest: 0 failures (against the live API).
  • make html: builds with notebooks executing against the live API — 0 notebook cell errors; the only remaining warnings are the intentional !pip cells in WaterData_demo.
  • Notebooks kept output-free (nbsphinx executes them at build time).

🤖 Generated with Claude Code

Move the user guide, example pages, and demo notebooks off the deprecated
`nwis` module onto the `waterdata` module (USGS Water Data API):

- userguide/timeconventions: rewritten for the Water Data API datetime model
  (`time` is a column; tz-aware UTC for continuous data, tz-naive for daily),
  using the `.dt.tz_convert` idiom.
- examples/readme_examples + siteinfo_examples: ported to get_continuous,
  get_monitoring_locations, and get_time_series_metadata.
- demo notebooks: migrated to the waterdata API (USGS-prefixed monitoring
  location ids; get_daily, get_continuous, get_field_measurements, get_peaks,
  get_ratings, get_stats_*, get_samples), with titles, narratives, and
  argument lists rewritten to match the code. WaterUse stays on the legacy
  nwis.get_water_use with a note (no Water Data API equivalent yet).
- renamed the demo notebooks to lead with their module (USGS_WaterData_*,
  USGS_NLDI, USGS_NWIS_WaterUse) and renamed the peak-flow trends demo to
  peak_streamflow_trends.
- nldi: mark the nationwide get_features_by_data_source example
  `# doctest: +SKIP` (it streams every nwissite feature and hangs the build).
- fixed pre-existing Sphinx build warnings: get_channel bullet-list RST, the
  duplicated get_monitoring_locations link, the NWIS_Metadata duplicate object
  description, the deprecated display_version theme option, the missing
  _static directory, and a WaterData_demo heading level.

Notebooks are kept output-free (nbsphinx executes them at build time).
`sphinx-build -b doctest` passes and every notebook executes against the
live API with no cell errors.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@thodson-usgs thodson-usgs marked this pull request as ready for review May 26, 2026 21:17
@thodson-usgs thodson-usgs merged commit 7f64c2d into DOI-USGS:main May 26, 2026
14 of 15 checks passed
@thodson-usgs thodson-usgs deleted the waterdata-docs branch May 26, 2026 21:18
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