Skip to content

Conversation

adriazalvarez
Copy link
Contributor

@adriazalvarez adriazalvarez commented Aug 28, 2024

Description of work

Fixes the issue described in #37671 . Whenever new data is added to the data table in the Function (Q) tab of the QENS Fitting interface, the list of available fit functions in the fit property browser should be updated dynamically to show which functions are available to fit according to the data on the table. This should be updated also whenever data is removed from the table.

Summary of work

In order to add this feature, I have added a virtual function to the FitDataPresenter class that is redefined in the derived classes (in this case FunctionQDataPresenter) and that updates the available functions list from the remove handle in the FitTab class when the signal for removing data is sent.
I have refactored the function chooseFunctionQFunctions on the FunctionQDataPresenter to be able to update properly when data is removed from the table (it was only implemented for added data).

Fixes #37671 .

Further detail of work

To test:

Follow the test instructions of #37671, making sure now that the available functions are updated appropiately (the available functions for EISF data all start with the prefix EISF).


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 ISIS: Spectroscopy Issue and pull requests relating to Muons, Indirect and Inelastic at ISIS Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) Reported By User Issues that were found or highlighted by a user/scientist GUI Issues and pull requests specific to the Mantid Workbench GUI. labels Aug 28, 2024
@adriazalvarez adriazalvarez added this to the Release 6.11 milestone Aug 28, 2024
@adriazalvarez adriazalvarez marked this pull request as ready for review August 28, 2024 13:10
Copy link
Contributor

@MohamedAlmaki MohamedAlmaki left a comment

Choose a reason for hiding this comment

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

When adding both width and ESIF spectra and then deleting the ESIF spectra, the fit functions remain as "all" instead of just the "Width" functions. However, deleting the width spectra works fine and the functions are updated with just "ESIF" functions. Also, adding just "Width" spectra works fine and updates the function list with just the "Width" list

@robertapplin robertapplin force-pushed the fix_functionq_available_function_not_updating_properly branch from 46cf9fb to f7d684a Compare September 12, 2024 09:44
@robertapplin
Copy link
Contributor

Thanks for testing this @MohamedAlmaki. It should be ready for another look!

@MohamedAlmaki
Copy link
Contributor

Thanks for the changes, it works as expected now. I will approve once the CI is green, I think these failures are unrelated the PR

@MohamedAlmaki
Copy link
Contributor

@robertapplin there is a minor sign warning issue, could you please fix it

@robertapplin robertapplin force-pushed the fix_functionq_available_function_not_updating_properly branch from f65b792 to 94dbd25 Compare September 12, 2024 12:21
@thomashampson
Copy link
Contributor

disabled auto-merge so this doesn't miss out on getting in to release-next

MohamedAlmaki
MohamedAlmaki previously approved these changes Sep 12, 2024
Copy link
Contributor

@MohamedAlmaki MohamedAlmaki left a comment

Choose a reason for hiding this comment

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

Happy to approve, thanks for the changes

@jclarkeSTFC jclarkeSTFC changed the base branch from main to release-next September 12, 2024 15:14
@jclarkeSTFC jclarkeSTFC dismissed MohamedAlmaki’s stale review September 12, 2024 15:14

The base branch was changed.

@RichardWaiteSTFC RichardWaiteSTFC self-assigned this Sep 12, 2024
@robertapplin robertapplin merged commit 0a30598 into release-next Sep 12, 2024
10 checks passed
@robertapplin robertapplin deleted the fix_functionq_available_function_not_updating_properly branch September 12, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) GUI Issues and pull requests specific to the Mantid Workbench GUI. ISIS: Spectroscopy Issue and pull requests relating to Muons, Indirect and Inelastic at ISIS Reported By User Issues that were found or highlighted by a user/scientist
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

EISF and Width functions are all available after removing last Width or EISF
5 participants