Updated cache bahaviour of Polaris script and how attributes are updated in InstrumentSettings to fix a bug found when making subsequent calls to focus #39024
+148
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of work
Updated cache behaviour of
Polaris
script and how attributes are updated inInstrumentSettings
to fix a bug found when making subsequent calls tofocus
method.Purpose of work
It has been found that, if you have already run
Polaris.focus
then subsequent calls tofocus
will use the last empty run specified (or if not specified previously then the default in the mapping file), regardless ofsample_empty
user supplies.Let's assume a, b, c, d are valid kwarg parameters for
focus
methodpolaris.focus(a=a1, b=b1, c=c1)
//kwargs a, b, c would become attributes of theInstrumentSettings
objectpolaris.focus(b=b2, d=d1)
//still attributes 'a' and 'c' passed at step 1) are attached toInstrumentSettings
object and affect the behaviourpolaris.focus(a=a1, b=b1, c=c1)
//kwargs a, b, c would become attributes of theInstrumentSettings
objectpolaris.focus(b=b2, d=d1)
//attributes 'a' and 'c' passed at step 1) are deleted fromInstrumentSettings
objectpolaris.focus(a=a2, c=c2)
//now attributes 'b' and 'd' are deleted from the InstrumentSettings objectNote - If any of the old kwargs found eligible to be deleted are available in the configuration file, they will rather be reinstated to their original values from the config file.
Fixes #38959.
Further detail of work
To test:
(1) Ask me for files
(2) Update paths in .yaml files
(3) Run this script
(4) Check the workspace history, the last call to the Minus algorithm should use a workspace derived from run 98532
(5) Call focus again without specifying sample_empty
(6) Raise the error
The PaalmanPings absorption method requires 'sample_empty' to be supplied.
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.