Skip to content

Commit

Permalink
Fix evol_pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Oct 15, 2024
1 parent b6efcd1 commit e7d775c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 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)
apply.apply_pdf(eko_output, initial_PDF, targetgrid)[0]
)

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

# 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)]["pdfs"][pid][x_idx]
return x * evolved_PDF[(Q2, nf)][pid][x_idx]

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

# basic
Expand Down

0 comments on commit e7d775c

Please sign in to comment.