lmfit / lmfit-py

Non-Linear Least Squares Minimization, with flexible Parameter settings, based on scipy.optimize, and with many additional classes and methods for curve fitting.
https://lmfit.github.io/lmfit-py/
Other
1.06k stars 274 forks source link

Typo in _buildmodel dict restore (Fixes #956) #957

Closed stuart-cls closed 4 months ago

stuart-cls commented 4 months ago

Description

Correct typo in _buildmodel dict restore (Fixes #956)

The issue only manifested on Voigt and SkewedVoigt models for me, not sure if you want to change the test_model_saveload.test_save_load_model code just to catch this.

Type of Changes
Tested on

lmfit: 1.3.1.post0+g3cfd09a.d20240510, scipy: 1.13.0, numpy: 1.26.4, asteval: 0.9.32, uncertainties: 3.1.7

Verification

Have you

reneeotten commented 4 months ago

thanks for the fix @stuart-cls. It would certainly be good if this was discovered by our test-suite, so I would be in favor of adding/expanding the current tests to cover all built-in models. If you'd be willing to add that to this PR that would be great. If not, that's also fine and I would be okay with merging this PR - we can expand the tests in a follow-up.

newville commented 4 months ago

@stuart-cls Thanks - I'm a little surprised our existing tests did not catch that. But I agree with @reneeotten that we can make sure this gets tested better.

This is simple / clear enough that we can just merge this. Thanks!