Skip to content

Remove Defunct NWIS Functions#222

Merged
thodson-usgs merged 2 commits intoDOI-USGS:mainfrom
thodson-usgs:remove-defunct-nwis-functions
Apr 3, 2026
Merged

Remove Defunct NWIS Functions#222
thodson-usgs merged 2 commits intoDOI-USGS:mainfrom
thodson-usgs:remove-defunct-nwis-functions

Conversation

@thodson-usgs
Copy link
Copy Markdown
Collaborator

@thodson-usgs thodson-usgs commented Apr 2, 2026

Recreate PR #216: Remove Defunct NWIS Functions

This PR resubmits the changes from PR #216 which removes four defunct NWIS legacy functions (get_gwlevels, get_discharge_measurements, get_pmcodes, and get_water_use) by replacing them with NameError exceptions that point users to the modernized waterdata equivalents.

The original PR #216 was superseded by linting changes (PR #219) on the main branch before being merged, which caused conflicts. This PR correctly recreates the exact logical changes from PR #216 directly on top of the newly linted main branch, ensuring we maintain ruff compliance while formally deprecating the defunct functions as planned.

All related tests and defunct data files have been removed, and the README has been updated to reflect the new API announcements identically to PR #216.

Notebook Modernization

In addition to the core API changes, a comprehensive review and modernization of 16 demo notebooks (including all legacy hydroshare examples) was performed:

  • API Migration: Legacy nwis.get_dv(), nwis.get_iv(), and nwis.get_info() calls were upgraded to their modern waterdata equivalents.
  • Defunct Removal: Defunct functions (get_water_use, get_pmcodes) were commented out or replaced with modern alternatives (get_reference_table) across all demos (e.g., R Python Vignette, WaterUse suite).
  • Execution Validation: All notebooks were successfully re-executed using jupyter nbconvert in the local .venv environment to ensure they remain functional and generate correct plots with the new OGC long-format data schema.
  • Clean State: Each notebook was processed with nb-clean to strip execution outputs and counts, ensuring a clean version-controlled state.

@thodson-usgs thodson-usgs changed the title Remove defunct nwis functions. Remove Defunct NWIS Functions Apr 2, 2026
Copy link
Copy Markdown
Collaborator

@ldecicco-USGS ldecicco-USGS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@thodson-usgs thodson-usgs merged commit 5b3766a into DOI-USGS:main Apr 3, 2026
8 checks passed
@thodson-usgs thodson-usgs deleted the remove-defunct-nwis-functions branch April 3, 2026 14:55
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.

2 participants