Summary
src/easyreflectometry/summary/summary.py:317 reads getattr(self._project, '_last_fit_results', None), but nothing in the codebase ever sets _last_fit_results (verified by grep over src/). _compute_goodness_of_fit therefore always returns 'N/A' in the generated report. The fit results live on Project.fitter / MultiFitter but were never wired to the attribute the summary reads.
Even if wired, the single-result branch reads .reduced_chi2, while fitting.py:152 deliberately probes both reduced_chi and reduced_chi2 because the attribute name varies across minimizers — the summary needs the same dual probe.
Suggested fix
Have the fit path store results on the project (or have the summary read them from project.fitter), apply the dual attribute probe, and add a test asserting a non-'N/A' goodness-of-fit after a successful fit.
Related cosmetic: template token num_constriants (sic) in summary/html_templates.py:144 / summary.py:312.
Found during deep code review (DEEP_ANALYSIS.md §5.9).
Summary
src/easyreflectometry/summary/summary.py:317readsgetattr(self._project, '_last_fit_results', None), but nothing in the codebase ever sets_last_fit_results(verified by grep oversrc/)._compute_goodness_of_fittherefore always returns'N/A'in the generated report. The fit results live onProject.fitter/MultiFitterbut were never wired to the attribute the summary reads.Even if wired, the single-result branch reads
.reduced_chi2, whilefitting.py:152deliberately probes bothreduced_chiandreduced_chi2because the attribute name varies across minimizers — the summary needs the same dual probe.Suggested fix
Have the fit path store results on the project (or have the summary read them from
project.fitter), apply the dual attribute probe, and add a test asserting a non-'N/A' goodness-of-fit after a successful fit.Related cosmetic: template token
num_constriants(sic) insummary/html_templates.py:144/summary.py:312.Found during deep code review (DEEP_ANALYSIS.md §5.9).