Ticket #9484 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

MASKFILE Command Not Working in Batch Mode

Reported by: Peter Parker Owned by: Peter Parker
Priority: critical Milestone: Release 3.2
Component: SANS Keywords:
Cc: anders.markvardsen@… Blocked By:
Blocking: Tester: Anders Markvardsen

Description

Andrew Jackson has spotted that the MASKFILE command is not working correctly in Batch Mode -- the mask gets applied to the first reduction, but then is ignored in all further reductions.

The MASKFILE command uses a new way of storing settings, and I think the problem is that they are not copied across with the other settings when a fresh reducer is created.

Change History

comment:1 Changed 6 years ago by Peter Parker

Refs #9484 - Move the reduction settings stuff to its own file.

Changeset: 08008e0d47a6805dedc2c6ffb31db2eedd65a19d

comment:2 Changed 6 years ago by Peter Parker

Refs #9484 - Add some features to our settings object.

Changeset: 9227c964908cff0fe3fa37681bd17a885f92f05f

comment:3 Changed 6 years ago by Peter Parker

Refs #9484 - Carry settings across for each iteration in Batch mode.

Changeset: 6d6445f56eded079d7a40454f48dce34620e2ca9

comment:4 Changed 6 years ago by Peter Parker

Refs #9484 - Add system test to cover settings in Batch mode.

Changeset: 8fa7395a052c9f82efea0a75ecf8d1bec960c37a

comment:5 Changed 6 years ago by Peter Parker

Refs #9484 - Can't use context manager assert in older Python.

Changeset: d2843b4d9b931eb4ed69e49959131483c3fb1aaf

comment:6 Changed 6 years ago by Peter Parker

Refs #9484 - Do not load CSV or mask files in LoadLotsOfFiles test.

Changeset: c52257dd80b060d482d507b323f784c87088c425

comment:7 Changed 6 years ago by Peter Parker

  • Status changed from new to assigned

comment:8 Changed 6 years ago by Peter Parker

  • Status changed from assigned to verify
  • Resolution set to fixed

Remember to merge the system tests repo as well as the main repo.

To test:

The new system test covers the problem described in the ticket, so maybe a code review is all that is needed here. If you like, you can run the following script, which uses some of the new files added to the system test repo, and shows that the history for the first workspace produced by the batch is the same as the second workspace:

from ISISCommandInterface import *
from SANSBatchMode import *

SANS2D()
Set1D()
Detector("rear-detector")
# This contains two MASKFILE commands, each resulting in a seperate call to MaskDetectors.
MaskFile('MaskSANS2DReductionGUI_MaskFiles.txt')
Gravity(True)

# This does 3 seperate reductions of the same data, but saving the result of each to a different workspace.
csv_file = FileFinder.getFullPath('SANS2D_mask_batch.csv')
BatchReduce(csv_file, 'nxs', plotresults=False)

# Get a hold of each of the three results, and make sure they all have the same size
# history (i.e. check that MaskDetectors was called for all iterations.)  This failed
# before the changes made to this ticket.
it_1 = mtd["iteration_1"]
it_2 = mtd["iteration_2"]
assert it_1.getHistory().size() == it_2.getHistory().size()

comment:9 Changed 6 years ago by Anders Markvardsen

  • Status changed from verify to verifying
  • Tester set to Anders Markvardsen

comment:10 Changed 6 years ago by Anders Markvardsen

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/bugfix/9484_maskfile_command_not_working_in_batch_mode'

Full changeset: 0d39935384f0c374a79bb16bd2e32608ae4c7ce8

comment:11 Changed 6 years ago by Anders Markvardsen

Merge remote-tracking branch 'origin/bugfix/9484_mask_file_command_not_working_in_batch_mode'

Full changeset: d3682a69ce105d7208b92f026a507d9a6675977c

comment:12 Changed 6 years ago by Anders Markvardsen

Script returns same size history of 38

comment:13 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 10327

Note: See TracTickets for help on using tickets.