Skip to content

Commit

Permalink
Merge pull request #395 from pep-dortmund/fix_ucurve_fit
Browse files Browse the repository at this point in the history
Fix ``ucurve_fit`` function in latex exercises 13-python [Closes #394]
  • Loading branch information
maxnoe authored Nov 23, 2023
2 parents 52ed55a + 1caf9d7 commit e18c772
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion exercises-latex/13-python/curve_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ def ucurve_fit(f, x, y, **kwargs):
"""
if np.any(unp.std_devs(y) == 0):
sigma = None
abs_sigma = False
else:
sigma = unp.std_devs(y)
abs_sigma = True

popt, pcov = scipy.optimize.curve_fit(
f,
x,
unp.nominal_values(y),
sigma=sigma,
absolute_sigma=True,
absolute_sigma=abs_sigma,
**kwargs,
)

Expand Down

0 comments on commit e18c772

Please sign in to comment.