Skip to content

Commit

Permalink
Run black and isort on entire repo
Browse files Browse the repository at this point in the history
  • Loading branch information
APJansen committed Feb 22, 2024
1 parent faadba0 commit d67e0a5
Show file tree
Hide file tree
Showing 137 changed files with 16,105 additions and 3,162 deletions.
2 changes: 1 addition & 1 deletion buildmaster/oldcommondata_porter.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def create_uncertainties(df, systype_file, is_default=False, use_multiplicative=
if info["treatment"] not in ["ADD", "MULT"]:
raise ValueError(f"Treatment type: {info['treatment']} not recognized")
if use_multiplicative:
tmp[key] = float(bin_data[2 * n+1]*data[idx-1]/100.0)
tmp[key] = float(bin_data[2 * n + 1] * data[idx - 1] / 100.0)
else:
tmp[key] = float(bin_data[2 * n])
bins.append(tmp)
Expand Down
66 changes: 43 additions & 23 deletions buildmaster/rawdata/ATLAS_1JET_8TEV_R04/prefilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,51 @@

import numpy as np

nbins=6
ndata=[34, 33, 32, 30, 24, 18]
nbins = 6
ndata = [34, 33, 32, 30, 24, 18]

for k in range(nbins):
output=open("bin_" + str(k+1) + ".dat", "w+")
n = ndata[k]

#Read, pt, ptmin, ptmax, xsec
pt, ptmin, ptmax, data, statp, statm = np.loadtxt("./HEPData-ins1604271-v1-Table_" + str(k+7) + ".csv", delimiter=",", skiprows=11,
usecols=(0,1,2,3,4,5), unpack=True)

#Read all the sys
sys=[]
for i in range(640):
a = np.loadtxt("./HEPData-ins1604271-v1-Table_" + str(k+7) + ".csv", delimiter=",", skiprows=11,
usecols=(i+6), unpack=True)
sys.append(a)

output = open("bin_" + str(k + 1) + ".dat", "w+")
n = ndata[k]

# Read, pt, ptmin, ptmax, xsec
pt, ptmin, ptmax, data, statp, statm = np.loadtxt(
"./HEPData-ins1604271-v1-Table_" + str(k + 7) + ".csv",
delimiter=",",
skiprows=11,
usecols=(0, 1, 2, 3, 4, 5),
unpack=True,
)

for i in range(n):
output.write(str(pt[i]) + "\t" + str(ptmin[i]) + "\t" + str(ptmax[i]) + "\t" + str(data[i])
+ "\t" + str(statp[i]) + "\t" + str(statm[i]) + "\t")
for j in range(640):
output.write(str(sys[j][i]) + "\t")
# Read all the sys
sys = []
for i in range(640):
a = np.loadtxt(
"./HEPData-ins1604271-v1-Table_" + str(k + 7) + ".csv",
delimiter=",",
skiprows=11,
usecols=(i + 6),
unpack=True,
)
sys.append(a)

output.write("\n")
output.close
for i in range(n):
output.write(
str(pt[i])
+ "\t"
+ str(ptmin[i])
+ "\t"
+ str(ptmax[i])
+ "\t"
+ str(data[i])
+ "\t"
+ str(statp[i])
+ "\t"
+ str(statm[i])
+ "\t"
)
for j in range(640):
output.write(str(sys[j][i]) + "\t")

output.write("\n")
output.close
73 changes: 46 additions & 27 deletions buildmaster/rawdata/ATLAS_1JET_8TEV_R06/prefilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,51 @@

import numpy as np

nbins=6
ndata=[34, 33, 32, 30, 24, 18]
nbins = 6
ndata = [34, 33, 32, 30, 24, 18]

for k in range(nbins):
output=open("bin_" + str(k+1) + ".dat", "w+")
n = ndata[k]

#Read, pt, ptmin, ptmax, xsec
pt, ptmin, ptmax, data, statp, statm = np.loadtxt("./HEPData-ins1604271-v1-Table_" + str(k+1) + ".csv", delimiter=",", skiprows=11,
usecols=(0,1,2,3,4,5), unpack=True)

#Read all the sys
sys=[]
for i in range(660):
a = np.loadtxt("./HEPData-ins1604271-v1-Table_" + str(k+1) + ".csv", delimiter=",", skiprows=11,
usecols=(i+6), unpack=True)
sys.append(a)


for i in range(n):
output.write(str(pt[i]) + "\t" + str(ptmin[i]) + "\t" + str(ptmax[i]) + "\t" + str(data[i])
+ "\t" + str(statp[i]) + "\t" + str(statm[i]) + "\t")
for j in range(660):
output.write(str(sys[j][i]) + "\t")

output.write("\n")
output.close


output = open("bin_" + str(k + 1) + ".dat", "w+")
n = ndata[k]

# Read, pt, ptmin, ptmax, xsec
pt, ptmin, ptmax, data, statp, statm = np.loadtxt(
"./HEPData-ins1604271-v1-Table_" + str(k + 1) + ".csv",
delimiter=",",
skiprows=11,
usecols=(0, 1, 2, 3, 4, 5),
unpack=True,
)

# Read all the sys
sys = []
for i in range(660):
a = np.loadtxt(
"./HEPData-ins1604271-v1-Table_" + str(k + 1) + ".csv",
delimiter=",",
skiprows=11,
usecols=(i + 6),
unpack=True,
)
sys.append(a)

for i in range(n):
output.write(
str(pt[i])
+ "\t"
+ str(ptmin[i])
+ "\t"
+ str(ptmax[i])
+ "\t"
+ str(data[i])
+ "\t"
+ str(statp[i])
+ "\t"
+ str(statm[i])
+ "\t"
)
for j in range(660):
output.write(str(sys[j][i]) + "\t")

output.write("\n")
output.close
Loading

0 comments on commit d67e0a5

Please sign in to comment.