Skip to content

Commit

Permalink
Merge branch 'master' into tevatron_inc_DY
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoterh committed Nov 11, 2024
2 parents 1a68711 + fabfb23 commit 659b581
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion validphys2/src/validphys/covmats.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pandas as pd
import scipy.linalg as la

from nnpdf_data import legacy_to_new_map
from reportengine import collect
from reportengine.table import table
from validphys.calcutils import regularize_covmat
Expand Down Expand Up @@ -748,8 +749,12 @@ def reorder_thcovmat_as_expcovmat(fitthcovmat, data):
means the order of the runcard
"""
theory_covmat = fitthcovmat.load()
bb = [str(i) for i in data]
tmp = theory_covmat.droplevel(0, axis=0).droplevel(0, axis=1)
# old to new names mapping
new_names = {d[0]: legacy_to_new_map(d[0])[0] for d in tmp.index}
tmp.rename(columns=new_names, index=new_names, level=0, inplace=True)
# reorder
bb = [str(i) for i in data]
return tmp.reindex(index=bb, columns=bb, level=0)


Expand Down

0 comments on commit 659b581

Please sign in to comment.