Ticket #3284 (closed: invalid)

Opened 9 years ago

Last modified 5 years ago

Add a test for MergeCalFiles

Reported by: Nick Draper Owned by: Nick Draper
Priority: major Milestone: Release 2.6
Component: Framework Keywords:
Cc: Blocked By:
Blocking: Tester: Mathieu Doucet

Description

There is no automated test for this algorithm. Here is a possible test script.

The last 2 calls in this test script fail with "Unknown exception":

CreateGroupingWorkspace(InstrumentName="PG3",GroupNames="bank124,bank144,bank164,bank184",OutputWorkspace="pg3_group")
LoadCalFile(InputWorkspace="pg3_group",CalFilename="/home/8oz/Code/Mantid/Test/AutoTestData/pg3_mantid_det.cal",MakeGroupingWorkspace="0",MakeMaskWorkspace="0",WorkspaceName="pg3")

w = mtd["pg3_offsets"]
for y in xrange(10000):
	w.dataY(y)[0] = y*0.00001
	
SaveCalFile(OffsetsWorkspace="pg3_offsets", Filename="pg3_offsets.cal")
SaveCalFile(GroupingWorkspace="pg3_group", Filename="pg3_group.cal")

def check_result():
		LoadCalFile(InstrumentName="pg3", CalFilename="pg3_merged.cal", WorkspaceName="pg3_merged", MakeGroupingWorkspace=1, MakeOffsetsWorkspace=1)
		print CheckWorkspacesMatch("pg3_offsets", "pg3_merged_offsets", Tolerance=1e-5)

MergeCalFiles(UpdateFile="pg3_offsets.cal", MasterFile="pg3_group.cal", OutputFile="pg3_merged.cal", MergeGroups=0, MergeOffsets=1, MergeSelections=0)
check_result()

for mergeGroups in [0, 1]:
	for  mergeSelections in [0, 1]:
		MergeCalFiles(UpdateFile="pg3_offsets.cal", MasterFile="pg3_group.cal", OutputFile="pg3_merged.cal", MergeGroups=mergeGroups, MergeOffsets=1, MergeSelections=mergeSelections)
		check_result()


# These fail with UNKNOWN exception!
MergeCalFiles(UpdateFile="pg3_group.cal", MasterFile="pg3_offsets.cal", OutputFile="pg3_merged.cal", MergeGroups=1, MergeOffsets=0, MergeSelections=0)
MergeCalFiles(UpdateFile="pg3_group.cal", MasterFile="pg3_offsets.cal", OutputFile="pg3_merged.cal", MergeGroups=1, MergeOffsets=0, MergeSelections=1)

Change History

comment:1 Changed 9 years ago by Owen Arnold

For reference see #3198. Janik raised the need for a test script.

comment:2 Changed 9 years ago by Nick Draper

  • Status changed from new to assigned
  • Owner set to Robert Whitley

comment:3 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 30 to Iteration 31

Bulk move of tickets to iteration 31 at the iteration 30 code freeze

comment:4 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 32 to Iteration 33

Moved to iteration 33 at iteration 32 code freeze

comment:5 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.1 to Release 2.2

Moved at end of release 2.1

comment:6 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.2 to Release 2.3

Moved at the end of release 2.2

comment:7 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.3 to Release 2.4

Moved to milestone 2.4

comment:8 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.4 to Release 2.5

Moved at the code freeze for release 2.4

comment:9 Changed 7 years ago by Nick Draper

  • Milestone changed from Release 2.5 to Release 2.6

Moved to r2.6 at the end of r2.5

comment:10 Changed 7 years ago by Nick Draper

A test is already present. and I can confirm that the above script now runs without errors.

comment:11 Changed 7 years ago by Nick Draper

  • Status changed from assigned to accepted
  • Owner changed from Robert Whitley to Nick Draper

comment:12 Changed 7 years ago by Nick Draper

  • Status changed from accepted to verify
  • Resolution set to invalid

comment:13 Changed 7 years ago by Mathieu Doucet

  • Status changed from verify to verifying
  • Tester set to Mathieu Doucet

comment:14 Changed 7 years ago by Mathieu Doucet

  • Status changed from verifying to closed

A system test that uses this algorithm does exist. The algorithm should be moved to the new python API though.

comment:15 Changed 7 years ago by Nick Draper

  • Component changed from Mantid to Framework

comment:16 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 4131

Note: See TracTickets for help on using tickets.