Skip to content

Commit e9aa572

Browse files
thodson-usgsclaude
andcommitted
Update get_watershed narrative docstring to match multi-return contract
Per Copilot review: the narrative section claimed `get_watershed` "Returns a watershed object", but with the explicit `format` contract the function actually returns a `requests.Response` (default), a `dict`, or a `Watershed` depending on `format`. Rewrite the narrative to describe the three return shapes accurately. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f3d1e8f commit e9aa572

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

dataretrieval/streamstats.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,13 @@ def get_watershed(
7070
simplify=True,
7171
format="geojson",
7272
):
73-
"""Get watershed object based on location
74-
75-
**Streamstats documentation:**
76-
Returns a watershed object. The request configuration will determine the
77-
overall request response. However all returns will return a watershed
78-
object with at least the workspaceid. The workspace id is the id to the
79-
service workspace where files are stored and can be used for further
80-
processing such as for downloads and flow statistic computations.
73+
"""Delineate a watershed via the StreamStats API.
74+
75+
Hits the StreamStats ``watershed.geojson`` endpoint and returns the
76+
delineated watershed in one of three shapes selected by ``format``: the
77+
raw ``requests.Response`` (default), the parsed JSON ``dict``, or a
78+
:obj:`Watershed` instance. Every response carries a workspace identifier
79+
that can be passed to :obj:`download_workspace` for further processing.
8180
8281
See: https://streamstats.usgs.gov/streamstatsservices/#/ for more
8382
information.

0 commit comments

Comments
 (0)