Commit 42852a8
committed
Centralize monitoring_location_id check in _get_args; trim narration
/simplify findings:
1. Move the per-function `monitoring_location_id = _check_monitoring_location_id(...)`
into `_get_args` itself. Eliminates 13 copy-paste call sites in api.py and
closes the bug class Copilot found twice (four functions had been missed
when added piecemeal). New `get_*` functions inherit validation automatically.
2. Drop `_LIST_ONLY_STR_PARAMS` (a one-element `frozenset`). Inline the
`properties` special case with a literal `elif k == "properties":` plus
a one-line WHY comment.
3. Compress the three-paragraph narration in `_construct_api_requests` to a
single line explaining the only non-obvious bit (`len()` instead of
truthiness, because of numpy ndarray).
4. Add `begin_utc`/`end_utc` to `_DATE_RANGE_PARAMS`. `get_time_series_metadata`
exposes both as range filters but the constant was missing them, so a
two-element list would have been treated as a multi-value POST/CQL2 filter
instead of being formatted as an ISO-8601 interval.
5. Drop the now-unused `_check_monitoring_location_id` import from api.py.1 parent aa98d23 commit 42852a8
2 files changed
Lines changed: 8 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
232 | 231 | | |
233 | 232 | | |
234 | 233 | | |
235 | | - | |
236 | 234 | | |
237 | 235 | | |
238 | 236 | | |
| |||
421 | 419 | | |
422 | 420 | | |
423 | 421 | | |
424 | | - | |
425 | 422 | | |
426 | 423 | | |
427 | 424 | | |
| |||
720 | 717 | | |
721 | 718 | | |
722 | 719 | | |
723 | | - | |
724 | 720 | | |
725 | 721 | | |
726 | 722 | | |
| |||
944 | 940 | | |
945 | 941 | | |
946 | 942 | | |
947 | | - | |
948 | 943 | | |
949 | 944 | | |
950 | 945 | | |
| |||
1181 | 1176 | | |
1182 | 1177 | | |
1183 | 1178 | | |
1184 | | - | |
1185 | 1179 | | |
1186 | 1180 | | |
1187 | 1181 | | |
| |||
1373 | 1367 | | |
1374 | 1368 | | |
1375 | 1369 | | |
1376 | | - | |
1377 | 1370 | | |
1378 | 1371 | | |
1379 | 1372 | | |
| |||
1570 | 1563 | | |
1571 | 1564 | | |
1572 | 1565 | | |
1573 | | - | |
1574 | 1566 | | |
1575 | 1567 | | |
1576 | 1568 | | |
| |||
1761 | 1753 | | |
1762 | 1754 | | |
1763 | 1755 | | |
1764 | | - | |
1765 | 1756 | | |
1766 | 1757 | | |
1767 | 1758 | | |
| |||
1883 | 1874 | | |
1884 | 1875 | | |
1885 | 1876 | | |
1886 | | - | |
1887 | 1877 | | |
1888 | 1878 | | |
1889 | 1879 | | |
| |||
2004 | 1994 | | |
2005 | 1995 | | |
2006 | 1996 | | |
2007 | | - | |
2008 | 1997 | | |
2009 | 1998 | | |
2010 | 1999 | | |
| |||
2536 | 2525 | | |
2537 | 2526 | | |
2538 | 2527 | | |
2539 | | - | |
2540 | 2528 | | |
2541 | 2529 | | |
2542 | 2530 | | |
| |||
2666 | 2654 | | |
2667 | 2655 | | |
2668 | 2656 | | |
2669 | | - | |
2670 | 2657 | | |
2671 | 2658 | | |
2672 | 2659 | | |
| |||
2839 | 2826 | | |
2840 | 2827 | | |
2841 | 2828 | | |
2842 | | - | |
2843 | 2829 | | |
2844 | 2830 | | |
2845 | 2831 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
| |||
468 | 470 | | |
469 | 471 | | |
470 | 472 | | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
| 473 | + | |
476 | 474 | | |
477 | 475 | | |
478 | 476 | | |
| |||
1203 | 1201 | | |
1204 | 1202 | | |
1205 | 1203 | | |
1206 | | - | |
1207 | | - | |
1208 | | - | |
1209 | | - | |
1210 | | - | |
1211 | | - | |
1212 | 1204 | | |
1213 | 1205 | | |
1214 | 1206 | | |
| |||
1344 | 1336 | | |
1345 | 1337 | | |
1346 | 1338 | | |
1347 | | - | |
1348 | | - | |
1349 | | - | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
1350 | 1343 | | |
1351 | 1344 | | |
1352 | 1345 | | |
| |||
0 commit comments