Skip to content

Commit

Permalink
Revert "Fix evol_pdf"
Browse files Browse the repository at this point in the history
This reverts commit e7d775c.
  • Loading branch information
giacomomagni committed Oct 21, 2024
1 parent ec079c7 commit 93692ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/ekobox/evol_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ def evolve_pdfs(
with EKO.read(eko_path) as eko_output:
for initial_PDF in initial_PDF_list:
evolved_PDF_list.append(
apply.apply_pdf(eko_output, initial_PDF, targetgrid)[0]
apply.apply_pdf(eko_output, initial_PDF, targetgrid)
)

# separate by nf the evolgrid (and order per nf/q)
q2block_per_nf = regroup_evolgrid(eko_output.evolgrid)
q2block_per_nf = regroup_evolgrid(eko_output.evolgrid) # pylint: disable=E1101

# update info file
if targetgrid is None:
Expand Down Expand Up @@ -128,7 +128,7 @@ def collect_blocks(evolved_PDF: dict, q2block_per_nf: dict, xgrid: list):
# fake xfxQ2
def pdf_xq2(pid, x, Q2):
x_idx = xgrid.index(x)
return x * evolved_PDF[(Q2, nf)][pid][x_idx]
return x * evolved_PDF[(Q2, nf)]["pdfs"][pid][x_idx]

# loop on nf patches
for nf, q2grid in q2block_per_nf.items():
Expand Down
6 changes: 5 additions & 1 deletion tests/ekobox/test_evol_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ def test_collect_blocks():
def mk(eps):
f = {}
for ep in eps:
f[ep] = {pid: np.random.rand(len(xgrid)) for pid in br.flavor_basis_pids}
f[ep] = {
"pdfs": {
pid: np.random.rand(len(xgrid)) for pid in br.flavor_basis_pids
}
}
return f

# basic
Expand Down

0 comments on commit 93692ac

Please sign in to comment.