Skip to content

Commit

Permalink
add grid optimize also in eko opcard
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomomagni committed Nov 6, 2024
1 parent 9a61792 commit 2066fa6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/pineko/cli/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def sub_compatibility(grid_path, operator_path, xif, max_as, max_al):
"""
pineappl_grid = pineappl.grid.Grid.read(grid_path)
pineappl_grid.optimize()
with eko.EKO.read(operator_path) as operators:
for (q2, _), _ in operators.items():
try:
Expand Down
4 changes: 3 additions & 1 deletion src/pineko/evolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@ def write_operator_card_from_file(
if not pathlib.Path(pineappl_path).exists():
raise FileNotFoundError(pineappl_path)
pineappl_grid = pineappl.grid.Grid.read(pineappl_path)
pineappl_grid.optimize()
default_card = yaml.safe_load(
pathlib.Path(default_card_path).read_text(encoding="utf-8")
)

return write_operator_card(pineappl_grid, default_card, card_path, tcard)


Expand Down Expand Up @@ -187,6 +189,7 @@ def write_operator_card(pineappl_grid, default_card, card_path, tcard):
"""
# Add a +1 to the orders for the difference in convention between nnpdf and pineappl
# NB: This would not happen for nFONLL
pineappl_grid
is_fns = int(check.is_fonll_mixed(tcard["FNS"], pineappl_grid.channels()))
max_as = 1 + tcard["PTO"] + is_fns
max_al = 1 + tcard["QED"]
Expand Down Expand Up @@ -399,7 +402,6 @@ def prepare(operator):
"""Match the raw operator with its relevant metadata."""
for (q2, _), op in operator.items():
op = xgrid_reshape(op, operator.xgrid)
# TODO: this check here could be dropped ?
check.check_grid_and_eko_compatible(grid, x_grid, q2, xif, max_as, max_al)
info = PyOperatorSliceInfo(
fac0=operator.mu20,
Expand Down

0 comments on commit 2066fa6

Please sign in to comment.