1999: Clip fitting values set outside the fit range #2422
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
As described in bumps/bumps#58 and #1999, when the initial fit values are set outside the fitting bounds, the MPFit (L-M) and Quasi-Newton fitters fail to converge and may throw errors. This utilizes the bumps
FitDriver.clip()
feature to coerce the initial values within the bounds prior to fitting. A warning is logged when any values are coerced.Fixes #1999
This fix should also be added to v5.0.6 once it's reviewed.
How Has This Been Tested?
Run SasView, select the L-M (MPFit) optimizer, load a data set, send it to fitting, and select a model. From there, I tried 2 different things
Select the modified fit parameter to be fit and run the fit.
Previously, the fit would fail with an assertion error. Now the fit succeeds and a warning message is given.
I did not test the Quasi-Newton optimizer.
Review Checklist (please remove items if they don't apply):