Skip to content
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

Prevent warnings when adding data from dialogs in QENS fitting interface #37223

Merged
merged 3 commits into from May 1, 2024

Conversation

adriazalvarez
Copy link
Contributor

@adriazalvarez adriazalvarez commented Apr 25, 2024

Description of work

This PR fixes a warning that can appear whenever data is being loaded from dialogs in all tabs of QENS fitting interface. Even if the data is taking a long time to load, it is still possible to click on the Add button of the dialog window, which will cause the interface to try to act on the data while is being loaded on the ADS, thus creating warnings or crashes.
The solution I have adopted to fix this undesired behaviour from the dialogs is to emit a signal from the Data Selector widget when it autoloads the data. This signal can then by received by the dialog interface to disable the Add button (and change its text) until the loading of the data is finished.
However, there are still problems with the dialogs:

  • If the dialog window is closed while the data is being loaded, this will create a crash in Mantid (this is not happening due to the changes on this PR, it's a current issue with the dialogs).
  • Interface can still freeze while the data is being loaded if trying to interact with it.

A more fitting solution would be to implement a manager class for the loading algorithm in a different thread with which we can communicate (#37184). There are plans to implement that solution for Mantid 6.11. But I still think emitting a signal from the selector widget when it is auto-loading may be a good inclusion. And disabling the button helps the users understand what is happening with the data.

Summary of work

Fixes #37185 .

Further detail of work

To test:


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

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

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.

@adriazalvarez adriazalvarez added Indirect/Inelastic Issues and pull requests related to indirect or inelastic ISIS Team: Spectroscopy Issue and pull requests managed by the Spectroscopy subteam at ISIS labels Apr 26, 2024
@adriazalvarez adriazalvarez added this to the Release 6.10 milestone Apr 26, 2024
@adriazalvarez adriazalvarez marked this pull request as ready for review April 26, 2024 07:34
Copy link
Contributor

@RichardWaiteSTFC RichardWaiteSTFC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, had to add a breakpoint in Load to see the button being greyed out as loading the file was very quick! In python one might add/update a unit test to assert this new signal has been emitted but maybe that's difficult in C++? Happy to approve without!

@SilkeSchomann SilkeSchomann merged commit 7fa3564 into main May 1, 2024
9 checks passed
@SilkeSchomann SilkeSchomann deleted the 37185_fqfit_warning branch May 1, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Indirect/Inelastic Issues and pull requests related to indirect or inelastic ISIS Team: Spectroscopy Issue and pull requests managed by the Spectroscopy subteam at ISIS
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

F(Q) Fit warnings after adding data multiple times
3 participants