Skip to content

Commit be8c7ae

Browse files
committed
Fixing covmate naming issue
1 parent b30f00f commit be8c7ae

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

validphys2/src/validphys/config.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,16 +1304,25 @@ def produce_fitthcovmat(
13041304
thcovmat_present = False
13051305

13061306
if use_thcovmat_if_present and thcovmat_present:
1307-
# Expected path of theory covmat hardcoded
1308-
covmat_path = (
1309-
fit.path / "tables" / "datacuts_theory_theorycovmatconfig_theory_covmat_custom.csv"
1310-
)
1311-
# All possible valid files
1312-
if not covmat_path.exists():
1307+
tables_path = fit.path / "tables"
1308+
1309+
# User covmat + point prescriptions
1310+
if (tables_path / "datacuts_theory_theorycovmatconfig_total_theory_covmat.csv").exists():
1311+
covmat_path = (tables_path / "datacuts_theory_theorycovmatconfig_total_theory_covmat.csv")
1312+
# Only point prescriptions
1313+
elif (tables_path / "datacuts_theory_theorycovmatconfig_theory_covmat_custom.csv").exists():
1314+
covmat_path = (
1315+
tables_path / "datacuts_theory_theorycovmatconfig_theory_covmat_custom.csv"
1316+
)
1317+
# Only user covmat
1318+
elif (tables_path / "datacuts_theory_theorycovmatconfig_user_covmat.csv").exists():
1319+
covmat_path = (tables_path / "datacuts_theory_theorycovmatconfig_user_covmat.csv")
1320+
else:
13131321
raise ConfigError(
13141322
"Fit appeared to use theory covmat in fit but the file was not at the "
13151323
f"usual location: {covmat_path}."
13161324
)
1325+
logging.info(f"Using theory covmat from fit: {covmat_path}")
13171326
fit_theory_covmat = ThCovMatSpec(covmat_path)
13181327
else:
13191328
fit_theory_covmat = None

0 commit comments

Comments
 (0)