Skip to content

Commit

Permalink
Merge branch 'master' of github.com:APN-Pucky/HEPi into pandas_as_def…
Browse files Browse the repository at this point in the history
…ault
  • Loading branch information
APN-Pucky authored and APN-Pucky committed Jun 10, 2022
2 parents 46d1dda + c7843be commit 8a31528
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Currently, slurm is supported for clusters.
| [Stable][doc stable] | [Unstable][doc test] |
| ------------- |:-------------:|
| [![workflow][a s image]][a s link] | [![test][a t image]][a t link] |
| [![Coverage Status][c s i]][c s l] | [![Coverage Status][c t i]][c t l] |
| - | [![Coverage Status][c t i]][c t l] |
| - |[![Codacy Badge][codacy cover image]][codacy cover link] |
| - |[![Codacy Badge][codacy quality image]][codacy quality link] |
| [![Documentation][rtd s i]][rtd s l] | [![Documentation][rtd t i]][rtd t l] |
Expand Down
6 changes: 3 additions & 3 deletions hepi/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from re import I
from uncertainties import ufloat
from hepi.input import Input, order_to_string, xsec_to_order
from hepi.util import LD2DL
from hepi.util import LD2DL, DL2DF


def load(f, dimensions=1):
Expand All @@ -26,7 +26,7 @@ def load(f, dimensions=1):
pdf_nlo=dict["PDF set"],
update=False,
)
inpu.code = dict["tool"]
inpu.runner = dict["tool"]
dat = []
params = dict["parameters"]
if dimensions == 2:
Expand All @@ -49,4 +49,4 @@ def load(f, dimensions=1):
dicd[order_to_string(inpu.order)] = ufloat(
dict["data"][k]["xsec_pb"], dict["data"][k]["unc_pb"])
dat.append(dicd)
return LD2DL(dat, actual_dict=True)
return DL2DF(LD2DL(dat, actual_dict=True))
4 changes: 2 additions & 2 deletions hepi/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def write_csv(dict_list: list, filename: str):
>>> hepi.write_csv(dl, open("test.csv", 'w'))
>>> with open('test.csv', 'r') as f:
... print(f.read())
order,energy,energyhalf,particle1,particle2,slha,pdf_lo,pdfset_lo,pdf_nlo,pdfset_nlo,pdf_lo_id,pdf_nlo_id,mu_f,mu_r,precision,max_iters,invariant_mass,pt,result,id,model,mu,code,N2,N1,NLO_PLUS_NLL
order,energy,energyhalf,particle1,particle2,slha,pdf_lo,pdfset_lo,pdf_nlo,pdfset_nlo,pdf_lo_id,pdf_nlo_id,mu_f,mu_r,precision,max_iters,invariant_mass,pt,result,id,model,mu,runner,N2,N1,NLO_PLUS_NLL
2,13000.0,6500.0,-1,-1,$\\tilde\\chi_2^0\\tilde\\chi_1^0$ (higgsino),CTEQ6.6 and MSTW2008nlo90cl,0,CTEQ6.6 and MSTW2008nlo90cl,0,0,0,1.0,1.0,0.01,50,auto,auto,total,,,0.0,Resummino,81.5,80.0,7.746+/-0.023
2,13000.0,6500.0,-1,-1,$\\tilde\\chi_2^0\\tilde\\chi_1^0$ (higgsino),CTEQ6.6 and MSTW2008nlo90cl,0,CTEQ6.6 and MSTW2008nlo90cl,0,0,0,1.0,1.0,0.01,50,auto,auto,total,,,0.0,Resummino,82.0,80.0,7.646+/-0.024
2,13000.0,6500.0,-1,-1,$\\tilde\\chi_2^0\\tilde\\chi_1^0$ (higgsino),CTEQ6.6 and MSTW2008nlo90cl,0,CTEQ6.6 and MSTW2008nlo90cl,0,0,0,1.0,1.0,0.01,50,auto,auto,total,,,0.0,Resummino,83.0,80.0,7.451+/-0.024
Expand Down Expand Up @@ -175,7 +175,7 @@ def write_json(dict_list: list,
>>> hepi.write_json(dl, Order.NLO_PLUS_NLL,"N1",open("test.json", 'w'))
>>> with open('test.json', 'r') as f:
... print(f.read())
{"initial state": "pp", "order": "NLO+NLL", "source": "HEPi", "contact": "?", "tool": "Resummino", "process_latex": "$\\\\overline{d}\\\\overline{d}$", "comment": "", "reference": "?", "Ecom [GeV]": "13000.0", "process_id": "pp_13000.0_-1_-1", "PDF set": "CTEQ6.6 and MSTW2008nlo90cl", "data": {"80.0": {"xsec_pb": 2.142151}, "60.0": {"xsec_pb": 4.504708}, "100.0": {"xsec_pb": 1.165897}, "125.0": {"xsec_pb": 0.614697}, "150.0": {"xsec_pb": 0.354984}, "175.0": {"xsec_pb": 0.327625}, "200.0": {"xsec_pb": 0.141817}, "225.0": {"xsec_pb": 0.138083}, "250.0": {"xsec_pb": 0.066363}, "300.0": {"xsec_pb": 0.044674}}, "parameters": [["N1"]]}
{"initial state": "pp", "order": "NLO+NLL", "source": "hepi-...", "contact": "?", "tool": "Resummino", "process_latex": "$\\\\overline{d}\\\\overline{d}$", "comment": "", "reference": "?", "Ecom [GeV]": "13000.0", "process_id": "pp_13000.0_-1_-1", "PDF set": "CTEQ6.6 and MSTW2008nlo90cl", "data": {"80.0": {"xsec_pb": 2.142151}, "60.0": {"xsec_pb": 4.504708}, "100.0": {"xsec_pb": 1.165897}, "125.0": {"xsec_pb": 0.614697}, "150.0": {"xsec_pb": 0.354984}, "175.0": {"xsec_pb": 0.327625}, "200.0": {"xsec_pb": 0.141817}, "225.0": {"xsec_pb": 0.138083}, "250.0": {"xsec_pb": 0.066363}, "300.0": {"xsec_pb": 0.044674}}, "parameters": [["N1"]]}
"""

jd = {}
Expand Down
19 changes: 2 additions & 17 deletions hepi/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,22 +223,7 @@ def vplot(x,
vx = x
vy = y

xnew = np.linspace(
vx[0],
vx[-1],
300,
)
if interpolate:
#print(vx,vy)
spl = make_interp_spline(vx, splot.unv(vy), k=3) # type: BSpline
power_smooth = spl(xnew)
if fill:
spl_up = make_interp_spline(vx, splot.unv(vy) + splot.usd(vy),
k=3) # type: BSpline
power_up_smooth = spl_up(xnew)
spl_down = make_interp_spline(vx, splot.unv(vy) - splot.usd(vy),
k=3) # type: BSpline
power_down_smooth = spl_down(xnew)

if data_color is None:
if 'axes' in kwargs and kwargs['axes'] is not None:
bl, = kwargs['axes'].plot([], [])
Expand All @@ -258,7 +243,7 @@ def vplot(x,
sigmas=0 if not fill else 1,
**kwargs)
if iii is not None:
ii = iii[0]
#ii = iii[0]
ix = iii[1]
iy = iii[2]
if print_area:
Expand Down
1 change: 0 additions & 1 deletion hepi/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from hepi.util import DL2DF, LD2DL, DictData, namehash
from smpl.parallel import par
import time
import pandas as pd


class RunParam(DictData):
Expand Down

0 comments on commit 8a31528

Please sign in to comment.