Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eko from theory #1601

Merged
merged 4 commits into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion n3fit/src/evolven3fit/evolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from ekomark import apply
from eko import basis_rotation as br
from eko import output
from validphys.loader import Loader

from . import utils, eko_utils

Expand Down Expand Up @@ -88,7 +89,15 @@ def evolve_fit(
log.info(f"Loading eko from : {eko_path}")
eko_op = output.Output.load_tar(eko_path)
else:
eko_op = eko_utils.construct_eko_for_fit(theory, op, log, dump_eko)
import ipdb; ipdb.set_trace()
andreab1997 marked this conversation as resolved.
Show resolved Hide resolved
try:
log.info(f"Loading eko from theory {theoryID}")
theory_eko_path = Loader().check_theoryID(theoryID).get_eko()
eko_op = output.Output.load_tar(theory_eko_path)
except TypeError:
log.info(f"eko not found in theory {theoryID}: maybe it is not a pineappl theory?")
andreab1997 marked this conversation as resolved.
Show resolved Hide resolved
eko_op = eko_utils.construct_eko_for_fit(theory, op, log, dump_eko)
pass
eko_op.xgrid_reshape(targetgrid=x_grid, inputgrid=x_grid)
info = gen_info.create_info_file(theory, op, 1, info_update={})
info["NumMembers"] = "REPLACE_NREP"
Expand Down
5 changes: 5 additions & 0 deletions validphys2/src/validphys/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,11 @@ def get_description(self):
dbpath = self.path.parent/'theory.db'
return fetch_theory(dbpath, self.id)

def get_eko(self):
if self.is_pineappl():
return self.path/'eko.tar'
raise TypeError(f"the requested eko does not exists because the theory {self.id} is not a pineappl theory")
andreab1997 marked this conversation as resolved.
Show resolved Hide resolved

__slots__ = ('id', 'path')

def __repr__(self):
Expand Down