Skip to content

Commit

Permalink
allow for multiple theory covmats
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyStegeman committed Nov 4, 2024
1 parent 0b889b2 commit 5ab48cd
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions validphys2/src/validphys/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5ab48cd

Please sign in to comment.