Skip to content

Commit

Permalink
Add explicit check for empty ekos
Browse files Browse the repository at this point in the history
  • Loading branch information
andreab1997 committed Oct 11, 2023
1 parent d59ea5c commit eb73599
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pineko/theory.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
logger = logging.getLogger(__name__)


class EmptyEkoError(Exception):
"""Raised if the loaded eko is empty."""


def check_scvar_evolve(grid, max_as, max_al, kind: check.Scale):
"""Check scale variations and central orders consistency."""
available, max_as_effective = check.contains_sv(grid, max_as, max_al, kind)
Expand Down Expand Up @@ -404,6 +408,9 @@ def fk(self, name, grid_path, tcard, pdf):
check_scvar_evolve(grid, max_as, max_al, check.Scale.FACT)
# loading ekos to produce a tmp copy
with eko.EKO.read(eko_filename) as operators:
# Skip the computation of the fktable if the eko is empty
if len(operators.mu2grid) == 0:
raise EmptyEkoError
eko_tmp_path = operators.paths.root.parent / "eko-tmp.tar"
operators.deepcopy(eko_tmp_path)
with eko.EKO.edit(eko_tmp_path) as operators:
Expand Down

0 comments on commit eb73599

Please sign in to comment.