Enrich waterdata getter docstrings with examples adapted from R#265
Open
thodson-usgs wants to merge 1 commit intoDOI-USGS:mainfrom
Open
Enrich waterdata getter docstrings with examples adapted from R#265thodson-usgs wants to merge 1 commit intoDOI-USGS:mainfrom
thodson-usgs wants to merge 1 commit intoDOI-USGS:mainfrom
Conversation
Cross-referenced each Python waterdata getter's Examples section
against the corresponding R analogue in DOI-USGS/dataRetrieval and
ported the distinctive examples that the Python docs were missing:
- get_daily: add ISO 8601 duration ("P7D") and last_modified ("P7D")
examples. Also fix a pre-existing bug where the multi-site /
approval_status example block was missing its closing parenthesis
and trailing comma.
- get_latest_continuous: add time="P7D" and multi-site +
last_modified="P7D" examples.
- get_latest_daily: add last_modified="P7D" and multi-site +
multi-parameter examples.
- get_field_measurements: add a half-bounded-time example
("1980-01-01/..") and document the inverse "../<date>" form.
Docs only — no signature, behavior, or test changes. Ruff clean.
Live spot-verification was attempted but blocked by a 429 rate
limit; the new examples only use date-format and multi-value idioms
that are already covered by existing tests.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cross-referenced each Python
waterdatagetter's Examples section against the corresponding R analogue in DOI-USGS/dataRetrieval and ported the distinctive examples that the Python docs were missing. Same rationale as the audit done forget_combined_metadatain #264 — many R example sets cover useful idioms (ISO 8601 durations, half-bounded time intervals,last_modifiedfor incremental polling, multi-value POST queries) that aren't yet shown in the Python docs.Docs only — no signature, behavior, or test changes.
Functions touched and what was added
get_dailytime="P7D") example;last_modified="P7D"example for incremental ETL polling. Also fixed a pre-existing bug where the multi-site /approval_statusexample block was missing its closing parenthesis and trailing comma.get_latest_continuoustime="P7D"example (drops sites with no recent observation); multi-site / multi-parameter +last_modified="P7D"example.get_latest_dailylast_modified="P7D"example; multi-site + multi-parameter (discharge + water-temperature) example.get_field_measurements"1980-01-01/.."for everything since 1980; documents the inverse"../<date>"form).What was deliberately skipped
get_continuous(5 examples),get_monitoring_locations(2 well-chosen ones already, R's bbox+chaining cases would duplicateget_combined_metadata's new chaining example in Add waterdata.get_combined_metadata for combined location + time-series inventory #264),get_time_series_metadata,get_stats_por,get_stats_date_range,get_samples,get_codes,get_reference_table,get_channel,get_samples_summary.no_paging,attach_request,chunk_size,convertTypeflag toggling). Filter chunking happens automatically in Python.get_daily's Rdv_postexample usingapproval_status=c("Approved", "Provisional")— Python already has anapproval_status="Approved"example.Test plan
ruff checkclean.__doc__renders correctly (verified viahelp()).P7Dduration,1980-01-01/..half-bounded interval,last_modifiedfield) that are already covered by existing tests and other functions' working examples.Related
get_combined_metadatawith the same docs philosophy applied to a single new function).