-
Notifications
You must be signed in to change notification settings - Fork 128
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
Common code in IntegratePeaksSkew, IntegratePeaksShoeboxTOF, FindSXPeaksConvolve, IntegratePeaks1DProfile algorithms moved to a utility module #38789
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.
Thanks for this, really appreciate it, been on the backlog for a while!
No unit test5s required changing so that's promising!
Just a couple of suggestions:
- I wonder whether it would be possible to have the
IntegratePeaksSkew
method have aPeakDataSkew
class that inherits fromPeakData
and then has additional skew-specific methods associated with it (e.g.plot_integrated_peak
) - such that only the methods common to all algorithms are in thepeakdata_utils
does that make sense? - There's some
InstrumentArrayConverter
tests in unit tests forIntegratePeaksSkew
e.g.
mantid/Framework/PythonInterface/test/python/plugins/algorithms/IntegratePeaksSkewTest.py
Line 439 in 024daa6
def test_array_converter_finds_adjacent_banks_to_left_for_component_array_detectors(self):
would it be possible to move these to a unit test file forpeakdata_utils
?
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.
Looks good to me thanks for the changes! I tested all the algorithms touched by this and everything works. Do you need to update any of the CNN stuff in the script repo after this gets merged?
Thanks for checking! For the CNN work, required changes(when data is simulated) are in a sub branch and not in |
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.
Looks good to go, I just suggested a small fix for the release note.
docs/source/release/v6.13.0/Framework/Algorithms/Bugfixes/36989.rst
Outdated
Show resolved
Hide resolved
…9.rst Co-authored-by: James Clarke <139879523+jclarkeSTFC@users.noreply.github.com>
Many thanks for noting this! |
Description of work
A code refactoring was performed by extracting a bunch of common code inside a few peak integration algorithms into a common module named
peakdata_utils
.Now those algorithms can import such utility code from the new module rather than importing directly from other algorithms. This PR makes sure that code inside
IntegratePeaksSkew
,IntegratePeaksShoeboxTOF
,FindSXPeaksConvolve
, andIntegratePeaks1DProfile
would only contain the code specific to each algorithm and utility functions related to peak integration would be imported from the newly introduced utility module.Fixes #36989.
Further detail of work
To test:
There should be NO functional changes in the below peak integration algorithms and they should work exactly as they did before.
IntegratePeaksSkew
IntegratePeaksShoeboxTOF
FindSXPeaksConvolve
IntegratePeaks1DProfile
A release note was added to notify about the update required in import paths in any external scripts if those utility classes are being used directly.
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.