Finding F-H7 in DEEP_ANALYSIS.md (parent #261).
src/easyscience/fitting/sampler.py:299-306:
wrapped = self._fitter._fit_function_wrapper(x_new, flatten=True) # MultiFitter mutates _fit_function here
original_fit_func = self._fitter.fit_function # captures the LAST dataset's function
MultiFitter._fit_function_wrapper (multi_fitter.py:61-63) loops self._fit_function = this_fun, so after the loop _fit_function is the last dataset's function. Fitter.fit captures before wrapping (correct order, fitter.py:299-300); Sampler._run does it backwards. With >= 2 datasets the finally restore installs the wrong function and corrupts subsequent fitter.fit() / evaluate() calls. Single-dataset tests cannot see this.
Fix: capture fit_function before calling _fit_function_wrapper. Add a 2-dataset MultiFitter sampling test.
Finding F-H7 in DEEP_ANALYSIS.md (parent #261).
src/easyscience/fitting/sampler.py:299-306:MultiFitter._fit_function_wrapper(multi_fitter.py:61-63) loopsself._fit_function = this_fun, so after the loop_fit_functionis the last dataset's function.Fitter.fitcaptures before wrapping (correct order,fitter.py:299-300);Sampler._rundoes it backwards. With >= 2 datasets thefinallyrestore installs the wrong function and corrupts subsequentfitter.fit()/evaluate()calls. Single-dataset tests cannot see this.Fix: capture
fit_functionbefore calling_fit_function_wrapper. Add a 2-dataset MultiFitter sampling test.