Repository navigation
Closed
Description
Summary
Two NEEDS_FIX markers filed 2026-04-10 blame an IndexError in
InstanceInterpolator.__getitem__ when querying a between-samples time (1.5).
Both markers are stale. The underlying library bug was fixed by
PyAutoFit c8511b553 (2026-04-12) — two days after the markers were filed —
which added the empty-instances guard in autofit/interpolator/abstract.py.
Reproduction on clean main (2026-07-22)
All three repos clean and on main, with output/ moved aside so nothing was
served from cache:
| Run | Result |
|---|---|
autofit_workspace scripts/features/interpolate.py, real, fresh output/ |
exit 0 |
same script under PYAUTO_TEST_MODE=1, no output/ at all |
exit 0 |
HowToFit chapter_1_introduction/tutorial_5_results_and_samples.py, real |
exit 0 |
Corrections to the original diagnosis
- It is not a bracketing / off-by-one bug.
t == 1.5interpolation always
worked —test_interpolator.pyalready exercises between-samples queries at
1.5 in four places. The real failure was an emptyinstanceslist reaching
self.instances[0], as the workspace marker's own text said ("value_map
lookup falls through to empty instances list"). - HowToFit
tutorial_5contains no interpolator code at all. The "likely
related to InstanceInterpolator" text in that marker was a misattribution.
Residual gap
c8511b553 shipped the guard with no test. That is the only code change
left to make.
Plan (high level)
- Add the missing regression test for the empty-instances guard in PyAutoFit.
- Remove the stale NEEDS_FIX marker from
autofit_workspaceno_run.yaml. - Remove the stale NEEDS_FIX marker from
HowToFitno_run.yaml. - Record here that the fix was
c8511b553and that the HowToFit marker's
stated cause was never correct.
Plan (detailed)
PyAutoFit/test_autofit/interpolator/test_interpolator.py— add
test_empty_instances_raises: constructaf.LinearInterpolator([]), query
interpolator.t == 1.5, assertpytest.raises(IndexError, match="no instances").
numpy-only, no JAX. Verify withpytest test_autofit/interpolator/.autofit_workspace/config/build/no_run.yaml— delete the
features/interpolateline.HowToFit/config/build/no_run.yaml— delete the
chapter_1_introduction/tutorial_5_results_and_samplesline.- No notebook regeneration — config-only change in both workspaces.
Branch: feature/interpolator-stale-needs-fix
Out of scope (to be filed separately)
Two exit-0 correctness smells noticed while reproducing, unrelated to the
IndexError:
- HowToFit
tutorial_5: the section printing "only the Gaussian normalization
and sigma" emits 5 values instead of 2. autofit_workspace features/interpolate: the aggregator block prints a
differentt=2centre than the in-memory block (49.96 vs 59.73 in one run).
Metadata
Metadata
Assignees
Labels
No labels
Activity
Jammy2211 commentedon Jul 22, 2026
Shipped — 2 PRs open
test_no_instances, the regression testc8511b553omitted.pytest test_autofit/interpolator/→ 36 passed.tutorial_5NEEDS_FIX marker.Scope correction found during implementation
The
autofit_workspacehalf needed no change — thefeatures/interpolatemarker was already removed upstream by autofit_workspace PR #103 (7154e8a, "un-park features/interpolate (IndexError fixed)"). My initial grep hit a stale localmain. Branch dropped, no PR for that repo.So of the three repos in the original prompt, only two were actually in play, and neither needed a behavioural fix — the library bug was fixed 2026-04-12.
Notes
no_run.yamlnow has zero entries. Both PyAutoHands loaders (run.py:53,run_python.py:46) dono_run_data or [], so the resultingNoneparse is handled — no build regression.test(interpolator): cover empty-instances IndexError guard (#1412)
chore(no_run): un-park tutorial_5_results_and_samples (stale NEEDS_FI…
Jammy2211 commentedon Jul 22, 2026
CLOSED — all 4 PRs merged
test_no_instancesregression testtutorial_5NEEDS_FIXAll green on Python 3.12 + 3.13 before merge.
Net result: the
IndexErrorthis issue was filed for did not exist — fixed byc8511b553on 2026-04-12, two days after the markers were parked. What the task actually produced was the missing regression test for that fix, removal of two stale NEEDS_FIX markers, and two genuine tutorial-correctness bugs found while reproducing.