-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed S(Q) fitting causes loss of function #3147
Comments
Thank you for this report @olihammond . This behaviour, or at least something similar, had been noted in the pre-release testing for 6.0.0 (see #3101). The problem was finding a reproducible way to track it down. |
The way to reproduce the issue:
|
Looks like this is a bumps issue, since the original assertion happens there.
However, we should not care whether the minimizer throws and just silently go on with unchanged dataset, in such case. |
It is worth noting that this issue did not occur when we tested the same with DREAM rather than Levenberg-Marquardt. And also that it's not just the sphere model that triggers it; I saw it with the ellipsoid and cylinder models, too. |
This fix seems to be working now with the sphere model we originally tested. However I have been testing it with more advanced models with a large number of free parameters and the issue is seen once again; see below errors thrown when attempting to fit using
At which point hitting
|
I am not able to reproduce the problem, using the sequence of operations mentioned above but with core shell cylinder + hayter_msa. I see that your error message mentions |
Describe the bug
Fitting with a structure factor can take a long time to converge, or can fail, due to a large number of free/correlated parameters. In this case the fit can be manually stopped by the user. Once the fit has been stopped, the fitting function is lost. The user must then either reselect the model, or resend the data to fit and start again, inputting all parameters repeatedly, to continue fitting their data. Several errors are printed following this:
10:39:08 - ERROR: can only concatenate str (not "method") to str Traceback (most recent call last): File "sas/sascalc/fit/BumpsFitting.py", line 403, in run_bumps File "bumps/fitters.py", line 970, in fit File "bumps/fitters.py", line 567, in solve File "bumps/mpfit.py", line 1223, in init TypeError: can only concatenate str (not "method") to str SVD did not converge Traceback (most recent call last): File "sas/sascalc/fit/BumpsFitting.py", line 423, in run_bumps File "bumps/fitters.py", line 1056, in cov File "bumps/lsqerror.py", line 277, in jacobian_cov File "numpy/linalg/linalg.py", line 1681, in svd File "numpy/linalg/linalg.py", line 121, in _raise_linalgerror_svd_nonconvergence numpy.linalg.LinAlgError: SVD did not converge === Steps: 5 of 200 chisq: 209 ETA: 2024-11-12 10:39 (2s from now) M15.background : 0.514 | M15.charge : 1e-06 | M15.length : 57.3 M15.radius : 4.44 | M15.volfraction : 0.153 |
10:39:08 - ERROR: Traceback (most recent call last): File "sas/qtgui/Perspectives/Fitting/FittingWidget.py", line 2123, in fitComplete IndexError: list index out of range
To Reproduce
Steps to reproduce the behavior:
Expected behavior
In the case of nonconvergence, one should be able to continue working from the state of the fitting parameters prior to the failed attempt. Once this error occurs one must either reload the file, or reselect the desired model and input the parameters once more, which is cumbersome.
Screenshots
If applicable, add screenshots to help explain your problem.
SasView version (please complete the following information):
Operating system (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: