Skip to content

Commit cea84fc

Browse files
authored
Merge pull request #2329 from NNPDF/fix_commondata
Fix commondata
2 parents 7b66a17 + 1753c2b commit cea84fc

File tree

12 files changed

+14
-30
lines changed

12 files changed

+14
-30
lines changed

nnpdf_data/nnpdf_data/commondata/CMS_2JET_7TEV/rawdata/dijet_corr.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ Statistical correlation of the measured cross section between the mass bins in t
7373
2231 2659 0.00 0.01 0.00 -0.13 1.00 -0.15 -0.01 0.01
7474
2659 3147 0.00 0.00 0.01 -0.01 -0.15 1.00 -0.28 0.00
7575
3147 3704 0.00 0.00 0.00 0.02 -0.01 -0.28 1.00 -0.12
76-
3704 5058 0.00 0.00 0.00 0.00 0.01 0.00 -0.12 1.00s
76+
3704 5058 0.00 0.00 0.00 0.00 0.01 0.00 -0.12 1.00

nnpdf_data/nnpdf_data/commondata/JLABE06_NC_3GEV_EN/filter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
def read_data(fnames):
1313
df = pd.DataFrame()
1414
for fname in fnames:
15-
with open(fname, "r") as file:
15+
with open(fname) as file:
1616
# Get the data as string
1717
data = file.read()
1818

@@ -26,7 +26,7 @@ def read_data(fnames):
2626
last_section[0] = "x A_1 A_stat A_sys G G_stat G_sys"
2727

2828
# Convert the modified section into a Pandas DataFrame
29-
df_temp = pd.read_csv(StringIO('\n'.join(last_section)), delim_whitespace=True)
29+
df_temp = pd.read_csv(StringIO('\n'.join(last_section)), sep=r'\s+')
3030

3131
# Set the Q^2 and y value
3232
df_temp["Q2"] = "3.08"

nnpdf_data/nnpdf_data/commondata/LHCB_DY_7TEV_MUON/filter.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@ def read_corrmatrix(nb_datapoints: int) -> np.ndarray:
162162
163163
"""
164164
corrmat = pd.read_csv(
165-
"./rawdata/corrmat.corr",
166-
names=[f'{i}' for i in range(nb_datapoints)],
167-
delim_whitespace=True,
165+
"./rawdata/corrmat.corr", names=[f'{i}' for i in range(nb_datapoints)], sep=r'\s+'
168166
)
169167
corrmat = corrmat.iloc[:, :].values
170168

nnpdf_data/nnpdf_data/commondata/LHCB_DY_8TEV_MUON/filter.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@ def read_corrmatrix(nb_datapoints: int) -> np.ndarray:
162162
163163
"""
164164
corrmat = pd.read_csv(
165-
"./rawdata/corrmat.corr",
166-
names=[f'{i}' for i in range(nb_datapoints)],
167-
delim_whitespace=True,
165+
"./rawdata/corrmat.corr", names=[f'{i}' for i in range(nb_datapoints)], sep=r'\s+'
168166
)
169167
corrmat = corrmat.iloc[:, :].values
170168

nnpdf_data/nnpdf_data/commondata/LHCB_WPWM_7TEV_MUON/filter.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@ def read_corrmatrix(nb_datapoints: int) -> np.ndarray:
162162
163163
"""
164164
corrmat = pd.read_csv(
165-
"./rawdata/corrmat.corr",
166-
names=[f'{i}' for i in range(nb_datapoints)],
167-
delim_whitespace=True,
165+
"./rawdata/corrmat.corr", names=[f'{i}' for i in range(nb_datapoints)], sep=r'\s+'
168166
)
169167
corrmat = corrmat.iloc[:, :].values
170168

nnpdf_data/nnpdf_data/commondata/LHCB_WPWM_8TEV_MUON/filter.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@ def read_corrmatrix(nb_datapoints: int) -> np.ndarray:
162162
163163
"""
164164
corrmat = pd.read_csv(
165-
"./rawdata/corrmat.corr",
166-
names=[f'{i}' for i in range(nb_datapoints)],
167-
delim_whitespace=True,
165+
"./rawdata/corrmat.corr", names=[f'{i}' for i in range(nb_datapoints)], sep=r'\s+'
168166
)
169167
corrmat = corrmat.iloc[:, :].values
170168

nnpdf_data/nnpdf_data/commondata/LHCB_Z0_13TEV/filter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def get_kinematics(hepdata: dict, bin_index: list) -> list:
8080

8181
kinematics = []
8282
for idx in bin_index:
83-
ymin, ymax = [float(i) for i in rapbins[idx]['value'].split("-")]
83+
ymin, ymax = (float(i) for i in rapbins[idx]['value'].split("-"))
8484
kin_value = {
8585
"y": {"min": ymin, "mid": 0.5 * (ymin + ymax), "max": ymax},
8686
"m_Z2": {"min": None, "mid": MZ_VALUE**2, "max": None},
@@ -159,7 +159,7 @@ def read_corrmatrix(nb_datapoints: int, state: str) -> np.ndarray:
159159
corrmat = pd.read_csv(
160160
f"./rawdata/corrmat{MAP_STATE[state]}.corr",
161161
names=[f'{i}' for i in range(nb_datapoints)],
162-
delim_whitespace=True,
162+
sep=r'\s+',
163163
)
164164
corrmat = corrmat.iloc[:, :].values
165165

nnpdf_data/nnpdf_data/commondata/LHCB_Z0_7TEV_DIELECTRON/filter.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,7 @@ def read_corrmatrix(nb_datapoints: int) -> np.ndarray:
148148
149149
"""
150150
corrmat = pd.read_csv(
151-
"./rawdata/corrmat.corr",
152-
names=[f'{i}' for i in range(nb_datapoints)],
153-
delim_whitespace=True,
151+
"./rawdata/corrmat.corr", names=[f'{i}' for i in range(nb_datapoints)], sep=r'\s+'
154152
)
155153
corrmat = corrmat.iloc[:, :].values
156154

nnpdf_data/nnpdf_data/commondata/LHCB_Z0_7TEV_MUON/filter.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@ def read_corrmatrix(nb_datapoints: int) -> np.ndarray:
162162
163163
"""
164164
corrmat = pd.read_csv(
165-
"./rawdata/corrmat.corr",
166-
names=[f'{i}' for i in range(nb_datapoints)],
167-
delim_whitespace=True,
165+
"./rawdata/corrmat.corr", names=[f'{i}' for i in range(nb_datapoints)], sep=r'\s+'
168166
)
169167
corrmat = corrmat.iloc[:, :].values
170168

nnpdf_data/nnpdf_data/commondata/LHCB_Z0_8TEV_DIELECTRON/filter.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ def read_corrmatrix(nb_datapoints: int) -> np.ndarray:
144144
145145
"""
146146
corrmat = pd.read_csv(
147-
"./rawdata/corrmat.corr",
148-
names=[f'{i}' for i in range(nb_datapoints)],
149-
delim_whitespace=True,
147+
"./rawdata/corrmat.corr", names=[f'{i}' for i in range(nb_datapoints)], sep=r'\s+'
150148
)
151149
corrmat = corrmat.iloc[:, :].values
152150

0 commit comments

Comments
 (0)