Skip to content

Commit

Permalink
Apply black
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Basler committed Oct 23, 2022
1 parent 3da99ba commit 7ede574
Show file tree
Hide file tree
Showing 6 changed files with 714 additions and 427 deletions.
70 changes: 43 additions & 27 deletions sh/prepareData_C2HDM.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,56 @@
import argparse

####### The parameters Type,Lambda1 to Lambda4,re_Lambda5,im_Lambda5, tanbeta and re_m12squared should have the label
####### of the corresponding parameter. With Seperator you have to tell which seperator your data file
####### of the corresponding parameter. With Seperator you have to tell which seperator your data file
####### is using (e.g. , \t or space). Your InputFILE will then be saved to OutputFILE.

Seperator='\t'
InputFILE='../example/C2HDM_Input.dat'
OutputFILE='C2HDM_Ordered.dat'
Type='Type'
Lambda1='L1'
Lambda2='L2'
Lambda3='L3'
Lambda4='L4'
re_Lambda5='re_L5'
im_Lambda5='im_L5'
tanbeta='tbeta'
re_m12squared='re_m12sq'
Seperator = "\t"
InputFILE = "../example/C2HDM_Input.dat"
OutputFILE = "C2HDM_Ordered.dat"
Type = "Type"
Lambda1 = "L1"
Lambda2 = "L2"
Lambda3 = "L3"
Lambda4 = "L4"
re_Lambda5 = "re_L5"
im_Lambda5 = "im_L5"
tanbeta = "tbeta"
re_m12squared = "re_m12sq"


def convert(IndexCol):
df=pd.DataFrame()
if IndexCol == 'False':
df=pd.read_table(InputFILE,index_col=False,sep=Seperator)
else:
df=pd.read_table(InputFILE,index_col=int(IndexCol),sep=Seperator)
df = pd.DataFrame()
if IndexCol == "False":
df = pd.read_table(InputFILE, index_col=False, sep=Seperator)
else:
df = pd.read_table(InputFILE, index_col=int(IndexCol), sep=Seperator)

frontcol = [
Type,
Lambda1,
Lambda2,
Lambda3,
Lambda4,
re_Lambda5,
im_Lambda5,
re_m12squared,
tanbeta,
]

Col = [c for c in frontcol if c in df] + [c for c in df if c not in frontcol]
df = df[Col]

df.to_csv(OutputFILE, index=False, sep="\t")

frontcol=[Type,Lambda1,Lambda2,Lambda3,Lambda4,re_Lambda5,im_Lambda5,re_m12squared,tanbeta]

Col = [c for c in frontcol if c in df] + [c for c in df if c not in frontcol]
df=df[Col]

df.to_csv(OutputFILE,index=False,sep='\t')

parser = argparse.ArgumentParser()
parser.add_argument('-i','--indexcol',help='Column which stores the index of your data', default='False')
parser.add_argument(
"-i",
"--indexcol",
help="Column which stores the index of your data",
default="False",
)

if __name__ == "__main__":
args = parser.parse_args()
convert(args.indexcol)
args = parser.parse_args()
convert(args.indexcol)
76 changes: 47 additions & 29 deletions sh/prepareData_N2HDM.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,63 @@
import pandas as pd
import argparse

####### The parameters Type,Lambda1 to Lambda8, tanbeta, m12squared and v_s should have the label of the
####### The parameters Type,Lambda1 to Lambda8, tanbeta, m12squared and v_s should have the label of the
####### corresponding parameter. With Seperator you have to tell which seperator your data file
####### is using (e.g. , \t or space). Your InputFILE will then be saved to OutputFILE.

Seperator='\t'
InputFILE='../example/N2HDM_Input.dat'
OutputFILE='N2HDM_Ordered.dat'
Type='p_THDMtype'
Lambda1='p_L1'
Lambda2='p_L2'
Lambda3='p_L3'
Lambda4='p_L4'
Lambda5='p_L5'
Lambda6='p_L6'
Lambda7='p_L7'
Lambda8='p_L8'
tanbeta='p_tbeta'
m12squared='p_m12sq'
vs='p_vs'
Seperator = "\t"
InputFILE = "../example/N2HDM_Input.dat"
OutputFILE = "N2HDM_Ordered.dat"
Type = "p_THDMtype"
Lambda1 = "p_L1"
Lambda2 = "p_L2"
Lambda3 = "p_L3"
Lambda4 = "p_L4"
Lambda5 = "p_L5"
Lambda6 = "p_L6"
Lambda7 = "p_L7"
Lambda8 = "p_L8"
tanbeta = "p_tbeta"
m12squared = "p_m12sq"
vs = "p_vs"


def convert(IndexCol):
df=pd.DataFrame()
if IndexCol == 'False':
df=pd.read_table(InputFILE,index_col=False,sep=Seperator)
else:
df=pd.read_table(InputFILE,index_col=int(IndexCol),sep=Seperator)
df = pd.DataFrame()
if IndexCol == "False":
df = pd.read_table(InputFILE, index_col=False, sep=Seperator)
else:
df = pd.read_table(InputFILE, index_col=int(IndexCol), sep=Seperator)

frontcol=[Type,Lambda1,Lambda2,Lambda3,Lambda4,Lambda5,Lambda6,Lambda7,Lambda8,vs,tanbeta,m12squared]
frontcol = [
Type,
Lambda1,
Lambda2,
Lambda3,
Lambda4,
Lambda5,
Lambda6,
Lambda7,
Lambda8,
vs,
tanbeta,
m12squared,
]

Col = [c for c in frontcol if c in df] + [c for c in df if c not in frontcol]
df=df[Col]
Col = [c for c in frontcol if c in df] + [c for c in df if c not in frontcol]
df = df[Col]

df.to_csv(OutputFILE, index=False, sep="\t")

df.to_csv(OutputFILE,index=False,sep='\t')

parser = argparse.ArgumentParser()
parser.add_argument('-i','--indexcol',help='Column which stores the index of your data', default='False')
parser.add_argument(
"-i",
"--indexcol",
help="Column which stores the index of your data",
default="False",
)

if __name__ == "__main__":
args = parser.parse_args()
convert(args.indexcol)

args = parser.parse_args()
convert(args.indexcol)
57 changes: 31 additions & 26 deletions sh/prepareData_R2HDM.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,48 @@
import pandas as pd
import argparse

####### The parameters Type,Lambda1 to Lambda5, tanbeta and m12squared should have the label of the corresponding
####### The parameters Type,Lambda1 to Lambda5, tanbeta and m12squared should have the label of the corresponding
####### parameter. With Seperator you have to tell which seperator your data file
####### is using (e.g. , \t or space). Your InputFILE will then be saved to OutputFILE


Seperator='\t'
InputFILE='../example/R2HDM_Input.dat'
InputFILE='wI.csv'
OutputFILE='R2HDM_Ordered.dat'
Type='yuktype'
Lambda1='L1'
Lambda2='L2'
Lambda3='L3'
Lambda4='L4'
Lambda5='L5'
tanbeta='tbeta'
m12squared='m12sq'
Seperator = "\t"
InputFILE = "../example/R2HDM_Input.dat"
InputFILE = "wI.csv"
OutputFILE = "R2HDM_Ordered.dat"
Type = "yuktype"
Lambda1 = "L1"
Lambda2 = "L2"
Lambda3 = "L3"
Lambda4 = "L4"
Lambda5 = "L5"
tanbeta = "tbeta"
m12squared = "m12sq"


def convert(IndexCol):
df=pd.DataFrame()
if IndexCol == 'False':
df=pd.read_table(InputFILE,index_col=False,sep=Seperator)
else:
df=pd.read_table(InputFILE,index_col=int(IndexCol),sep=Seperator)
df = pd.DataFrame()
if IndexCol == "False":
df = pd.read_table(InputFILE, index_col=False, sep=Seperator)
else:
df = pd.read_table(InputFILE, index_col=int(IndexCol), sep=Seperator)

frontcol=[Type,Lambda1,Lambda2,Lambda3,Lambda4,Lambda5,m12squared,tanbeta]
frontcol = [Type, Lambda1, Lambda2, Lambda3, Lambda4, Lambda5, m12squared, tanbeta]

Col = [c for c in frontcol if c in df] + [c for c in df if c not in frontcol]
df=df[Col]
Col = [c for c in frontcol if c in df] + [c for c in df if c not in frontcol]
df = df[Col]

df.to_csv(OutputFILE, index=False, sep="\t")

df.to_csv(OutputFILE,index=False,sep='\t')

parser = argparse.ArgumentParser()
parser.add_argument('-i','--indexcol',help='Column which stores the index of your data', default='False')
parser.add_argument(
"-i",
"--indexcol",
help="Column which stores the index of your data",
default="False",
)

if __name__ == "__main__":
args = parser.parse_args()
convert(args.indexcol)

args = parser.parse_args()
convert(args.indexcol)
Loading

0 comments on commit 7ede574

Please sign in to comment.