Commit 9c7c8ad
refactor: vectorize k x s segment-id construction (#362 refactor exercise)
The per-pixel python loop becomes pure numpy (repeat/cumsum/divmod on the
flat sample index): cold construction 62 ms -> 9.7 ms on a 3000-pixel
adaptive mask (cached repeat calls unchanged at ~80 us). Exact same ids as
the loop on adaptive references; suite unchanged.
Behaviour-preserving; closes the library leg of the k x s refactor
exercise. The operate/image call-site pattern was reviewed and left as-is
(clean two-step seam); no PyAutoGalaxy edits needed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 4ed7472 commit 9c7c8ad
1 file changed
Lines changed: 16 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
192 | 200 | | |
193 | 201 | | |
194 | 202 | | |
| |||
0 commit comments