Finding F-H8 in DEEP_ANALYSIS.md (parent #261).
Fitter.fit declares weights: Optional[np.ndarray] = None (fitter.py:276-278) and _precompute_reshaping passes None straight through. All three minimizers then do:
x, y, weights = np.asarray(x), np.asarray(y), np.asarray(weights)
if weights.shape != x.shape:
raise ValueError('Weights must have the same shape as x and y.')
np.asarray(None) is a 0-d object array, so the documented default call fitter.fit(x, y) always dies with a misleading shape error. Identical block in minimizer_lmfit.py:144-150, minimizer_bumps.py:148-160, minimizer_dfo.py:133-145.
Fix: default to np.ones_like(y) (or stop advertising Optional in three signatures + docstrings). Hoisting the triplicated validation into MinimizerBase is tracked separately.
Finding F-H8 in DEEP_ANALYSIS.md (parent #261).
Fitter.fitdeclaresweights: Optional[np.ndarray] = None(fitter.py:276-278) and_precompute_reshapingpassesNonestraight through. All three minimizers then do:np.asarray(None)is a 0-d object array, so the documented default callfitter.fit(x, y)always dies with a misleading shape error. Identical block inminimizer_lmfit.py:144-150,minimizer_bumps.py:148-160,minimizer_dfo.py:133-145.Fix: default to
np.ones_like(y)(or stop advertisingOptionalin three signatures + docstrings). Hoisting the triplicated validation intoMinimizerBaseis tracked separately.