Commit c0fa0d8
Expose rolling_ball's hidden interpolation orders as proper kwargs
decompose_rolling_ball inlined a down→process→up round-trip with order=1
on the way down and order=3 on the way up, both hardcoded. That asymmetry
shaped every radius>150 result in the existing 39,731-combination sweep
but was invisible to any parameter recording — the redundancy analysis
could not tell whether two rolling_ball outputs differed because of radius
or because of the fixed-but-unrecorded interpolation pair.
Add roundtrip_resample(arr, factor, down_order, up_order, transform=None)
in src/utils/preprocessing.py as a reusable helper. Refactor
decompose_rolling_ball to take down_order, up_order, target_effective_radius,
and large_radius_threshold as kwargs, with defaults that preserve current
behavior bit-for-bit so existing sweep results stay valid. Register
down_order and up_order in the decomposition registry so they show up in
any future sweep's recorded params.
All 166 tests pass. Verified directly that the round-trip path (radius=200)
produces the expected shape and that the newly exposed kwargs change the
output (L2 distance ~1126 between default and symmetric orders).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 6ca835c commit c0fa0d8
2 files changed
Lines changed: 107 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
463 | | - | |
464 | | - | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
465 | 475 | | |
466 | 476 | | |
467 | 477 | | |
468 | | - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
469 | 486 | | |
470 | 487 | | |
471 | 488 | | |
472 | 489 | | |
473 | 490 | | |
474 | 491 | | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
479 | 513 | | |
480 | 514 | | |
481 | 515 | | |
482 | 516 | | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | 517 | | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
| 518 | + | |
493 | 519 | | |
494 | 520 | | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
505 | 532 | | |
506 | 533 | | |
507 | 534 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 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 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
0 commit comments