Commit b325f92
Tidy streamstats fix per /simplify review
Per /simplify review on PR #245:
- Replace `json.loads(r.text)` with `r.json()` (matching the convention
used in `nldi.py` and `nwis.py`) and drop the now-unused `import
json` from `dataretrieval/streamstats.py`.
- Remove the dead `format == "shape"` branch — a stale Fiona-stub
(`# use Fiona to return a shape object` + `pass`) that silently fell
through to `Watershed.from_streamstats_json(data)`. The docstring no
longer mentions `"shape"` so removing the branch matches the contract.
- Drop four trivial unit tests that each exercised a one-line behavior
change obvious from the diff (`from_streamstats_json` returns an
instance, `format="object"` returns a dict, `__init__` populates self,
`_workspaceID` alias resolves). Keep the load-bearing one:
`test_from_streamstats_json_does_not_mutate_class` guards against
re-introducing the class-mutation antipattern under refactor.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e1b424d commit b325f92
2 files changed
Lines changed: 2 additions & 44 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
| |||
137 | 135 | | |
138 | 136 | | |
139 | 137 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 138 | + | |
145 | 139 | | |
146 | 140 | | |
147 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
| |||
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 15 | | |
24 | 16 | | |
25 | 17 | | |
| |||
39 | 31 | | |
40 | 32 | | |
41 | 33 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
0 commit comments