Skip to content

Commit

Permalink
Refs #35 Added backwards compatibility for sets module
Browse files Browse the repository at this point in the history
  • Loading branch information
jmborr committed Oct 18, 2013
1 parent c416301 commit 56df85b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion simulation/src/beamline/assemblemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def lowTResolution(model, simulated, resolution, convolved, expdata=None,
if __name__ == "__main__":
import argparse
import sys
from sets import Set
if sys.version_info < (2,6): from sets import Set as set
from mantidhelper.algorithm import getDictFromArgparse
p=argparse.ArgumentParser(description='Provider for services involving convolution of simulated S(Q,E) with a model beamline. Available services are: lowTresolution, modelBEC, modelB_EC_C, modelB_freeE_C.')
p.add_argument('service', help='name of the service to invoke')
Expand Down
2 changes: 1 addition & 1 deletion simulation/src/beamline/convolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def convolution(simulated, resolution, expdata, convolved, dak=None, norm2one=Fa
if __name__ == "__main__":
import argparse
import sys
from sets import Set
if sys.version_info < (2,6): from sets import Set as set
p=argparse.ArgumentParser(description='Provider for services involving convolution of simulated S(Q,E) with a model beamline. Available services are: lowTresolution.')
p.add_argument('service', help='name of the service to invoke')
p.add_argument('-explain', action='store_true', help='print message explaining the arguments to pass for the particular service')
Expand Down
2 changes: 1 addition & 1 deletion simulation/src/beamline/initparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def modelB_freeE_C(modeltpl, elastic, convolved, expdata, initparfile=None):

import argparse
import sys
from sets import Set
if sys.version_info < (2,6): from sets import Set as set

p=argparse.ArgumentParser(description='Provider for services involving initialization of model beamline parameters. Available models are: modelB_freeE_C')
p.add_argument('service', help='name of the service to invoke')
Expand Down
2 changes: 1 addition & 1 deletion simulation/src/beamline/interpX.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def itp_simple(workspace,shift,newWorkspace=None):
import argparse
import sys
import re
from sets import Set
if sys.version_info < (2,6): from sets import Set as set
p=argparse.ArgumentParser(description='Provider for services involving shift of calculated S(Q,E) model Available services are: itp_simple')
p.add_argument('service', help='name of the service to invoke')
p.add_argument('-explain', action='store_true', help='print message explaining the arguments to pass for the particular service')
Expand Down
2 changes: 1 addition & 1 deletion simulation/src/beamline/resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def elasticLineLowTemp(insqe, outres=None):
if __name__ == "__main__":
import argparse
import sys
from sets import Set
if sys.version_info < (2,6): from sets import Set as set
p=argparse.ArgumentParser(description='Provider for services involving the production of a resolution function. Available services are: elasticLineLowTemp')
p.add_argument('service', help='name of the service to invoke')
p.add_argument('-explain', action='store_true', help='print message explaining the arguments to pass for the particular service')
Expand Down
6 changes: 2 additions & 4 deletions simulation/src/scattering/sassenatasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def sortQvectors(hdfile, args):
Returns:
ws1 (mantid group workspace) Workspace holding the contents of the HDF5 file
"""
trace()
from sys import version_info # python version
if version_info < (2,7):
ws1 = mti.LoadSassena( Filename=hdfile, **args )
Expand Down Expand Up @@ -357,7 +356,6 @@ def genSQE(hdfname,nxsname,wsname=None,indexes=[],rebinQ=None,scale=1.0, **kwarg
wsname=wsname or splitext(basename(nxsname))[0]
algs_opt=locals()['kwargs']
hdfs=hdfname.split() # list of sassena output files serving as input
#trace()
ws = sortQvectors( hdfs[0], findopts('LoadSassena',algs_opt) )

if len(hdfs)>1: # add remaining sassena output files
Expand Down Expand Up @@ -395,11 +393,11 @@ def genSQE(hdfname,nxsname,wsname=None,indexes=[],rebinQ=None,scale=1.0, **kwarg
import argparse
import sys
from mantidhelper.algorithm import getDictFromArgparse
from sets import Set
if sys.version_info < (2,6): from sets import Set as set
p=argparse.ArgumentParser(description='Provider for services involving Sassena IO. Available services are: genSQE, SassenaVersion ')
p.add_argument('service', help='name of the function in this module to call')
p.add_argument('-explain', action='store_true', help='print message explaining the arguments to pass for the particular service')
if Set(['-h', '-help', '--help']).intersection(Set(sys.argv)): args=p.parse_args() # check if help message is requested
if set(['-h', '-help', '--help']).intersection(set(sys.argv)): args=p.parse_args() # check if help message is requested
if 'SassenaVersion' in sys.argv:
p.description='Loads Sassena output (HDF5 file) and adds Sassena Version number.' # update help message
for action in p._actions:
Expand Down

0 comments on commit 56df85b

Please sign in to comment.