Commit bd26c0b
fix: stop passing dataset=None to fit_cls when sensitivity Job is complete
Job.perform() in autofit/non_linear/grid/sensitivity/job.py used to
short-circuit `dataset = None` when `is_complete` was True (commit
41095a0, Oct 2024 "skip simulation if job is complete") but still called
base_fit_cls / perturb_fit_cls with that None. Consumer Analysis classes
that unpack `dataset.data` / `dataset.noise_map` in __init__ — including
the user-facing autofit_workspace/scripts/features/sensitivity_mapping.py
tutorial — crash on re-runs with `AttributeError: 'NoneType' object has
no attribute 'data'`.
Always call simulate_cls. The expensive non-linear search is still skipped
on re-runs via Search.fit's load-from-zip path (paths.restore() unzips,
paths.is_complete returns True, result_via_completed_fit loads samples
from disk). Only the typically-cheap simulator cost is no longer
optimized away.
The library's own `test_perform_twice` test in
`test_autofit/non_linear/grid/test_sensitivity/test_functionality.py`
masked the contract issue because the test conftest's `Analysis.__init__`
simply stores `dataset` without unpacking — real workspace code unpacks
it eagerly.1 parent 6a86a88 commit bd26c0b
1 file changed
Lines changed: 4 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
166 | 163 | | |
167 | 164 | | |
168 | 165 | | |
| |||
0 commit comments