-
Notifications
You must be signed in to change notification settings - Fork 128
Fix plot crash on negative errors #37984
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
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.
Nevermind all good
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.
Tested according to test instructions and read the code. Works well.
Sorry, a quick question before merging this one in - the linked issue has a comment in the description: "Need a second opinion on this: Do we then attempt to plot the data but taking the absolute positive value of the errors?". This PR has gone with the option to plot the absolute positive value of the errors, and I was just wondering how we came to that final decision? |
I was thinking, a) this is a very rare scenario and b) there is not currently a good mechanism for 'rejecting' a plot; not try catch around the complicated plotting process etc. I thought, since this is a very unlikely problem, the simple option rather than the complex one was better. |
Thanks for the explanation @jhaigh0, can definitely see where you're coming from, particularly if it's complicated to reject plotting altogether! Although this is a rare scenario, what concerns me slightly is if a user could quite easily miss the warning message in the messages pane and then could end up slightly misled about their error values because converting them to positive makes them look like valid errors. I've had a quick chat with Richard to try and get a science perspective on this and his opinion was that if the error is negative then it's garbage and should probably be set to null value (which may be |
Further to the above, it is possible that taking the |
okay understood, I will try to change it to plot without errors + a warning in this case. |
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.
Following the discussion above, I tested based on the coding instructions and it works well. The updated code does not take the the abs
of the error anymore.
Description of work
Fix crash in the case of plotting data with negative errors.
Instead, print a warning and plot without errors.
Fixes #37973
To test:
Load this data with negative errors
BCA299_Subt_QLd_Result.zip
Plot Spectra with errors 6-8
Should see a warning printed but plot opens normally.
Reviewer
Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.
Code Review
Functional Tests
Does everything look good? Mark the review as Approve. A member of
@mantidproject/gatekeepers
will take care of it.Gatekeeper
If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.