-
Notifications
You must be signed in to change notification settings - Fork 41
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
Better checks on result object so failed fitting is shown as such. #3079
Better checks on result object so failed fitting is shown as such. #3079
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds better checks. If my concern regarding the results matrix has no merit, I say the code looks good. I haven't tested the functionality
@@ -1148,7 +1148,7 @@ def showFitResults(self, output_data): | |||
Show bumps convergence plots | |||
""" | |||
self.results_frame.setVisible(True) | |||
if output_data: | |||
if output_data and len(output_data) > 0 and len(output_data[0]) > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way output_data
can be a scalar quantity if it has any truthiness?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way
output_data
can be a scalar quantity if it has any truthiness?
Regardless of the failure/success, output_data
should always be a tuple, as passed from FitThread/compute
, so checking for the truthiness of it is probably unnecessary but maybe prudent.
Tested on Mac and getting error but maybe the one that is expected?
|
I think this is the correct message - something went wrong with the fit and the error message shows it, rather than the previous, cryptic |
Ok, in that case, I am merging it. |
Description
For some fitting failures, the result object is either None or an empty list. This causes unhandled behaviour and cryptic messages to the user.
Fixes #2994 (well, not actually fixes it but helps with diagnosis)
How Has This Been Tested?
Local Win10 build
Review Checklist:
[if using the editor, use
[x]
in place of[ ]
to check a box]Documentation (check at least one)
Installers
Licencing (untick if necessary)