Skip to content

Commit

Permalink
tell the user why a given dataset could not load when the theory is m…
Browse files Browse the repository at this point in the history
…issing
  • Loading branch information
scarlehoff committed Oct 31, 2023
1 parent d03263c commit 3965f58
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions validphys2/src/validphys/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,6 @@ def check_fk_from_theory_metadata(self, theory_metadata, theoryID, cfac):
is not supported for pineappl theories. As such, the name of the cfactor is expected to be
CF_{cfactor_name}_{fktable_name}
"""
if theory_metadata is None:
raise TheoryMetadataNotFound

theory = self.check_theoryID(theoryID)
fklist = theory_metadata.fktables_to_paths(theory.path / "fastkernel")
op = theory_metadata.operation
Expand Down Expand Up @@ -655,7 +652,10 @@ def check_dataset(
raise ValueError(
f"New commondata files accept only pineappl theories (used:{theoryid.id})"
)
thmeta = commondata.metadata.theory

if (thmeta := commondata.metadata.theory) is None:
raise TheoryMetadataNotFound(f"No theory metadata found for {name}")

fkspec, op = self.check_fk_from_theory_metadata(thmeta, theoryno, cfac)

# Note this is simply for convenience when scripting. The config will
Expand Down

0 comments on commit 3965f58

Please sign in to comment.