Skip to content
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

Fix sum file behaviour for vesuvio diffraction #18927

Merged
merged 3 commits into from
Feb 23, 2017

Conversation

martyngigg
Copy link
Member

@martyngigg martyngigg commented Feb 20, 2017

Description of work.

To test:

Requires access to the ISIS archive.

The following scripts provides a basis for testing. When SumFiles=True there should be a group output with a single reduced workspace. When SumFiles=False there should be a workspace per input run.

VesuvioDiffractionReduction(InputFiles='15288,15289',
                        OutputWorkspace='DiffractionReductions',
                        SumFiles=True,
                        InstrumentParFile='IP0005.dat')

No issue number

Does not need to be in the release notes.


Reviewer

Please comment on the following (full description):

Code Review
  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards? Is it well structured with small focussed classes/methods/functions?
  • Are there unit/system tests in place? Are the unit tests small and test the a class in isolation?
  • If there are changes in the release notes then do they describe the changes appropriately?
Functional Tests
  • Do changes function as described? Add comments below that describe the tests performed?

  • How do the changes handle unexpected situations, e.g. bad input?

  • Has the relevant documentation been added/updated?

  • Is user-facing documentation written in a user-friendly manner?

  • Has developer documentation been updated if required?

  • Does everything look good? Comment with the ship it emoji but don't merge. A member of @mantidproject/gatekeepers will take care of it.

@martyngigg martyngigg added Indirect/Inelastic Issues and pull requests related to indirect or inelastic Patch Candidate Urgent issues that must be included in a patch following a release labels Feb 20, 2017
@martyngigg martyngigg added this to the Release 3.10 milestone Feb 21, 2017
@louisemccann
Copy link
Contributor

The example works as expected but entering a range of runs in the form 22668-22674 produces the following error:

RuntimeError: Workspace2D::getSpectrum, histogram number 196 out of range 196
  at line 148 in 'C:/Users/PKB22426/Documents/Build1/mantid/Framework/PythonInterface/plugins/algorithms\LoadVesuvio.py'
  caused by line 362 in 'C:/Users/PKB22426/Documents/Build1/mantid/Framework/PythonInterface/plugins/algorithms\LoadVesuvio.py'
  at line 107 in 'C:/Users/PKB22426/Documents/Build1/mantid/Framework/PythonInterface/plugins/algorithms\WorkflowAlgorithms\VesuvioDiffractionReduction.py'
  caused by line 44 in 'C:/Users/PKB22426/Documents/Build1/mantid/scripts/Inelastic\IndirectReductionCommon.py'
  caused by line 934 in 'C:\Users\PKB22426\Documents\Build1\Build\bin\Release\mantid\simpleapi.py'
  at line 4 in 'C:/Users/PKB22426/Documents/test4.py'
  caused by line 934 in 'C:\Users\PKB22426\Documents\Build1\Build\bin\Release\mantid\simpleapi.py'

@martyngigg
Copy link
Member Author

Thanks, @louisemccann. That should be fixed now.

@louisemccann
Copy link
Contributor

Input as a range and comma separated list work as expected. :shipit: once all tests pass

@martyngigg martyngigg added the High Priority An issue or pull request that if not addressed is severe enough to postponse a release. label Feb 22, 2017
@AndreiSavici
Copy link
Member

At some point consider refactoring

for run in user_input:
try:
number_generator = IntArrayProperty('array_generator', run)
single_files.extend(number_generator.value.tolist())
except RuntimeError as exc:
raise RuntimeError("Could not generate run numbers from '{0}': '{1}'".format(run, str(exc)))

It seems to me that IntArrayProperty will do the work for you, so you don't need to loop over pieces of the input string array
print(IntArrayProperty("array_generator","1-4, 7-11").value.tolist()) yields [1, 2, 3, 4, 7, 8, 9, 10, 11]

@AndreiSavici AndreiSavici merged commit 1a85f23 into master Feb 23, 2017
@AndreiSavici AndreiSavici deleted the fix_vesuvio_diffraction_file_summing branch February 23, 2017 15:37
@martyngigg
Copy link
Member Author

Good point. That would be much easier. Thanks.

martyngigg added a commit that referenced this pull request Feb 23, 2017
Fix sum file behaviour for vesuvio diffraction

(cherry picked from commit 636c029)

Fix summing multiple runs when specified as a range.

(cherry picked from commit d8f9795)

Fix ISISIndirectDiffractionReduction with VESUVIO monitors

(cherry picked from commit 410ce37)

Add patch release note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
High Priority An issue or pull request that if not addressed is severe enough to postponse a release. Indirect/Inelastic Issues and pull requests related to indirect or inelastic Patch Candidate Urgent issues that must be included in a patch following a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants