Commit b611e9f
refactor(waterdata): make max_chunks a positive-integer count (1 = off, reject 0)
Follow-up to the parallel_chunks contract cleanup. max_chunks is a
sub-request *count*, so its valid domain is the positive integers. Move the
"off" sentinel from 0 to 1 (which already behaves identically — no extra
fan-out, per the earlier n=1-passthrough change) and reject anything below 1:
- ChunkPlan.max_chunks default 0 -> 1; guard `< 0` -> `< 1`, so 0 and
negatives now raise ValueError instead of silently no-oping.
- _parallel_chunks ambient default 0 -> 1; read-site + comments updated.
- _refine off-guard `<= 0` -> `<= 1` (clearer intent; the loop already
no-oped at 1).
- Docstrings (class param, Raises, _refine, ambient) updated.
Tests: zero-cap passthrough -> default/unit passthrough; negative-raises ->
invalid-raises parametrized over {0, -1}; ramp param (0,1) -> (1,1) with the
coverage guard keyed on expected_pieces; the two byte-only baselines and the
ambient-default assertions move 0 -> 1. The public parallel_chunks(n) already
rejected n < 1, so no user-facing behavior changes.
Signed-off-by: thodson-usgs <thodson@usgs.gov>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 8d4c4a1 commit b611e9f
3 files changed
Lines changed: 54 additions & 50 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
188 | | - | |
189 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
742 | | - | |
| 742 | + | |
743 | 743 | | |
744 | 744 | | |
745 | 745 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
345 | 346 | | |
346 | 347 | | |
347 | 348 | | |
| |||
367 | 368 | | |
368 | 369 | | |
369 | 370 | | |
370 | | - | |
| 371 | + | |
371 | 372 | | |
372 | 373 | | |
373 | 374 | | |
374 | 375 | | |
375 | 376 | | |
376 | 377 | | |
377 | 378 | | |
378 | | - | |
| 379 | + | |
379 | 380 | | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
386 | 388 | | |
387 | | - | |
| 389 | + | |
388 | 390 | | |
389 | 391 | | |
390 | 392 | | |
| |||
438 | 440 | | |
439 | 441 | | |
440 | 442 | | |
441 | | - | |
442 | | - | |
| 443 | + | |
| 444 | + | |
443 | 445 | | |
444 | 446 | | |
445 | 447 | | |
| |||
452 | 454 | | |
453 | 455 | | |
454 | 456 | | |
455 | | - | |
| 457 | + | |
456 | 458 | | |
457 | 459 | | |
458 | 460 | | |
| |||
530 | 532 | | |
531 | 533 | | |
532 | 534 | | |
533 | | - | |
| 535 | + | |
534 | 536 | | |
535 | 537 | | |
536 | 538 | | |
537 | 539 | | |
538 | | - | |
| 540 | + | |
539 | 541 | | |
540 | 542 | | |
541 | 543 | | |
542 | 544 | | |
543 | 545 | | |
544 | | - | |
| 546 | + | |
545 | 547 | | |
546 | 548 | | |
547 | 549 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2122 | 2122 | | |
2123 | 2123 | | |
2124 | 2124 | | |
2125 | | - | |
2126 | | - | |
| 2125 | + | |
| 2126 | + | |
2127 | 2127 | | |
2128 | 2128 | | |
2129 | 2129 | | |
2130 | 2130 | | |
2131 | | - | |
| 2131 | + | |
2132 | 2132 | | |
2133 | 2133 | | |
2134 | 2134 | | |
| |||
2137 | 2137 | | |
2138 | 2138 | | |
2139 | 2139 | | |
2140 | | - | |
2141 | | - | |
| 2140 | + | |
| 2141 | + | |
2142 | 2142 | | |
2143 | 2143 | | |
2144 | 2144 | | |
2145 | 2145 | | |
2146 | 2146 | | |
2147 | 2147 | | |
2148 | 2148 | | |
2149 | | - | |
2150 | | - | |
2151 | | - | |
2152 | | - | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
2153 | 2155 | | |
2154 | | - | |
2155 | | - | |
| 2156 | + | |
| 2157 | + | |
2156 | 2158 | | |
2157 | 2159 | | |
2158 | 2160 | | |
2159 | 2161 | | |
2160 | | - | |
| 2162 | + | |
2161 | 2163 | | |
2162 | 2164 | | |
2163 | 2165 | | |
2164 | 2166 | | |
2165 | 2167 | | |
2166 | 2168 | | |
2167 | | - | |
| 2169 | + | |
2168 | 2170 | | |
2169 | 2171 | | |
2170 | 2172 | | |
| |||
2173 | 2175 | | |
2174 | 2176 | | |
2175 | 2177 | | |
2176 | | - | |
| 2178 | + | |
2177 | 2179 | | |
2178 | 2180 | | |
2179 | 2181 | | |
| |||
2205 | 2207 | | |
2206 | 2208 | | |
2207 | 2209 | | |
2208 | | - | |
| 2210 | + | |
2209 | 2211 | | |
2210 | 2212 | | |
2211 | 2213 | | |
| |||
2218 | 2220 | | |
2219 | 2221 | | |
2220 | 2222 | | |
2221 | | - | |
| 2223 | + | |
2222 | 2224 | | |
2223 | 2225 | | |
2224 | 2226 | | |
| |||
2318 | 2320 | | |
2319 | 2321 | | |
2320 | 2322 | | |
2321 | | - | |
| 2323 | + | |
2322 | 2324 | | |
2323 | 2325 | | |
2324 | 2326 | | |
2325 | 2327 | | |
2326 | 2328 | | |
2327 | | - | |
| 2329 | + | |
2328 | 2330 | | |
2329 | 2331 | | |
2330 | 2332 | | |
| |||
2348 | 2350 | | |
2349 | 2351 | | |
2350 | 2352 | | |
2351 | | - | |
| 2353 | + | |
2352 | 2354 | | |
2353 | 2355 | | |
2354 | 2356 | | |
| |||
0 commit comments