From ea7bafa357c72e0c4a16338940a2a828f5f83928 Mon Sep 17 00:00:00 2001 From: "Juan M. Cruz-Martinez" Date: Sun, 4 Aug 2024 17:15:24 +0200 Subject: [PATCH] Update theorydbutils.py --- nnpdf_data/nnpdf_data/theorydbutils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nnpdf_data/nnpdf_data/theorydbutils.py b/nnpdf_data/nnpdf_data/theorydbutils.py index d7a98fdd30..5e52bd51b5 100644 --- a/nnpdf_data/nnpdf_data/theorydbutils.py +++ b/nnpdf_data/nnpdf_data/theorydbutils.py @@ -51,13 +51,14 @@ def fetch_theory(theory_database: Path, theoryID: int): """ available_theories = get_available_theory_cards(theory_database) + theoryID = int(theoryID) try: theoryfile = available_theories[theoryID] except KeyError as e: raise TheoryNotFoundInDatabase(f"Theorycard for theory not found: {e}") tdict = parse_theory_card(theoryfile) - if tdict["ID"] != int(theoryID): + if tdict["ID"] != theoryID: raise ValueError(f"The theory ID in {theoryfile} doesn't correspond with its ID entry") return tdict