Ticket #1457 (closed)

Opened 10 years ago

Last modified 5 years ago

Some problems loading instrument parameters files

Reported by: Steve Williams Owned by: Mathieu Doucet
Priority: major Milestone: Iteration 24
Component: Keywords:
Cc: Blocked By:
Blocking: Tester: Stuart Campbell

Description

An error is sometimes produced when accessing parameters from a workspace that's been deleted.

Runing LoadSpice2D twice in combination with LoadEmptyInstrument loses parameters as in the email below

Hey guys,

I’m having a problem loading parameters from the parameters.xml file. It works fine when I load a data file normally, but the parameters are lost when LoadEmptyInstrument is called beforehand. It seems that the parameters are only loaded in the workspace created by the first call but not the second… Any idea how we should fix this? Run the code below and you’ll see what I mean.

-M 

from MantidFramework import *
from mantidsimple import *
mtd.initialise(False)
import os

TEST_DIR = "../../../Test/Data/SANS2D/"
filepath = os.path.join(TEST_DIR, "BioSANS_test_data.xml")
instrpath = "../../../Test/Instrument/BIOSANS_Definition.xml"

success = True

loader = LoadSpice2D(filepath, "test")
test1 = mtd["test"].getInstrument().getComponentByName("detector1").getPos().getZ()==6.0
test2 = mtd['test'].getInstrument().getStringParameter("detector-name")[0] == 'detector1'

LoadEmptyInstrument(instrpath, 'inst')
loader = LoadSpice2D(filepath, "test")
test3 = mtd["test"].getInstrument().getComponentByName("detector1").getPos().getZ()==6.0
test4 = len(mtd['test'].getInstrument().getStringParameter("detector-name")) == 1
test5 = mtd['inst'].getInstrument().getStringParameter("detector-name")[0] == 'detector1'

print "SUCCESS ? "
print test1
print test2
print test3
print test4
print test5

Change History

comment:1 Changed 10 years ago by Mathieu Doucet

  • Status changed from new to assigned
  • Owner changed from Steve Williams to Mathieu Doucet

comment:2 Changed 10 years ago by Mathieu Doucet

  • Status changed from assigned to accepted

comment:3 Changed 10 years ago by Mathieu Doucet

(In [5586]) Fix problem with instrument parameter loading. Re #1457

comment:4 Changed 10 years ago by Mathieu Doucet

  • Status changed from accepted to verify

comment:5 Changed 10 years ago by Stuart Campbell

  • Status changed from verify to verifying
  • Tester set to Stuart Campbell
  • Milestone changed from Unassigned to Iteration 24

comment:6 Changed 10 years ago by Stuart Campbell

  • Status changed from verifying to closed

comment:7 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 2304

Note: See TracTickets for help on using tickets.