Commit 58b314c
Fix InterpolatorKNNBarycentric writability + split-mappings padding
Bugfixes surfaced while integrating InterpolatorKNNBarycentric into the
autolens FitImaging eager numpy path:
- `_mappings_sizes_weights` was returning np.asarray() of jax outputs,
which gives a read-only view. ConstantSplit's `reg_split_np_from` uses
in-place assignment and raised "assignment destination is read-only".
On the numpy path, materialize with np.array() to get a writable buffer.
- `_mappings_sizes_weights_split` returned a k=3 mappings array. The
ConstantSplit code writes `splitted_mappings[i][j+1]` for the central
pixel insertion, requiring an extra reserved column. Match
InterpolatorDelaunay's hstack-append pattern.
- Add `import numpy as np` at module scope (was implicitly available
through `jax.numpy as jnp` aliasing for Wendland-only paths).
- New regression-guard test confirms numpy-path mappings/weights are
writable.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent f59ae1d commit 58b314c
2 files changed
Lines changed: 64 additions & 2 deletions
File tree
- autoarray/inversion/mesh/interpolator
- test_autoarray/inversion/pixelization/interpolator
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
357 | 359 | | |
358 | 360 | | |
359 | 361 | | |
360 | | - | |
361 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
362 | 372 | | |
363 | 373 | | |
364 | 374 | | |
| |||
404 | 414 | | |
405 | 415 | | |
406 | 416 | | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
407 | 423 | | |
408 | 424 | | |
409 | 425 | | |
410 | 426 | | |
411 | 427 | | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
412 | 433 | | |
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
0 commit comments