# Workspace API-drift call-site fixes (kwargs / Prior / interpolator / plotter) (parked NEEDS_FIX)
Type: bug
Target: workspaces
Repos: autofit_workspace, autogalaxy_workspace, autolens_workspace, autolens_workspace_test, HowToGalaxy, HowToLens, HowToFit, PyAutoFit
Difficulty: medium | Autonomy: supervised | Priority: normal
A set of independent "script uses stale API after a library change" NEEDS_FIX markers. Each is a
targeted call-site (or small library) fix; some pairs share one bug across repos. Reproduce each on
clean main; remove its NEEDS_FIX marker when green. Split into separate PRs if they touch different libs.
- InstanceInterpolator IndexError (likely a PyAutoFit bug, not just call-site): autofit_workspace features/interpolate + HowToFit chapter_1 tutorial_5 (same family).
- ell_comps kwargs KeyError: autogalaxy_workspace imaging/modeling + HowToGalaxy same.
- ellipse kwargs KeyError 'ellipses.0.centre_0': HowToGalaxy ellipse/modeling.
- plotter kwarg drift plot_grid() unexpected 'plot_grid_lines': HowToGalaxy guides/advanced/over_sampling.
- group/slam PriorException (upper<=lower): autolens_workspace group/slam + HowToLens group/slam.
- __hash__ returns non-int TypeError in linear_light_profile_intensity_dict: autolens_workspace_test database/scrape/general.
First step: triage the interpolator one first (library, 2 repos) — likely the highest-value single fix.
Overview
Phase 1 of a parked workspace API-drift umbrella (
PyAutoMind/draft/bug/workspaces/api_drift_callsite_fixes.md). Theautofit_workspacefeatures/interpolate.pytutorial crashes withIndexError: Cannot interpolate: no instances have been added to the interpolator— but only under test mode / CI sweeps, not in real user runs. Reproduced on cleanmain. Root cause is an asymmetry inAggregator.from_directory, so the fix lands in the library.Plan
interpolate.py:213(in-memoryLinearInterpolator) works fine; the crash is atinterpolate.py:265, the aggregator/database section.PYAUTO_TEST_MODE, searches write results tooutput/test_mode/<prefix>(via_test_mode_segment()inautofit/non_linear/paths/abstract.py), butAggregator.from_directoryreads the hardcoded non-test path → walks an empty/nonexistent dir → 0 results → emptyLinearInterpolator→IndexError: no instances.output/<prefix>where the aggregator looks. This only bites test-mode / full-script sweeps.Aggregator.from_directoryis simply not test-mode-aware, unlike the search output paths — that asymmetry is the bug.Aggregator.from_directorytest-mode-aware. Whenis_test_mode()is active and the given directory yields no metadata but thetest_mode-segment-inserted sibling exists, walk that instead (reusing_test_mode_segment()). Safe for the custom-dir aggregator scripts (result.py,overview_2), which simply won't have atest_modesibling. Fixes the whole class of aggregator-under-test-mode failures with no workspace-script masking (no injected env-vars / hardcoded test paths in user-facing tutorials).Detailed implementation plan
Affected Repositories
Branch Survey
Suggested branch:
interpolator-aggregator-test-modeImplementation Steps
Aggregator.from_directory(autofit/aggregator/aggregator.py), reusing_test_mode_segment()fromautofit/non_linear/paths/abstract.py. Add a unit test undertest_autofit/aggregator/covering the test-mode directory resolution (falls through to thetest_modesibling only when the plain directory has no metadata and the sibling exists). Runpytest test_autofit/aggregator/.scripts/features/interpolate.pyruns clean underPYAUTO_TEST_MODE=1with the patched library (no script edits expected under Option A); regenerate the notebook.ship_library), then the workspace follow-up once API impact is confirmed.Key Files
autofit/aggregator/aggregator.py—from_directory(currentlyos.walks the literal path)autofit/non_linear/paths/abstract.py—_test_mode_segment()/is_test_mode()to reuse../autofit_workspace/scripts/features/interpolate.py— the failing consumer (line 265)Notes / scope corrections from triage
tutorial_5_results_and_sampleswas paired with this in the original umbrella prompt but does not use the interpolator orAggregator.from_directory— excluded from this task.interpolate.pyis not currently in the workspace smoke set; the NEEDS_FIX markers named in the umbrella prompt are no longer literally in the files (curated from an earlier triage sweep).ell_comps/ellipse kwargs, plotter kwarg drift, group/slam PriorException,__hash__TypeError) stay parked in the umbrella prompt for follow-up tasks.Original Prompt
Click to expand starting prompt (umbrella — this issue scopes only the interpolator item)