-
Notifications
You must be signed in to change notification settings - Fork 128
Add polarisation spin state to ISIS ORSO file metadata #38468
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
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
Outdated
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
0ce76df
to
568667b
Compare
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 . |
…class, save the polarization in orso file if necessary
…add function to set polarization
…it is a polarized dataset
14c696f
to
adaaa8f
Compare
For the moment I'll add a v6.12 milestone to this. It can always be changed if it looks like it won't get in by 16th January. |
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.
Great job getting the import of the C++ constants to work, it's really nice for maintainability to be able to re-use those on the Python side too! Functionally the changes are all working really well for stitched and non-stitched datasets, and for workspace groups with and without polarisation corrections. 👍
I've added just a few minor comments, mostly just a couple of places where we might be able to make use of the log name constant. I've also suggested a slightly different update to the documentation about the dataset names, now that the logic for that has changed a little bit.
Framework/PythonInterface/plugins/algorithms/SaveISISReflectometryORSO.py
Outdated
Show resolved
Hide resolved
Framework/PythonInterface/test/python/plugins/algorithms/SaveISISReflectometryORSOTest.py
Outdated
Show resolved
Hide resolved
Framework/PythonInterface/test/python/plugins/algorithms/SaveISISReflectometryORSOTest.py
Show resolved
Hide resolved
Framework/PythonInterface/test/python/mantid/utils/reflectometry/polarization_helpers_test.py
Outdated
Show resolved
Hide resolved
Framework/Reflectometry/test/ReflectometryReductionOneAuto3Test.h
Outdated
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.
All code review comments have been addressed. The code changes are looking good and working really well, with appropriate test coverage. Thanks very much for all your work on this @adriazalvarez!
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.