Skip to content

Commit

Permalink
Merge branch 'feature/7547_dgs_utils_to_v2' into develop
Browse files Browse the repository at this point in the history
Re #7547.
Conflicts:
	Code/Mantid/scripts/CMakeLists.txt
  • Loading branch information
RussellTaylor committed Jul 28, 2013
2 parents 99cd8be + 9bbf31b commit 73506eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
1 change: 0 additions & 1 deletion Code/Mantid/scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

set ( TEST_PY_FILES
test/ReducerTest.py
test/DgreduceTest.py
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# Forced to use version 1 API.
IS_IN_MANTIDPLOT = False
try:
import mantidplot
from MantidFramework import *
mtd.initialise(False)
from mantidsimple import *
import mantidplot

from mantid.kernel import config
from mantid.api import AnalysisDataService
from mantid.simpleapi import LoadEmptyInstrument
IS_IN_MANTIDPLOT = True
except:
pass
Expand All @@ -26,15 +23,14 @@ def __init__(self, inst_name):

def _load_param_file(self, inst_name):
InstrumentParameters.instrument_name = inst_name
ws_name = "__emptyInst_" + inst_name
if IS_IN_MANTIDPLOT:
idf_loc = ConfigService().getInstrumentDirectory()
idf_loc = config.getInstrumentDirectory()
idf_pattern = os.path.join(idf_loc, "%s_Definition*.xml") % inst_name
import glob
idf_files = glob.glob(idf_pattern)
output = LoadEmptyInstrument(Filename=idf_files[0],
OutputWorkspace=ws_name)
InstrumentParameters._instrument = output.workspace().getInstrument()
emptyInst = LoadEmptyInstrument(Filename=str(idf_files[0]))
InstrumentParameters._instrument = emptyInst.getInstrument()
AnalysisDataService.remove(str(emptyInst)) # Don't need to keep workspace

def _self_check(self):
if self._instrument is None:
Expand Down

0 comments on commit 73506eb

Please sign in to comment.