-
Notifications
You must be signed in to change notification settings - Fork 125
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 polarisation spin state to ISIS ORSO file metadata #38468
base: main
Are you sure you want to change the base?
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.
This is working really well for the majority of cases and the implementation is structured consistently with the rest of the code. Appropriate tests have been added. Great job getting to grips with the existing implementation on this one, there's a lot to get up to speed with.
The naming of datasets in the file currently isn't working for stitched polarised datasets. I've added some information below, but just let me know if you want to chat about this more and go through a demo of how to test this in the Reflectometry GUI.
I've also added a few suggestions from a maintainability/future-proofing perspective that might be worth considering.
Framework/PythonInterface/mantid/utils/reflectometry/orso_helper.py
Outdated
Show resolved
Hide resolved
Framework/PythonInterface/plugins/algorithms/SaveISISReflectometryORSO.py
Show resolved
Hide resolved
Framework/PythonInterface/plugins/algorithms/SaveISISReflectometryORSO.py
Outdated
Show resolved
Hide resolved
Framework/PythonInterface/plugins/algorithms/SaveISISReflectometryORSO.py
Outdated
Show resolved
Hide resolved
Framework/PythonInterface/mantid/utils/reflectometry/orso_helper.py
Outdated
Show resolved
Hide resolved
Framework/PythonInterface/test/python/mantid/utils/reflectometry/orso_helper_test.py
Outdated
Show resolved
Hide resolved
Framework/PythonInterface/test/python/plugins/algorithms/SaveISISReflectometryORSOTest.py
Show resolved
Hide resolved
Framework/PythonInterface/test/python/plugins/algorithms/SaveISISReflectometryORSOTest.py
Outdated
Show resolved
Hide resolved
…class, save the polarization in orso file if necessary
…add function to set polarization
0ce76df
to
568667b
Compare
…it is a polarized dataset
if self.is_polarized: | ||
self._name = f"{self._name} {self._spin_state}" | ||
return | ||
|
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.
if self.is_polarized: | |
self._name = f"{self._name} {self._spin_state}" | |
return | |
if self.is_polarized: | |
self._name = f"{self._name} {self._spin_state}" | |
return | |
Here I have decided to return early because if the dataset is polarized is not necessary to prepend the ws name for unique datasets and in some cases the ws name would be repeated.
I've built conda and standalone packages to test the Python Module. Everything seems to work correctly (tried on conda, windows and mac). I'll leave on draft as I still need to add a test for the module . |
Description of work
Explained in #36685
Summary of work
Fixes #36685.
Further detail of work
{workspace_name}{theta}{polarization}
.null
for files with polarization.To test:
Run the following script, a file named
corrected.ort
should be saved on your default save directory.Once the file is saved, open the file as text and check that the following entries are added on the instrument settings header before each data columns:
polarization:pp
,polarization:pm
,polarization:mp
,polarization:mm
Added release notes
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.