Skip to content

Conversation

RichardWaiteSTFC
Copy link
Contributor

@RichardWaiteSTFC RichardWaiteSTFC commented Oct 2, 2024

Description of work

Add missing plugins.algorithms to imports in SX peak integration algorithms - causing errors such as this on opening nightly
on IDAaaS

Python-[Warning] Failed to load plugin /mnt/ceph/home/rw1061637/.conda/envs/mantid-unstable/plugins/python/algorithms/FindSXPeaksConvolve.py.Error: Traceback (most recent call last):  File "/home/rw1061637/.conda/envs/mantid-unstable/lib/python3.10/site-packages/mantid/kernel/plugins.py", line 187, in load_from_file    name, module = load_plugin(filepath)  File "/home/rw1061637/.conda/envs/mantid-unstable/lib/python3.10/site-packages/mantid/kernel/plugins.py", line 208, in load_plugin    module = loader.run()  File "/home/rw1061637/.conda/envs/mantid-unstable/lib/python3.10/site-packages/mantid/kernel/plugins.py", line 47, in run    return SourceFileLoader(name, pathname).load_module()  File "<frozen importlib._bootstrap_external>", line 548, in _check_name_wrapper  File "<frozen importlib._bootstrap_external>", line 1063, in load_module  File "<frozen importlib._bootstrap_external>", line 888, in load_module  File "<frozen importlib._bootstrap>", line 290, in _load_module_shim  File "<frozen importlib._bootstrap>", line 719, in _load  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked  File "<frozen importlib._bootstrap_external>", line 883, in exec_module  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed 
File "/mnt/ceph/home/rw1061637/.conda/envs/mantid-unstable/plugins/python/algorithms/FindSXPeaksConvolve.py", line 27, in <module>    from IntegratePeaksSkew import InstrumentArrayConverter, get_fwhm_from_back_to_back_paramsImportError: cannot import name 'get_fwhm_from_back_to_back_params' from 'IntegratePeaksSkew'

Ultimately I plan to refactor this to remove such imports by putting the common code in a separate file as part of #36989

There is no associated issue.

To test:

(1) CI passes
(2) Run this script without error

Load(Filename='/mnt/ceph/home/rw1061637/TrainingCourseData/SXD23767.raw', OutputWorkspace='SXD23767')
FindSXPeaksConvolve(InputWorkspace='SXD23767', PeaksWorkspace='peaks', GetNBinsFromBackToBackParams=True, NFWHM=6)
IntegratePeaks1DProfile(InputWorkspace='SXD23767', PeaksWorkspace='peaks', OutputWorkspace='peaks_int_profile', GetNBinsFromBackToBackParams=True, NFWHM=6, CostFunction='RSq', FixPeakParameters='A')
IntegratePeaksShoeboxTOF(InputWorkspace='SXD23767', PeaksWorkspace='peaks', OutputWorkspace='peaks_int_shoe', GetNBinsFromBackToBackParams=True, NFWHM=6, WeakPeakStrategy='NearestStrongPeak')

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.

@RichardWaiteSTFC RichardWaiteSTFC added ISIS: Diffraction Issue and pull requests relating to Diffraction at ISIS ISIS: Core Issue and pull requests at ISIS that relate to Core features and functions labels Oct 2, 2024
@RichardWaiteSTFC RichardWaiteSTFC added this to the Release 6.11 milestone Oct 2, 2024
@jclarkeSTFC jclarkeSTFC self-assigned this Oct 3, 2024
Copy link
Contributor

@jclarkeSTFC jclarkeSTFC left a comment

Choose a reason for hiding this comment

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

Script ran fine on an Ubuntu build, no errors, I used the version of the SXD run from the archive instead of the training data, but I don't think that makes any difference.

There were a couple of warnings about invalid values in sqrt and divide, but that's unrelated to this PR.

@rbauststfc rbauststfc self-assigned this Oct 3, 2024
@rbauststfc rbauststfc merged commit 7e97dcf into release-next Oct 3, 2024
10 checks passed
@rbauststfc rbauststfc deleted the fix_imports_in_sx_peak_integration_algs branch October 3, 2024 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ISIS: Core Issue and pull requests at ISIS that relate to Core features and functions ISIS: Diffraction Issue and pull requests relating to Diffraction at ISIS
Projects
Status: Merged
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants