Commit 5e81640e authored by Owen Arnold's avatar Owen Arnold
Browse files

refs #14124. OverwriteSpectraMap -> RewriteSpectraMap.

No reason to change the name of the property. Would be far more convient for existing clients if the name of this property remained the same.
parent 32864183
......@@ -436,7 +436,7 @@ void LoadSpice2D::runLoadInstrument(
loadInst->setPropertyValue("InstrumentName", inst_name);
loadInst->setProperty<API::MatrixWorkspace_sptr>("Workspace",
localWorkspace);
loadInst->setProperty("OverwriteSpectraMap",
loadInst->setProperty("RewriteSpectraMap",
Mantid::Kernel::OptionalBool(false));
loadInst->execute();
} catch (std::invalid_argument &) {
......
......@@ -674,7 +674,7 @@ void LoadSpiceXML2DDet::loadInstrument(API::MatrixWorkspace_sptr matrixws,
loadinst->setProperty("Filename", idffilename);
} else
loadinst->setProperty("InstrumentName", "HB3A");
loadinst->setProperty("OverwriteSpectraMap",
loadinst->setProperty("RewriteSpectraMap",
Mantid::Kernel::OptionalBool(true));
loadinst->execute();
if (loadinst->isExecuted())
......
......@@ -622,7 +622,7 @@ Geometry::Instrument_const_sptr LoadVulcanCalFile::getInstrument() {
MatrixWorkspace_sptr tempWS(new Workspace2D());
childAlg->setProperty<MatrixWorkspace_sptr>("Workspace", tempWS);
childAlg->setPropertyValue("InstrumentName", InstrumentName);
childAlg->setProperty("OverwriteSpectraMap",
childAlg->setProperty("RewriteSpectraMap",
Mantid::Kernel::OptionalBool(false));
childAlg->executeAsChildAlg();
inst = tempWS->getInstrument();
......
......@@ -441,7 +441,7 @@ private:
std::string inputFile = "INES_Definition.xml";
loader.setPropertyValue("Filename", inputFile);
loader.setPropertyValue("Workspace", WS_Name);
loader.setProperty("OverwriteSpectraMap", Kernel::OptionalBool(true));
loader.setProperty("RewriteSpectraMap", Kernel::OptionalBool(true));
loader.execute();
return inputWS;
......
......@@ -798,7 +798,7 @@ public:
// Path to test input file
loaderGEM.setPropertyValue("Filename", "GEM_Definition.xml");
loaderGEM.setProperty("OverwriteSpectraMap",
loaderGEM.setProperty("RewriteSpectraMap",
Mantid::Kernel::OptionalBool(true));
// inputFile = loaderIDF2.getPropertyValue("Filename");
loaderGEM.setPropertyValue("Workspace", workspaceName);
......
......@@ -74,7 +74,7 @@ public:
TS_ASSERT_EQUALS(ws2D->getNumberHistograms(), 2584);
loader.setPropertyValue("Filename", "HET_Definition.xml");
loader.setProperty("OverwriteSpectraMap", OptionalBool(true));
loader.setProperty("RewriteSpectraMap", OptionalBool(true));
inputFile = loader.getPropertyValue("Filename");
loader.setPropertyValue("Workspace", wsName);
......@@ -164,7 +164,7 @@ public:
TS_ASSERT_THROWS_NOTHING(loadAgain.initialize());
loadAgain.setPropertyValue("Filename", inputFile);
loadAgain.setPropertyValue("Workspace", wsName);
loadAgain.setProperty("OverwriteSpectraMap", OptionalBool(true));
loadAgain.setProperty("RewriteSpectraMap", OptionalBool(true));
TS_ASSERT_THROWS_NOTHING(loadAgain.execute());
TS_ASSERT_EQUALS(output->getInstrument()->baseInstrument(), i);
......@@ -191,7 +191,7 @@ public:
// put this workspace in the data service
TS_ASSERT_THROWS_NOTHING(AnalysisDataService::Instance().add(wsName, ws2D));
loaderSLS.setPropertyValue("Filename", "SANDALS_Definition.xml");
loaderSLS.setProperty("OverwriteSpectraMap", OptionalBool(true));
loaderSLS.setProperty("RewriteSpectraMap", OptionalBool(true));
inputFile = loaderSLS.getPropertyValue("Filename");
loaderSLS.setPropertyValue("Workspace", wsName);
......@@ -258,7 +258,7 @@ public:
TS_ASSERT_THROWS_NOTHING(AnalysisDataService::Instance().add(wsName, ws2D));
loaderNIMROD.setPropertyValue("Filename", "NIM_Definition.xml");
loaderNIMROD.setProperty("OverwriteSpectraMap", OptionalBool(true));
loaderNIMROD.setProperty("RewriteSpectraMap", OptionalBool(true));
inputFile = loaderNIMROD.getPropertyValue("Filename");
loaderNIMROD.setPropertyValue("Workspace", wsName);
......@@ -363,7 +363,7 @@ public:
MatrixWorkspace_sptr ws =
WorkspaceFactory::Instance().create("Workspace2D", 1, 1, 1);
loader.setProperty("Workspace", ws);
loader.setProperty("OverwriteSpectraMap", OptionalBool(true));
loader.setProperty("RewriteSpectraMap", OptionalBool(true));
TS_ASSERT(loader.execute());
// This kind of IDF should lead to 2 instrument definitions - the physical
......@@ -463,7 +463,7 @@ public:
LoadInstrument instLoader;
instLoader.setRethrows(true);
instLoader.initialize();
instLoader.setProperty("OverwriteSpectraMap", OptionalBool(true));
instLoader.setProperty("RewriteSpectraMap", OptionalBool(true));
instLoader.setProperty("Workspace", WorkspaceFactory::Instance().create(
"EventWorkspace", 1, 1, 1));
instLoader.setProperty("InstrumentXML", instrumentXML);
......@@ -482,7 +482,7 @@ public:
instLoader.setProperty("Workspace", WorkspaceFactory::Instance().create(
"EventWorkspace", 1, 1, 1));
instLoader.setProperty("InstrumentXML", "<doesn't matter what>");
instLoader.setProperty("OverwriteSpectraMap", OptionalBool(true));
instLoader.setProperty("RewriteSpectraMap", OptionalBool(true));
TS_ASSERT(!instLoader.execute())
}
......@@ -493,7 +493,7 @@ public:
"EventWorkspace", 1, 1, 1));
instLoader.setProperty("InstrumentXML", "<instrument>");
instLoader.setProperty("InstrumentName", "Nonsense");
instLoader.setProperty("OverwriteSpectraMap", OptionalBool(true));
instLoader.setProperty("RewriteSpectraMap", OptionalBool(true));
TS_ASSERT(!instLoader.execute())
}
......@@ -538,7 +538,7 @@ public:
instLoader.setProperty("Workspace", WorkspaceFactory::Instance().create(
"EventWorkspace", 1, 1, 1));
instLoader.setProperty("InstrumentXML", instrumentXML);
instLoader.setProperty("OverwriteSpectraMap", OptionalBool(true));
instLoader.setProperty("RewriteSpectraMap", OptionalBool(true));
instLoader.setProperty(
"InstrumentName",
"Nonsense"); // Want to make sure it doesn't matter what we call it
......@@ -559,7 +559,7 @@ public:
instLoader.setProperty("Workspace", WorkspaceFactory::Instance().create(
"EventWorkspace", 1, 1, 1));
instLoader.setProperty("InstrumentXML", instrumentXMLwithView);
instLoader.setProperty("OverwriteSpectraMap", OptionalBool(true));
instLoader.setProperty("RewriteSpectraMap", OptionalBool(true));
instLoader.setProperty(
"InstrumentName",
"Nonsense"); // Want to make sure it doesn't matter what we call it
......@@ -598,7 +598,7 @@ private:
// load IDF
loader.setPropertyValue("Filename", filename);
loader.setProperty("OverwriteSpectraMap", OptionalBool(true));
loader.setProperty("RewriteSpectraMap", OptionalBool(true));
inputFile = loader.getPropertyValue("Filename");
loader.setPropertyValue("Workspace", wsName);
TS_ASSERT_THROWS_NOTHING(loader.execute());
......@@ -652,7 +652,7 @@ public:
// Load it fresh
LoadInstrument loader;
loader.initialize();
loader.setProperty("OverwriteSpectraMap", OptionalBool(true));
loader.setProperty("RewriteSpectraMap", OptionalBool(true));
loader.setProperty("Workspace", ws);
loader.setPropertyValue("Filename", filename);
loader.execute();
......
......@@ -221,7 +221,7 @@ public:
"Filename", "IDFs_for_UNIT_TESTING/IDF_for_UNIT_TESTING2.xml");
// inputFile = loaderIDF2.getPropertyValue("Filename");
pLoadInstrument->setPropertyValue("Workspace", wsName);
pLoadInstrument->setProperty("OverwriteSpectraMap",
pLoadInstrument->setProperty("RewriteSpectraMap",
Mantid::Kernel::OptionalBool(true));
TS_ASSERT_THROWS_NOTHING(pLoadInstrument->execute());
TS_ASSERT(pLoadInstrument->isExecuted());
......
......@@ -163,7 +163,7 @@ private:
// Path to test input file assumes Test directory checked out from SVN
std::string inputFile = "INES_Definition.xml";
loader.setPropertyValue("Filename", inputFile);
loader.setProperty("OverwriteSpectraMap", Mantid::Kernel::OptionalBool(true));
loader.setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(true));
loader.setPropertyValue("Workspace", input);
loader.execute();
......
......@@ -194,7 +194,7 @@ private:
std::string inputFile = "INES_Definition.xml";
loader.setPropertyValue("Filename", inputFile);
loader.setPropertyValue("Workspace", input);
loader.setProperty("OverwriteSpectraMap", Mantid::Kernel::OptionalBool(true));
loader.setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(true));
loader.execute();
// mask the detector
......
......@@ -177,7 +177,7 @@ public:
loaderIDF2.setPropertyValue(
"Filename", "IDFs_for_UNIT_TESTING/IDF_for_UNIT_TESTING2.xml");
loaderIDF2.setPropertyValue("Workspace", wsName);
loaderIDF2.setProperty("OverwriteSpectraMap", Mantid::Kernel::OptionalBool(true));
loaderIDF2.setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(true));
TS_ASSERT_THROWS_NOTHING(loaderIDF2.execute());
TS_ASSERT(loaderIDF2.isExecuted());
......
......@@ -181,7 +181,7 @@ private:
std::string inputFile = "INES_Definition.xml";
loader.setPropertyValue("Filename", inputFile);
loader.setPropertyValue("Workspace", input);
loader.setProperty("OverwriteSpectraMap",
loader.setProperty("RewriteSpectraMap",
Mantid::Kernel::OptionalBool(true));
loader.execute();
......
......@@ -461,7 +461,7 @@ void ISISHistoDataListener::runLoadInstrument(
try {
loadInst->setPropertyValue("InstrumentName", iName);
loadInst->setProperty<MatrixWorkspace_sptr>("Workspace", localWorkspace);
loadInst->setProperty("OverwriteSpectraMap",
loadInst->setProperty("RewriteSpectraMap",
Mantid::Kernel::OptionalBool(false));
loadInst->executeAsChildAlg();
} catch (std::invalid_argument &) {
......
......@@ -428,7 +428,7 @@ void ISISLiveEventDataListener::loadInstrument(const std::string &instrName) {
alg->initialize();
alg->setPropertyValue("InstrumentName", instrName);
alg->setProperty("Workspace", m_eventBuffer[0]);
alg->setProperty("OverwriteSpectraMap",
alg->setProperty("RewriteSpectraMap",
Mantid::Kernel::OptionalBool(false));
alg->setChild(true);
alg->execute();
......
......@@ -339,7 +339,7 @@ MatrixWorkspace_sptr ConvertSpiceDataToRealSpace::loadRunToMatrixWS(
IAlgorithm_sptr instloader = this->createChildAlgorithm("LoadInstrument");
instloader->initialize();
instloader->setProperty("InstrumentName", m_instrumentName);
instloader->setProperty("OverwriteSpectraMap",
instloader->setProperty("RewriteSpectraMap",
Mantid::Kernel::OptionalBool(true));
instloader->setProperty("Workspace", tempws);
instloader->execute();
......
......@@ -56,7 +56,7 @@ public:
loader.setProperty("InstrumentName", "HB2A");
loader.setProperty("Workspace", dataws);
loader.setProperty("OverwriteSpectraMap",
loader.setProperty("RewriteSpectraMap",
Mantid::Kernel::OptionalBool(true));
loader.execute();
......
......@@ -64,9 +64,9 @@ class DNSDetEffCorrVanaTest(unittest.TestCase):
# check whether the 2theta angles the same as in the data workspace
outputWorkspaceName = "DNSDetCorrVanaTest_Test5"
# rotate detector bank to different angles
api.LoadInstrument(self.__dataws, InstrumentName='DNS', OverwriteSpectraMap=True)
api.LoadInstrument(self.__vanaws, InstrumentName='DNS', OverwriteSpectraMap=True)
api.LoadInstrument(self.__bkgrws, InstrumentName='DNS', OverwriteSpectraMap=True)
api.LoadInstrument(self.__dataws, InstrumentName='DNS', RewriteSpectraMap=True)
api.LoadInstrument(self.__vanaws, InstrumentName='DNS', RewriteSpectraMap=True)
api.LoadInstrument(self.__bkgrws, InstrumentName='DNS', RewriteSpectraMap=True)
api.RotateInstrumentComponent(self.__dataws, "bank0", X=0, Y=1, Z=0, Angle=-7.53)
api.RotateInstrumentComponent(self.__vanaws, "bank0", X=0, Y=1, Z=0, Angle=-8.02)
......
......@@ -101,7 +101,7 @@ class DNSFlippingRatioCorrTest(unittest.TestCase):
dataws_nsf = self.__nsf_nicrws - self.__nsf_bkgrws
wslist = [dataws_sf, dataws_nsf, self.__sf_nicrws, self.__nsf_nicrws, self.__sf_bkgrws, self.__nsf_bkgrws]
for wks in wslist:
api.LoadInstrument(wks, InstrumentName='DNS', OverwriteSpectraMap=True)
api.LoadInstrument(wks, InstrumentName='DNS', RewriteSpectraMap=True)
api.RotateInstrumentComponent(dataws_sf, "bank0", X=0, Y=1, Z=0, Angle=-7.53)
api.RotateInstrumentComponent(dataws_nsf, "bank0", X=0, Y=1, Z=0, Angle=-7.53)
api.RotateInstrumentComponent(self.__sf_nicrws, "bank0", X=0, Y=1, Z=0, Angle=-8.02)
......
......@@ -9,7 +9,7 @@ class GetEiT0atSNSTest(unittest.TestCase):
def testGETS(self):
w=Load('ADARAMonitors.nxs')
LoadInstrument(Workspace=w,InstrumentName='SEQUOIA',OverwriteSpectraMap=True)
LoadInstrument(Workspace=w,InstrumentName='SEQUOIA',RewriteSpectraMap=True)
AddSampleLog(Workspace=w,LogName='vChTrans',LogText='1',LogType='Number Series')
AddSampleLog(Workspace=w,LogName='EnergyRequest',LogText='20',LogType='Number Series')
res=GetEiT0atSNS(w)
......
......@@ -18,7 +18,7 @@ class SANSWideAngleCorrectionTest(unittest.TestCase):
xvalues = numpy.linspace(3500,43500,nb+1)
tv = numpy.linspace(7e-2,6e-2,nb)
Sample = CreateWorkspace(xvalues,data,NSpec=xd*yd)
LoadInstrument(Sample, InstrumentName='SANS2D', OverwriteSpectraMap=True)
LoadInstrument(Sample, InstrumentName='SANS2D', RewriteSpectraMap=True)
Sample = CropWorkspace(Sample,StartWorkspaceIndex=8)#remove the monitors
# create a transmission workspace
Trans = CropWorkspace(Sample,StartWorkspaceIndex=10,EndWorkspaceIndex=10)
......
......@@ -11,7 +11,7 @@ class SofQWMomentsTest(unittest.TestCase):
ws = CreateSampleWorkspace("Histogram", Function="User Defined", UserDefinedFunction=function, XMin=0, XMax=10, BinWidth=0.01, XUnit="DeltaE")
ws = ScaleX(ws, -5, "Add") #shift to center on 0
ws = ScaleX(ws, 0.1) #scale to size
LoadInstrument(ws, InstrumentName='IRIS', OverwriteSpectraMap=True)
LoadInstrument(ws, InstrumentName='IRIS', RewriteSpectraMap=True)
return ws
def test_sofqwmoments(self):
......@@ -30,4 +30,4 @@ class SofQWMomentsTest(unittest.TestCase):
self.assertEquals(ws.blocksize(), 14)
if __name__=="__main__":
unittest.main()
\ No newline at end of file
unittest.main()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment