pyslha.py

changeset 240
84b1c74e0020
parent 239
42f74a1e96cf
child 241
401d5e64948f
equal deleted inserted replaced
239:42f74a1e96cf 240:84b1c74e0020
32 please cite the paper: http://arxiv.org/abs/1305.4194 32 please cite the paper: http://arxiv.org/abs/1305.4194
33 33
34 TODOs: 34 TODOs:
35 35
36 For 2.1.3: 36 For 2.1.3:
37 * Fix kwargs passing from read/write*File to read/write* 37 * Allow ignoring of missing MASS block in SLHA reader
38 38
39 For 2.1.4: 39 For 2.1.4:
40 * In set_value, if first item is non-int, treat as None-indexed 40 * In set_value, if first item is non-int, treat as None-indexed
41 * Refine value string heuristic for strings with ints in them? 41 * Refine value string heuristic for strings with ints in them?
42 42
1096 Read an SLHA file, returning dictionaries of blocks and decays. 1096 Read an SLHA file, returning dictionaries of blocks and decays.
1097 1097
1098 Other keyword parameters are passed to readSLHA. 1098 Other keyword parameters are passed to readSLHA.
1099 """ 1099 """
1100 f = open(spcfilename, "r") 1100 f = open(spcfilename, "r")
1101 rtn = readSLHA(f.read(), kwargs) 1101 rtn = readSLHA(f.read(), **kwargs)
1102 f.close() 1102 f.close()
1103 return rtn 1103 return rtn
1104 1104
1105 1105
1106 def writeSLHAFile(spcfilename, blocks, decays, **kwargs): 1106 def writeSLHAFile(spcfilename, blocks, decays, **kwargs):
1108 Write an SLHA file from the supplied blocks and decays dicts. 1108 Write an SLHA file from the supplied blocks and decays dicts.
1109 1109
1110 Other keyword parameters are passed to writeSLHA. 1110 Other keyword parameters are passed to writeSLHA.
1111 """ 1111 """
1112 f = open(spcfilename, "w") 1112 f = open(spcfilename, "w")
1113 f.write(writeSLHA(blocks, decays, kwargs)) 1113 f.write(writeSLHA(blocks, decays, **kwargs))
1114 f.close() 1114 f.close()
1115 1115
1116 1116
1117 def readISAWIGFile(isafilename, **kwargs): 1117 def readISAWIGFile(isafilename, **kwargs):
1118 """ 1118 """
1122 SLHA. 1122 SLHA.
1123 1123
1124 Other keyword parameters are passed to readSLHA. 1124 Other keyword parameters are passed to readSLHA.
1125 """ 1125 """
1126 f = open(isafilename, "r") 1126 f = open(isafilename, "r")
1127 rtn = readISAWIG(f.read(), kwargs) 1127 rtn = readISAWIG(f.read(), **kwargs)
1128 f.close() 1128 f.close()
1129 return rtn 1129 return rtn
1130 1130
1131 1131
1132 def writeISAWIGFile(isafilename, blocks, decays, **kwargs): 1132 def writeISAWIGFile(isafilename, blocks, decays, **kwargs):
1134 Write an ISAWIG file from the supplied blocks and decays dicts. 1134 Write an ISAWIG file from the supplied blocks and decays dicts.
1135 1135
1136 Other keyword parameters are passed to writeISAWIG. 1136 Other keyword parameters are passed to writeISAWIG.
1137 """ 1137 """
1138 f = open(isafilename, "w") 1138 f = open(isafilename, "w")
1139 f.write(writeISAWIG(blocks, decays, kwargs)) 1139 f.write(writeISAWIG(blocks, decays, **kwargs))
1140 f.close() 1140 f.close()
1141 1141
1142 1142
1143 1143
1144 ############################################################################### 1144 ###############################################################################

mercurial