Skip to content

Commit 96f5771

Browse files
thodson-usgsclaude
andcommitted
Address /simplify findings on get_peaks
The OGC peaks queryables endpoint declares peak_since as `integer`, but the wrapper typed it `str | list[str]` and the docstring offered a fabricated string example ("site establishment"). Verified against the live queryables: peak_since, water_year, year, month, day are all integer-typed. Re-typed peak_since to int | list[int] | None and rewrote the docstring entry to describe the actual semantics (the year since which the peak has stood as a record). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 73de065 commit 96f5771

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

dataretrieval/waterdata/api.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,7 +1772,7 @@ def get_peaks(
17721772
year: int | list[int] | None = None,
17731773
month: int | list[int] | None = None,
17741774
day: int | list[int] | None = None,
1775-
peak_since: str | list[str] | None = None,
1775+
peak_since: int | list[int] | None = None,
17761776
properties: str | list[str] | None = None,
17771777
skip_geometry: bool | None = None,
17781778
bbox: list[float] | None = None,
@@ -1815,9 +1815,10 @@ def get_peaks(
18151815
water_year, year, month, day : int or list of ints, optional
18161816
Calendar / water-year filters on the peak event. The water year ends
18171817
September 30 (e.g. WY2024 = Oct 1, 2023 – Sep 30, 2024).
1818-
peak_since : string or list of strings, optional
1819-
Server-side filter for "first time the value has been exceeded since"
1820-
flag (e.g. ``"1900"``, ``"site establishment"``).
1818+
peak_since : int or list of ints, optional
1819+
Filter on the year since which the peak value has stood as the
1820+
record (the API serves this field as an integer; many rows are
1821+
``null``).
18211822
properties : string or list of strings, optional
18221823
Subset of columns to return. Defaults to every available property.
18231824
skip_geometry : boolean, optional

0 commit comments

Comments
 (0)