[fix] Corrected an error message (#257)

Co-authored-by: Simon Kuberski <simon.kuberski@cern.ch>
This commit is contained in:
s-kuberski 2025-02-13 19:43:56 +01:00 committed by GitHub
parent 7eabd68c5f
commit 6ed6ce6113
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -293,7 +293,7 @@ def least_squares(x, y, func, priors=None, silent=False, **kwargs):
if len(key_ls) > 1:
for key in key_ls:
if np.asarray(yd[key]).shape != funcd[key](np.arange(n_parms), xd[key]).shape:
raise ValueError(f"Fit function {key} returns the wrong shape ({funcd[key](np.arange(n_parms), xd[key]).shape} instead of {xd[key].shape})\nIf the fit function is just a constant you could try adding x*0 to get the correct shape.")
raise ValueError(f"Fit function {key} returns the wrong shape ({funcd[key](np.arange(n_parms), xd[key]).shape} instead of {np.asarray(yd[key]).shape})\nIf the fit function is just a constant you could try adding x*0 to get the correct shape.")
if not silent:
print('Fit with', n_parms, 'parameter' + 's' * (n_parms > 1))