Skip to content

chore: misc cleanups from the package review (bbox docs, nwis, empty-list)#312

Merged
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:chore/review-cleanups-batch2
Jun 1, 2026
Merged

chore: misc cleanups from the package review (bbox docs, nwis, empty-list)#312
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:chore/review-cleanups-batch2

Conversation

@thodson-usgs
Copy link
Copy Markdown
Collaborator

Summary

A bundle of small, low-risk cleanups from the package review — two docs, three minor code fixes. No behavior change beyond the two noted.

# Fix Kind
1 bbox docstring: the 4th coordinate was labeled "Northern-most longitude"; for [xmin, ymin, xmax, ymax] it's the Northern-most latitude. Fixed across the OGC getters + get_samples (7 spots). docs
2 get_field_measurements properties listed daily/continuous columns it doesn't have (time_series_id, statistic_id, time); now points to the field-measurements OpenAPI schema. docs
3 nwis.get_discharge_peaks ran format_response twice (via _read_rdb, then again with service="peaks"); parse raw with read_rdb so it formats once. Behavior-preserving (the first pass was a no-op/redundant for peaks). fix
4 nwis.query_waterdata validated a dead state_cd key while the docs, error message, and callers all use stateCd; aligned so a stateCd-only query is recognized as a major filter (this becomes load-bearing once #310 stops the always-inject that currently masks it). fix
5 _construct_api_requests emitted an empty-list param as a filterless &param= (read by the server as "match empty"); now omitted. fix

Verification

  • bbox: 0 remaining "Northern-most longitude", 7 "Northern-most latitude".
  • empty list: parameter_code=[] → omitted; parameter_code=["00060"] → present (regression test added).
  • query_waterdata("peaks", stateCd="HI") now passes the major-filter check; a no-filter call still raises TypeError.
  • Full nwis suite (47) passes; ruff clean.

🤖 Generated with Claude Code

Small, low-risk fixes bundled from the review (no behavior change beyond the
two noted):

- docs(waterdata): the `bbox` docstring labeled the 4th coordinate "Northern-most
  longitude"; it is the Northern-most *latitude* (xmin, ymin, xmax, ymax). Fixed
  across the OGC getters and get_samples (7 spots).
- docs(waterdata): get_field_measurements' `properties` listed daily/continuous
  columns it doesn't have (time_series_id, statistic_id, time); point to the
  field-measurements OpenAPI schema instead.
- fix(nwis): get_discharge_peaks ran format_response twice (via _read_rdb, then
  again with service="peaks"); parse raw with read_rdb so it formats once.
- fix(nwis): query_waterdata validated a dead `state_cd` key while the docs,
  error message, and callers use `stateCd`; align it so a stateCd-only query is
  recognized as a major filter.
- fix(waterdata): _construct_api_requests omitted an empty-list param as a
  filterless `&param=` (read by the server as "match empty"); drop it instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@thodson-usgs thodson-usgs marked this pull request as ready for review June 1, 2026 00:44
@thodson-usgs thodson-usgs merged commit 18090d4 into DOI-USGS:main Jun 1, 2026
8 checks passed
@thodson-usgs thodson-usgs deleted the chore/review-cleanups-batch2 branch June 1, 2026 00:44
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