Commit 0aec2c8
Small cleanups: idiomatic Python and a precedence fix (#224)
* Small cleanups: idiomatic Python and a precedence fix
- waterdata/utils.py: replace runtime `assert` in `_check_ogc_requests`
with an explicit `ValueError` (assertions can be disabled with `-O`).
- waterdata/utils.py: fix operator-precedence bug in `_format_datetime`
where `len==1 and re.search(...) or "/" in datetime_input[0]` would
short-circuit and return `datetime_input[0]` for 2-element inputs
whose first element contained "/". Parenthesize so both branches
require `len==1`.
- nwis.py: `"dec_lat_va" in list(df)` -> `in df.columns` (drop needless
list construction).
- nwis.py: replace index-based `for i in range(len(index_list)-1)` loop
with `zip(index_list[:-1], index_list[1:])`.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Ruff format
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 1115167 commit 0aec2c8
2 files changed
Lines changed: 7 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
| 996 | + | |
1000 | 997 | | |
1001 | 998 | | |
1002 | 999 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
188 | | - | |
189 | | - | |
| 187 | + | |
| 188 | + | |
190 | 189 | | |
191 | 190 | | |
192 | 191 | | |
| |||
291 | 290 | | |
292 | 291 | | |
293 | 292 | | |
294 | | - | |
| 293 | + | |
295 | 294 | | |
296 | 295 | | |
297 | 296 | | |
298 | 297 | | |
299 | | - | |
| 298 | + | |
| 299 | + | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| |||
0 commit comments