From 5ab48cd86167d7e1280d3b03afb32c23fa4b26a4 Mon Sep 17 00:00:00 2001 From: Roy Stegeman Date: Mon, 4 Nov 2024 22:04:47 +0000 Subject: [PATCH] allow for multiple theory covmats --- validphys2/src/validphys/config.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/validphys2/src/validphys/config.py b/validphys2/src/validphys/config.py index d72cc14b0e..5bac9adcb7 100644 --- a/validphys2/src/validphys/config.py +++ b/validphys2/src/validphys/config.py @@ -1232,20 +1232,16 @@ def produce_fitthcovmat( if use_thcovmat_if_present and thcovmat_present: # Expected directory of theory covmat hardcoded - covmat_path = fit.path / "tables" + covmat_path = ( + fit.path / "tables" / "datacuts_theory_theorycovmatconfig_theory_covmat_custom.csv" + ) # All possible valid files - covfiles = sorted(covmat_path.glob("*theory_covmat*.csv")) - if not covfiles: + if not covmat_path.exists(): raise ConfigError( "Fit appeared to use theory covmat in fit but the file was not at the " f"usual location: {covmat_path}." ) - if len(covfiles) > 1: - raise ConfigError( - "More than one valid theory covmat file found at the " - f"usual location: {covmat_path}. These are {covfiles}." - ) - fit_theory_covmat = ThCovMatSpec(covfiles[0]) + fit_theory_covmat = ThCovMatSpec(covmat_path) else: fit_theory_covmat = None return fit_theory_covmat