-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove pointless fivetheories
and seventheories
#2186
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,12 +27,7 @@ | |
|
||
@check_using_theory_covmat | ||
def theory_covmat_dataset( | ||
results, | ||
results_central_bytheoryids, | ||
use_theorycovmat, # for the check | ||
point_prescription, | ||
fivetheories=None, | ||
seventheories=None, | ||
results, results_central_bytheoryids, point_prescription, use_theorycovmat # for the check | ||
): | ||
""" | ||
Compute the theory covmat for a collection of theoryids for a single dataset. | ||
|
@@ -50,9 +45,7 @@ def theory_covmat_dataset( | |
|
||
# Compute the theory contribution to the covmats | ||
deltas = list(t.central_value - cv for t in theory_results) | ||
thcovmat = compute_covs_pt_prescrip( | ||
point_prescription, l, "A", deltas, fivetheories=fivetheories, seventheories=seventheories | ||
) | ||
thcovmat = compute_covs_pt_prescrip(point_prescription, l, "A", deltas) | ||
|
||
return thcovmat | ||
|
||
|
@@ -242,16 +235,7 @@ def covmat_n3lo_ad(name1, name2, deltas1, deltas2): | |
return 1 / norm * s | ||
|
||
|
||
def compute_covs_pt_prescrip( | ||
point_prescription, | ||
l, | ||
name1, | ||
deltas1, | ||
name2=None, | ||
deltas2=None, | ||
fivetheories=None, | ||
seventheories=None, | ||
): | ||
def compute_covs_pt_prescrip(point_prescription, l, name1, deltas1, name2=None, deltas2=None): | ||
"""Utility to compute the covariance matrix by prescription given the | ||
shifts with respect to the central value for a pair of processes. | ||
|
||
|
@@ -275,10 +259,6 @@ def compute_covs_pt_prescrip( | |
Process name of the second set of shifts | ||
deltas2: list(np.ndarray) | ||
list of shifts for each of the non-central theories | ||
fivetheories: str | ||
5-point prescription variation | ||
seventheories: str | ||
7-point prescription variation | ||
""" | ||
if name2 is None and deltas2 is not None: | ||
raise ValueError( | ||
|
@@ -298,22 +278,19 @@ def compute_covs_pt_prescrip( | |
s = covmat_3fpt(name1, name2, deltas1, deltas2) | ||
elif point_prescription == "3r point": | ||
s = covmat_3rpt(name1, name2, deltas1, deltas2) | ||
else: | ||
elif point_prescription == "3 point": | ||
s = covmat_3pt(name1, name2, deltas1, deltas2) | ||
elif l == 5: | ||
# 5 point -------------------------------------------------------------- | ||
if fivetheories == "nobar": | ||
if point_prescription == "5 point": | ||
s = covmat_5pt(name1, name2, deltas1, deltas2) | ||
# 5bar-point ----------------------------------------------------------- | ||
else: | ||
elif point_prescription == "5bar point": | ||
s = covmat_5barpt(name1, name2, deltas1, deltas2) | ||
# --------------------------------------------------------------------- | ||
elif l == 7: | ||
# Outdated 7pts implementation: left for posterity --------------------- | ||
if seventheories == "original": | ||
if point_prescription == "7original point": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be better to use an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, it's more readable this way |
||
s = covmat_7pt_orig(name1, name2, deltas1, deltas2) | ||
# 7pt (Gavin) ---------------------------------------------------------- | ||
else: | ||
elif point_prescription == "7 point": | ||
s = covmat_7pt(name1, name2, deltas1, deltas2) | ||
elif l == 9: | ||
s = covmat_9pt(name1, name2, deltas1, deltas2) | ||
|
@@ -361,7 +338,7 @@ def compute_covs_pt_prescrip( | |
|
||
|
||
@check_correct_theory_combination | ||
def covs_pt_prescrip(combine_by_type, theoryids, point_prescription, fivetheories, seventheories): | ||
def covs_pt_prescrip(combine_by_type, theoryids, point_prescription): | ||
"""Produces the sub-matrices of the theory covariance matrix according | ||
to a point prescription which matches the number of input theories. | ||
If 5 theories are provided, a scheme 'bar' or 'nobar' must be | ||
|
@@ -386,14 +363,7 @@ def covs_pt_prescrip(combine_by_type, theoryids, point_prescription, fivetheorie | |
central2, *others2 = process_info.preds[name2] | ||
deltas2 = list(other - central2 for other in others2) | ||
s = compute_covs_pt_prescrip( | ||
point_prescription, | ||
len(theoryids), | ||
name1, | ||
deltas1, | ||
name2, | ||
deltas2, | ||
fivetheories, | ||
seventheories, | ||
point_prescription, len(theoryids), name1, deltas1, name2, deltas2 | ||
) | ||
start_locs = (start_proc[name1], start_proc[name2]) | ||
covmats[start_locs] = s | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this was done to uniform the name for the stored theory covmat. Do we plan to have different names then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was, but the name of that function is not what decides the name of the stored .csv file and instead we have this
nnpdf/validphys2/src/validphys/config.py
Line 817 in 77c3343
Changing it now would break some old fits so probably not worth it