Closed ChAr-De closed 1 year ago
Just for clarification, you're talking about this line, right? https://github.com/pep-dortmund/toolbox-workshop/blob/52ed55a114bd64ee7b54bb734726023f388ba0f6/exercises-latex/13-python/curve_fit.py#L23
I would argue for something like this then (ll. 13-16):
if np.any(unp.std_devs(y) == 0):
sigma = None
abs_sigma = False
else:
sigma = unp.std_devs(y)
abs_sigma = True
And then changing https://github.com/pep-dortmund/toolbox-workshop/blob/52ed55a114bd64ee7b54bb734726023f388ba0f6/exercises-latex/13-python/curve_fit.py#L23 to
absolute_sigma=abs_sigma,
See this scipy issue. If we use the solution of the exercise without errors of the y parameter, the errors of the fit parameters are wrongly calculated. Maybe we should change the solution to also set
absolute_sigma=False
or add a comment to prevent the usage of the function if the input data has no errors.