-
Notifications
You must be signed in to change notification settings - Fork 128
Add new output options to PlotPeakByLogValue algorithm and Sequetial Fit dialouge #39605
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
base: main
Are you sure you want to change the base?
Conversation
Sorry for taking so long to review this. I've just done some functional testing, and it's not clear to me what the numbers appended to each workspace are. You say in the PR that they are spectrum numbers. The range input into the table appears to be workspace index. If I do a range of 4:6, I see workspaces appended 3, 4 and 5. I would have expected 4, 5, 6. Are the numbers in the table in spectrum number, and the numbers appended to the workspace in workspace index? It makes sense to me to align these. |
Yes, the range in the table is workspace index, and numbers appended to the output names are the spectrum numbers. It is implemented like that because the |
I don't think this is working in that way. Intentionally or not, the numbers in the table are spectrum numbers. The logic is here:
The numbers then appended to the workspace are the workspace index. The tool tip in the SequentialFitDialog window is unclear, can we improve it? It references a numeric axes, which the underlying algorithm |
@MialLewis The sequential fit dialogue & tooltip appears to be written for several workspaces. For a single workspace with many spectra they are incomprehensible. Hence my request! |
Yes, you are correct, thanks for spotting that. I got confused and switched the two numbers. I will unify the number used in the interface with the one appended to the names. The tests were mainly written to test if the output names are correct, but I will add a test to cover the numeric axis case |
Currently in
|
37f9131
to
92d9204
Compare
92d9204
to
b5d312c
Compare
b2a71d1
to
c018f74
Compare
The PR is ready for review now (last commit is a typo fix). I have updated the description with new details as the implementation has changed a lot. It probably could have been better to split it into two PRs. I have discussed and agreed with Spencer about these new changes. |
Thw Windows failure on commit 9e59adf looks genuine. The docs one less so but am presuming the Windows one will require a new commit so it will re-run then. |
9e59adf
to
dae6be3
Compare
dae6be3
to
114b415
Compare
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.
In addition, I think the input for Range
needs to be validated, and I have noticed that for inputs such as 4-6
the algorithm seems to be stuck forever.
Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/PlotPeakByLogValueHelper.h
Outdated
Show resolved
Hide resolved
Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/PlotPeakByLogValueHelper.h
Show resolved
Hide resolved
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.
Thanks for the code changes. I have tested entering the range as -4:-2
which unfortunately crashed mantid
Description of work
This PR add two new options to the PlotPeakByLogValue algorithm that are enabled when the "CreateOutput" option is true. First option "AppendIdxToOutputName", appends the index of the corresponding output depending on which format is used in the input (either spectrum number, workspace index, or numeric value). This is enabled now by default for the sequential fit output. The second option, "Output2D", creates a 2D workspace of the results table, displaying the workspace index versus parameter value. This option groups the parameter results together to create a workspace index vs parameters
It also adds a new UI option to the Sequential fit dialogue to enable this new 2D option.
Fixes #39294
Further detail of work
The implementation involves enabling the
alwaysStoreInAds
option in the child Fit algorithms. It turned out that because this option was not enabled, the output workspace returned by the Fit algorithm was an empty string. This is why the output names are the same as the group workspace name, numbered by their position. One thing to note is that the final outputs seem to be duplicated using both the workspace names and workspace objects. This is because if you enablealwaysStoreInAds
, then the returned workspace objects from the algorithm will be null, and the only way to access the workspaces is from the ADS. In the case ofalwaysStoreInAds
being false, the returned workspaces will contain the actual workspace, but their names will be null. This is one of the drawbacks of using ADS vs not.To test:
1- Load any data (e.g. iris26176_graphite002_red)
2- Go to Plot Spectrum and click Fit
3- Add a peak (e.g. Lorentzian)
4- Press Sequential Fit, and a dialogue will open
5- Check the
Create Output
check box6- In the table view, set
Range
to any preferred workspace index range (e.g. 4-6)7- Press Fit
8- You will see 3 output group workspaces suffixed with "_Parameters", "_NormalisedCovarianceMatrices" and "_Workspaces"
9- Each group workspace will have the same number of spectra in the selected range
10- You can see that each workspace name includes the spectrum number and is suffixed with "_Parameters", "_NormalisedCovarianceMatrix" and "_Workspace" in each group, respectively (e.g. iris26176_graphite002_red_res_3_Parameters)
11- Try to enable the new "Output spectrum vs params" in the sequential fit dialogue, and a new output suffixed with "_ws" will appear. Plot the workspace, and it will contain a plot for each parameter.
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.