Commit 8d4c4a1
fix(waterdata): tighten ChunkPlan.max_chunks contract (n=1 passthrough, negative raises)
Two edges from the SOLID review of the parallel_chunks dial:
- max_chunks=1 ("no extra fan-out") took the fan-out path: on a fitting
request it materialized axes and re-rendered them through iter_sub_args
before _refine(1) no-oped, instead of the verbatim passthrough. Widen the
passthrough guard to `max_chunks <= 1` so 0 (off) and 1 (no fan-out) both
short-circuit to the trivial plan.
- A negative max_chunks silently no-oped. It can only be a caller bug (the
public parallel_chunks(n) already rejects n < 1), so raise ValueError at
construction rather than mask it.
Docstring + Raises updated; adds a unit passthrough test for max_chunks=1
and a negative-raises test.
Signed-off-by: thodson-usgs <thodson@usgs.gov>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 2d6c4b9 commit 8d4c4a1
2 files changed
Lines changed: 46 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
341 | 343 | | |
342 | 344 | | |
343 | 345 | | |
| |||
364 | 366 | | |
365 | 367 | | |
366 | 368 | | |
| 369 | + | |
| 370 | + | |
367 | 371 | | |
368 | 372 | | |
369 | 373 | | |
| |||
373 | 377 | | |
374 | 378 | | |
375 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
376 | 390 | | |
377 | 391 | | |
378 | 392 | | |
| |||
424 | 438 | | |
425 | 439 | | |
426 | 440 | | |
427 | | - | |
428 | | - | |
429 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
430 | 445 | | |
431 | 446 | | |
432 | 447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2134 | 2134 | | |
2135 | 2135 | | |
2136 | 2136 | | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
2137 | 2158 | | |
2138 | 2159 | | |
2139 | 2160 | | |
| |||
0 commit comments