Skip to content

Conversation

adriazalvarez
Copy link
Contributor

Description of work

The issue is explained in #38204 : parameters for exponential correction were not being correctly retrieved when in autodetect mode, as the instrument parameters were being retrieved as string, but in the case of the exponential parameters, these are better retrieved as numbers. On the other hand, the polynomial parameters have the flexibility of being input as a double list or string with comma separated values for the parameters.

Additional changes:

  • I have re-set the value of the correction parameters in the calling algorithm ReflectometryReductionOneAuto.
  • I have added two tests to check that the correction parameters are being properly called in AutoDetect mode both for exponential corrections and polynomial corrections.

Summary of work

Fixes #38204

Further detail of work

To test:


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.

@adriazalvarez adriazalvarez added Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) Reflectometry Issues and pull requests related to reflectometry ISIS: LSS Issue and pull requests relating to SANS and Reflectometry (Large Scale Structures) at ISIS labels Nov 25, 2024
@adriazalvarez adriazalvarez added this to the Release 6.12 milestone Nov 25, 2024
@adriazalvarez adriazalvarez marked this pull request as ready for review November 25, 2024 14:44
@rbauststfc rbauststfc self-assigned this Nov 28, 2024
Copy link
Contributor

@rbauststfc rbauststfc left a comment

Choose a reason for hiding this comment

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

I've tested the changes using both an INTER (polynomial correction) and SURF (exponential correction) example and both are working really well - the correct algorithm is selected and the parameters are looked up successfully from the parameter file.

Just a small thing I noticed (sorry, I couldn't seem to add a comment on the specific line because it's outside the changes in the PR) - the error message on line 610 refers to polynomial correction, but I think the error could technically have been thrown for either correction. It looks like this wasn't made more generic when the exponential correction was added in, so could we update this while we're here?

It's really great to have some tests added to cover this functionality. I've just included a comment to think about how we might make these robust against any future changes in instrument parameter file settings.

@adriazalvarez
Copy link
Contributor Author

adriazalvarez commented Dec 2, 2024

Thanks for the careful review and the useful tips.
I have changed the throw error message to refer to Algorithmic correction instead of just Polynomial correction.

Copy link
Contributor

@rbauststfc rbauststfc left a comment

Choose a reason for hiding this comment

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

Thanks very much for investigating using a test parameter file in the unit tests, it's great to have that working and it should hopefully help to make the test more robust over the long-term. It looks like there's an import in the unit test file that's left over from before the recent changes that I think we could remove, but otherwise all the code changes are looking really good!

I think the CI failures are unrelated to your changes, there seem to be failures on a few PRs, so I'll flag to the Dev Ops team just in case.

Copy link
Contributor

@rbauststfc rbauststfc left a comment

Choose a reason for hiding this comment

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

Thanks very much Adrian for your hard work getting the test parameter file to work in the unit tests. All the code changes are looking good, the fix is working well and all review comments have been addressed, so this looks good to go in. 👍

@SilkeSchomann SilkeSchomann self-assigned this Dec 3, 2024
@SilkeSchomann SilkeSchomann merged commit 5993c0e into main Dec 3, 2024
10 checks passed
@SilkeSchomann SilkeSchomann deleted the correction_params branch December 3, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) ISIS: LSS Issue and pull requests relating to SANS and Reflectometry (Large Scale Structures) at ISIS Reflectometry Issues and pull requests related to reflectometry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReflectometryReductionOneAuto fails to look up exponential algorithm parameters
3 participants