Fix 120: Leading and trailing whitespace removed from sample position strings - #121
Open
dehoni wants to merge 3 commits into
Open
Fix 120: Leading and trailing whitespace removed from sample position strings#121dehoni wants to merge 3 commits into
dehoni wants to merge 3 commits into
Conversation
…before validation
|
|
||
| def do_trans(self, title=None, pos=None, thickness=None, dae=None, | ||
|
|
||
| def do_trans(self, title="", pos=None, thickness=1.0, dae="transmission", |
Member
There was a problem hiding this comment.
Did you intentionally include these changes to title= and thickness= and dae= parameters in do_sans and do_trans?
The changes are unrelated to the sample changer position-stripping logic and probably better belong in a separate change, if they are needed and wanted by all SANS instruments.
Contributor
Author
There was a problem hiding this comment.
Having no thickness might not play well with Mantid. The default is typically 1.0 if no other input is given. Also there were issues changing dae modes. This ensures that it always sets the default behaviour. You are right, it might be better in #122 .
They are introduced in Fix ISISNeutronMuon#122 as part of the expected default behaviour on ZOOM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
…before validation
Instrument(s)
All SANS instruments
Story/Acceptance criteria
As a user running do_sans or do_trans, I want that leading or trailing whitespace in sample position strings are ignored so that valid sample positions are still recognised and executed correctly.
Description of work
Updated sample position handling to strip leading and trailing whitespace from position strings before validation.
Issue/Ticket Reference
Fixes issues #120 #120
Tests
Describing the testing undertaken for this PR
To test
Existing behaviour for correctly formatted position strings is unchanged.
Sample position strings are corrected by removing leading and trailing whitespace before validation.
Inputs such as " 1CB" and "1CB " are treated as "1CB".
Invalid sample positions continue to be rejected after normalisation.
Position strings containing only whitespace remain invalid.
Code Review
Final Steps