-
Notifications
You must be signed in to change notification settings - Fork 127
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
Add algorithm for calculating Wildes polarization efficiencies #37753
Add algorithm for calculating Wildes polarization efficiencies #37753
Conversation
b328da0
to
43a39bf
Compare
@rbauststfc please ignore the 200+ OSX test failures - problem with a machine. PR should run on a different machine next time you push a commit. |
43a39bf
to
ef350c7
Compare
👋 Hi, @rbauststfc, Conflicts have been detected against the base branch. Please rebase your branch against the base branch. |
ef350c7
to
536fa47
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.
Code looks really good, just a few very minor comments. Docs looking good, just a note on the See Also section.
Functionally tested using the provided script, which worked really well. Some further functional testing revealed an issue when either the OutputPolarizerEfficiency
or OutputAnalyzerEfficiency
workspace names are not provided. This only occurs in the algorithm dialog if it has been set to Keep open, run once with the flipper/polariser names set, and then run again with the names removed.
Error in execution of algorithm PolarizationEfficienciesWildes:
Add Data Object with empty name
Framework/Algorithms/src/PolarizationCorrections/PolarizationEfficienciesWildes.cpp
Outdated
Show resolved
Hide resolved
Framework/Algorithms/src/PolarizationCorrections/PolarizationEfficienciesWildes.cpp
Show resolved
Hide resolved
Framework/Algorithms/src/PolarizationCorrections/PolarizationEfficienciesWildes.cpp
Show resolved
Hide resolved
Includes inputs, outputs and validation, with unit tests
The algorithm uses private member variables that need to be cleared to prevent previously calculated values being returned if an instance of the algorithm is run twice. In addition, the algorithm provides some optional diagnostic output properties that we provide default values for. If the algorithm is being run as a child then these can incorrectly remain populated with previous values if we do not clear them when they are not required. It seems that setting the property value to it's current value (to deliberately retain any edits the user has made to that) is sufficient to clear the associated output workspace.
536fa47
to
b9643f4
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.
Changes to the code look good, functionally working well for multiple runs, documentation looking good. Nice work, happy to approve
Description of work
Summary of work
Adds new algorithm
PolarizationEfficienciesWildes
that calculates the polarization efficiencies for a two-flipper instrument setup according to the Wildes 2006 paper. This implementation is based on the implementation that POLREF are currently using in their reduction code.It is one of three algorithms that will be written under the linked issue.
Refs #35682.
Further detail of work
See linked issue for detailed description of what was required, and see the algorithm documentation (or the appropriate sections of the Wildes 2006 paper, as referenced in the linked issue) for the equations that have been implemented.
Note that the errors currently use the default Mantid errors. This is discussed on the main issue and, as stated there, we've agreed with our scientists that this is what should be done for the first version of this algorithm.
I will be adding a system test at a later stage (but before closing the linked issue), potentially for the whole workflow rather than specifically for this algorithm.
To test:
Build the
docs-html
target and check that the algorithm documentation renders OK and is understandable.The following script can be used to test the algorithm functionality:
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.