Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
Merge branch 'bugfix/9862_LoadSQWproblems'
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Oct 14, 2014
2 parents d21f2d3 + 7c61c2d commit 35fb71d
Showing 1 changed file with 55 additions and 2 deletions.
57 changes: 55 additions & 2 deletions SystemTests/AnalysisTests/BuildSQWTest.py
Expand Up @@ -12,7 +12,7 @@
import os

# allow for multiple locations
FILE_LOCATIONS = ["/isis/mantid/localtestdata/"]
FILE_LOCATIONS = ["/isis/mantid/localtestdata/"]#,"d:/Data/MantidSystemTests/BigData/Dropbox/LoadSQW"]

class BuildSQWTest(stresstesting.MantidStressTest):

Expand Down Expand Up @@ -101,4 +101,57 @@ def cleanup(self):
try:
os.remove(filename)
except OSError,exc:
mantid.logger.warning("Unable to remove created file '%s'" % filename)
mantid.logger.warning("Unable to remove created file '%s'" % filename)

class LoadSQW_FileBasedTest(BuildSQWTest):
""" The test checks loading MD workspace from SQW file when target file is file based"""

def __init__(self):

self._input_data = ["Test22meV2f.sqw","Test22meVMD.nxs"]

def runTest(self):

MDws_file = os.path.join(config["defaultsave.directory"],"LoadSQWTestFileBased.nxs")
sqw_file = os.path.join(self._input_location,self._input_data[0])

wsMD=LoadSQW(Filename=sqw_file, OutputFilename=MDws_file)

self._created_files=MDws_file;


def validate(self):
"""Compare file-based MD files """
ref_file = os.path.join(self._input_location, self._input_data[1])
Reference=LoadMD(Filename=ref_file, FileBackEnd=True, Memory=100)
rez = CompareMDWorkspaces(Workspace1="wsMD",Workspace2=Reference,Tolerance=1.e-5,CheckEvents=False,IgnoreBoxID=False)

DeleteWorkspace("wsMD");

return rez[0];

class LoadSQW_MemBasedTest(BuildSQWTest):
""" The test checks loading MD workspace from SQW file when target file is file based"""

def __init__(self):

self._input_data = ["Test22meV2f.sqw","Test22meVMD.nxs"]

def runTest(self):

sqw_file = os.path.join(self._input_location,self._input_data[0])

wsMD=LoadSQW(Filename=sqw_file)

self._created_files=[];


def validate(self):
"""Compare memory-based vs file based MD workspaces """
ref_file = os.path.join(self._input_location, self._input_data[1])
Reference=LoadMD(Filename=ref_file, FileBackEnd=True, Memory=100)
rez = CompareMDWorkspaces(Workspace1="wsMD",Workspace2=Reference,Tolerance=1.e-5,CheckEvents=False,IgnoreBoxID=False)

DeleteWorkspace("wsMD");

return rez[0];

0 comments on commit 35fb71d

Please sign in to comment.