isis_powder generate_run_numbers() support plus signs in filename list#40833
Merged
SilkeSchomann merged 1 commit intorelease-nextfrom Feb 10, 2026
Merged
isis_powder generate_run_numbers() support plus signs in filename list#40833SilkeSchomann merged 1 commit intorelease-nextfrom
SilkeSchomann merged 1 commit intorelease-nextfrom
Conversation
RichardWaiteSTFC
requested changes
Feb 9, 2026
Contributor
There was a problem hiding this comment.
Maybe I'm doing something wrong - but I get the following error for the run number string "139966,139970-139973"
AttributeError: 'tuple' object has no attribute 'strip'
File "C:\mantid-conda\mantid\scripts\Diffraction\isis_powder\routines\common.py", line 295, in get_first_run_number
run_numbers = generate_run_numbers(run_number_string=run_number_string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\mantid-conda\mantid\scripts\Diffraction\isis_powder\routines\common.py", line 208, in generate_run_numbers
run_number_string = run_number_string.strip()
But when I call the function directly it seems to work...
generate_run_numbers("139966,139970-139973")
Out[2]: [139966, 139970, 139971, 139972, 139973]
Also I think there could be a unit test in this file
Contributor
Author
Are you sure you don't have something like: Also, with a comma, it will still fail in |
In the isis powder POLARIS script, the focus method need to get a flat list of all the file included in a filename string. It does not need the full filename parsing that exists in Load, so it has its own simple implementation. For this comma and plus operators are equivalent.
fc92296 to
8b8d7e8
Compare
RichardWaiteSTFC
approved these changes
Feb 10, 2026
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.
For POLARIS total scattering it is sometimes useful to sum non consecutive runs, e.g.
146554+146603or146554+146603-146609. This PR ensures that the POLARIS scripts can handle the plus operator to matchLoadbehaviour.Description of work
In the ISIS powder POLARIS script, the focus method need to get a flat list of all the file included in a filename string. It does not need the full filename parsing that exists in Load, so it has its own simple implementation. For this comma and plus operators are equivalent.
Converts '+' to ',' so that the existing parsing in
IntArrayPropertywill work correctly.Adds tests
Closes #40648
To test:
Test script at:
#40648 (comment)
If it succeeds it will generate a workspace called test
Reviewer
Your comments will be used as part of the gatekeeper process. Comment clearly on what you have checked and tested during your review. Provide an audit trail for any changes requested.
As per the review guidelines:
mantid-developersormantid-contributorsteams, add a review commentrerun cito authorize/rerun the CIGatekeeper
As per the gatekeeping guidelines: