Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/prepare_environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ runs:
with:
python-version: ${{ inputs.python-version }}
use-mamba: true
channels: https://packages.nnpdf.science/public,conda-forge
channels: conda-forge
show-channel-urls: true
auto-update-conda: true
activate-environment: nnpdf_environment
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fitbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
POSTFIT_NREP: 15 # requested minimum replicas for postfit
# IMPORTANT
# WHEN CHANGING THE REFERENCE SET, THE NEW REFERENCE MUST BE MANUALLY UPLOADED TO THE SERVER
REFERENCE_SET: NNBOT-99108504e-2025-11-22 # reference set for exact results
REFERENCE_SET: NNNBOT-1a81255f3-2026-01-27 # reference set for exact results
STABLE_REFERENCE_SET: NNBOT-99108504e-2025-11-22 # reference set for last tag
PYTHONHASHSEED: "0"

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/redo_regressions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
echo "$NETRC_FILE" | base64 --decode > ~/.netrc
conda config --remove channels defaults
conda config --append channels conda-forge
conda config --prepend channels https://packages.nnpdf.science/public
conda config --set show_channel_urls true
conda install lhapdf pandoc
- name: Install nnpdf with testing and qed extras
Expand Down
111 changes: 56 additions & 55 deletions nnpdf_data/nnpdf_data/commondata/HERA_CC_318GEV/filter.py
Original file line number Diff line number Diff line change
@@ -1,68 +1,69 @@
from nnpdf_data.filter_utils.hera_utils import commondata #, covmat_is_close
from pathlib import Path
from dataclasses import dataclass
import typing
from typing import List
import numpy as np
import pandas as pd
from os import PathLike
import yaml
from pathlib import Path

import pandas as pd

from nnpdf_data.filter_utils.hera_utils import commondata # , covmat_is_close


@dataclass
class hera_commondata(commondata):
def __init__(self, filename: str | PathLike, dataset_name: str,
process: str):
# Read the data.
file = Path(filename)
df = pd.read_table(file, sep=r"\s+")
def __init__(self, filename: str | PathLike, dataset_name: str, process: str):
# Read the data.
file = Path(filename)
df = pd.read_table(file, sep=r"\s+")

# Kinematic quantieties.
self.central_values = df["Sigma"].to_numpy()
self.kinematics = df[["x", "Q2", "y"]].to_numpy()
self.kinematic_quantities = ["x", "Q2", "y"]
# Kinematic quantieties.
self.central_values = df["Sigma"].to_numpy()
self.kinematics = df[["x", "Q2", "y"]].to_numpy()
self.kinematic_quantities = ["x", "Q2", "y"]

# Statistical uncertainties.
statistical_uncertainties = df["stat"].to_numpy()
for iunc,unc in enumerate(statistical_uncertainties):
unc = self.central_values[iunc]*unc/100
statistical_uncertainties[iunc] = unc
self.statistical_uncertainties = statistical_uncertainties
# Statistical uncertainties.
statistical_uncertainties = df["stat"].to_numpy(copy=True)
for iunc, unc in enumerate(statistical_uncertainties):
unc = self.central_values[iunc] * unc / 100
statistical_uncertainties[iunc] = unc
self.statistical_uncertainties = statistical_uncertainties

# Systematic uncertainties.
# remove the column containing the total uncertainty excluding
# procedural uncertainties.
df = df.drop(columns=["tot_noproc"])
sys_uncert_col_names = list(df.columns.values)[5:]
self.systematic_uncertainties = df[sys_uncert_col_names].to_numpy()
systematic_uncertainties = df[sys_uncert_col_names].to_numpy()
for iunc,unc in enumerate(systematic_uncertainties):
unc = self.central_values[iunc]*unc/100
systematic_uncertainties[iunc] = unc
self.systematic_uncertainties = systematic_uncertainties

# All uncertainties are treated as multiplicative.
systypes = []
for name in sys_uncert_col_names:
if(name == "uncor"):
systypes.append(("MULT", "UNCORR"))
else:
systypes.append(("MULT", f"HC_{name}"))
self.systypes = systypes
self.process = process
self.dataset_name = dataset_name
# Systematic uncertainties.
# remove the column containing the total uncertainty excluding
# procedural uncertainties.
df = df.drop(columns=["tot_noproc"])
sys_uncert_col_names = list(df.columns.values)[5:]
self.systematic_uncertainties = df[sys_uncert_col_names].to_numpy()
systematic_uncertainties = df[sys_uncert_col_names].to_numpy()
for iunc, unc in enumerate(systematic_uncertainties):
unc = self.central_values[iunc] * unc / 100
systematic_uncertainties[iunc] = unc
self.systematic_uncertainties = systematic_uncertainties

def main():
hera_em = hera_commondata("./rawdata/HERA1+2_CCem.dat","HERACOMBCCEM", "DIS_CC")
hera_em.write_new_commondata(Path("data_EM-SIGMARED.yaml"),
Path("kinematics_EM-SIGMARED.yaml"),
Path("uncertainties_EM-SIGMARED.yaml"))
hera_ep = hera_commondata("./rawdata/HERA1+2_CCep.dat","HERACOMBCCEP", "DIS_CC")
hera_ep.write_new_commondata(Path("data_EP-SIGMARED.yaml"),
Path("kinematics_EP-SIGMARED.yaml"),
Path("uncertainties_EP-SIGMARED.yaml"))
# All uncertainties are treated as multiplicative.
systypes = []
for name in sys_uncert_col_names:
if name == "uncor":
systypes.append(("MULT", "UNCORR"))
else:
systypes.append(("MULT", f"HC_{name}"))
self.systypes = systypes
self.process = process
self.dataset_name = dataset_name

if __name__ == "__main__":
main()

def main():
hera_em = hera_commondata("./rawdata/HERA1+2_CCem.dat", "HERACOMBCCEM", "DIS_CC")
hera_em.write_new_commondata(
Path("data_EM-SIGMARED.yaml"),
Path("kinematics_EM-SIGMARED.yaml"),
Path("uncertainties_EM-SIGMARED.yaml"),
)
hera_ep = hera_commondata("./rawdata/HERA1+2_CCep.dat", "HERACOMBCCEP", "DIS_CC")
hera_ep.write_new_commondata(
Path("data_EP-SIGMARED.yaml"),
Path("kinematics_EP-SIGMARED.yaml"),
Path("uncertainties_EP-SIGMARED.yaml"),
)


if __name__ == "__main__":
main()
108 changes: 54 additions & 54 deletions nnpdf_data/nnpdf_data/commondata/HERA_NC_225GEV/filter.py
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
from nnpdf_data.filter_utils.hera_utils import commondata #, covmat_is_close
from pathlib import Path
from dataclasses import dataclass
import typing
from typing import List
import numpy as np
import pandas as pd
from os import PathLike
import yaml
from pathlib import Path

import pandas as pd

from nnpdf_data.filter_utils.hera_utils import commondata # , covmat_is_close


@dataclass
class hera_commondata(commondata):
def __init__(self, filename: str | PathLike, dataset_name: str,
process: str):
# Read the data.
file = Path(filename)
df = pd.read_table(file, sep=r"\s+")

# Kinematic quantieties.
self.central_values = df["Sigma"].to_numpy()
self.kinematics = df[["x", "Q2", "y"]].to_numpy()
self.kinematic_quantities = ["x", "Q2", "y"]

# Statistical uncertainties.
statistical_uncertainties = df["stat"].to_numpy()
for iunc,unc in enumerate(statistical_uncertainties):
unc = self.central_values[iunc]*unc/100
statistical_uncertainties[iunc] = unc
self.statistical_uncertainties = statistical_uncertainties

# Systematic uncertainties.
# remove the column containing the total uncertainty excluding
# procedural uncertainties.
df = df.drop(columns=["tot_noproc"])
sys_uncert_col_names = list(df.columns.values)[5:]
self.systematic_uncertainties = df[sys_uncert_col_names].to_numpy()
systematic_uncertainties = df[sys_uncert_col_names].to_numpy()
for iunc,unc in enumerate(systematic_uncertainties):
unc = self.central_values[iunc]*unc/100
systematic_uncertainties[iunc] = unc
self.systematic_uncertainties = systematic_uncertainties

# All uncertainties are treated as multiplicative.
systypes = []
for name in sys_uncert_col_names:
if(name == "uncor"):
systypes.append(("MULT", "UNCORR"))
else:
systypes.append(("MULT", "HC_" + name))
self.systypes = systypes
self.process = process
self.dataset_name = dataset_name
def __init__(self, filename: str | PathLike, dataset_name: str, process: str):
# Read the data.
file = Path(filename)
df = pd.read_table(file, sep=r"\s+")

# Kinematic quantieties.
self.central_values = df["Sigma"].to_numpy()
self.kinematics = df[["x", "Q2", "y"]].to_numpy()
self.kinematic_quantities = ["x", "Q2", "y"]

# Statistical uncertainties.
statistical_uncertainties = df["stat"].to_numpy(copy=True)
for iunc, unc in enumerate(statistical_uncertainties):
unc = self.central_values[iunc] * unc / 100
statistical_uncertainties[iunc] = unc
self.statistical_uncertainties = statistical_uncertainties

# Systematic uncertainties.
# remove the column containing the total uncertainty excluding
# procedural uncertainties.
df = df.drop(columns=["tot_noproc"])
sys_uncert_col_names = list(df.columns.values)[5:]
self.systematic_uncertainties = df[sys_uncert_col_names].to_numpy()
systematic_uncertainties = df[sys_uncert_col_names].to_numpy()
for iunc, unc in enumerate(systematic_uncertainties):
unc = self.central_values[iunc] * unc / 100
systematic_uncertainties[iunc] = unc
self.systematic_uncertainties = systematic_uncertainties

# All uncertainties are treated as multiplicative.
systypes = []
for name in sys_uncert_col_names:
if name == "uncor":
systypes.append(("MULT", "UNCORR"))
else:
systypes.append(("MULT", "HC_" + name))
self.systypes = systypes
self.process = process
self.dataset_name = dataset_name

def main():
hera_ep = hera_commondata("./rawdata/HERA1+2_NCep_460.dat","HERACOMBNCEP460", "DIS_NCE")
hera_ep.write_new_commondata(Path("data_EP-SIGMARED.yaml"),
Path("kinematics_EP-SIGMARED.yaml"),
Path("uncertainties_EP-SIGMARED.yaml"))
if __name__ == "__main__":
main()

def main():
hera_ep = hera_commondata("./rawdata/HERA1+2_NCep_460.dat", "HERACOMBNCEP460", "DIS_NCE")
hera_ep.write_new_commondata(
Path("data_EP-SIGMARED.yaml"),
Path("kinematics_EP-SIGMARED.yaml"),
Path("uncertainties_EP-SIGMARED.yaml"),
)


if __name__ == "__main__":
main()
98 changes: 50 additions & 48 deletions nnpdf_data/nnpdf_data/commondata/HERA_NC_251GEV/filter.py
Original file line number Diff line number Diff line change
@@ -1,65 +1,67 @@
from nnpdf_data.filter_utils.hera_utils import commondata #, covmat_is_close
from pathlib import Path
from dataclasses import dataclass
from os import PathLike
from pathlib import Path
import typing
from typing import List

import numpy as np
import pandas as pd
from os import PathLike
import yaml

from nnpdf_data.filter_utils.hera_utils import commondata # , covmat_is_close


@dataclass
class hera_commondata(commondata):
def __init__(self, filename: str | PathLike, dataset_name: str,
process: str):
# Read the data.
file = Path(filename)
df = pd.read_table(file, sep=r"\s+")

# Kinematic quantieties.
self.central_values = df["Sigma"].to_numpy()
self.kinematics = df[["x", "Q2", "y"]].to_numpy()
self.kinematic_quantities = ["x", "Q2", "y"]
def __init__(self, filename: str | PathLike, dataset_name: str, process: str):
# Read the data.
file = Path(filename)
df = pd.read_table(file, sep=r"\s+")

# Statistical uncertainties.
statistical_uncertainties = df["stat"].to_numpy()
for iunc,unc in enumerate(statistical_uncertainties):
unc = self.central_values[iunc]*unc/100
statistical_uncertainties[iunc] = unc
self.statistical_uncertainties = statistical_uncertainties
# Kinematic quantieties.
self.central_values = df["Sigma"].to_numpy()
self.kinematics = df[["x", "Q2", "y"]].to_numpy()
self.kinematic_quantities = ["x", "Q2", "y"]

# Systematic uncertainties.
# remove the column containing the total uncertainty excluding
# procedural uncertainties.
df = df.drop(columns=["tot_noproc"])
sys_uncert_col_names = list(df.columns.values)[5:]
self.systematic_uncertainties = df[sys_uncert_col_names].to_numpy()
systematic_uncertainties = df[sys_uncert_col_names].to_numpy()
for iunc,unc in enumerate(systematic_uncertainties):
unc = self.central_values[iunc]*unc/100
systematic_uncertainties[iunc] = unc
self.systematic_uncertainties = systematic_uncertainties

# All uncertainties are treated as multiplicative.
systypes = []
for name in sys_uncert_col_names:
if(name == "uncor"):
systypes.append(("MULT", "UNCORR"))
else:
systypes.append(("MULT", "HC_" + name))
self.systypes = systypes
self.process = process
self.dataset_name = dataset_name
# Statistical uncertainties.
statistical_uncertainties = df["stat"].to_numpy(copy=True)
for iunc, unc in enumerate(statistical_uncertainties):
unc = self.central_values[iunc] * unc / 100
statistical_uncertainties[iunc] = unc
self.statistical_uncertainties = statistical_uncertainties

def main():
hera_ep = hera_commondata("./rawdata/HERA1+2_NCep_575.dat","HERACOMBNCEP575", "DIS_NCE")
hera_ep.write_new_commondata(Path("data_EP-SIGMARED.yaml"),
Path("kinematics_EP-SIGMARED.yaml"),
Path("uncertainties_EP-SIGMARED.yaml"))
# Systematic uncertainties.
# remove the column containing the total uncertainty excluding
# procedural uncertainties.
df = df.drop(columns=["tot_noproc"])
sys_uncert_col_names = list(df.columns.values)[5:]
self.systematic_uncertainties = df[sys_uncert_col_names].to_numpy()
systematic_uncertainties = df[sys_uncert_col_names].to_numpy()
for iunc, unc in enumerate(systematic_uncertainties):
unc = self.central_values[iunc] * unc / 100
systematic_uncertainties[iunc] = unc
self.systematic_uncertainties = systematic_uncertainties

# All uncertainties are treated as multiplicative.
systypes = []
for name in sys_uncert_col_names:
if name == "uncor":
systypes.append(("MULT", "UNCORR"))
else:
systypes.append(("MULT", "HC_" + name))
self.systypes = systypes
self.process = process
self.dataset_name = dataset_name

if __name__ == "__main__":
main()

def main():
hera_ep = hera_commondata("./rawdata/HERA1+2_NCep_575.dat", "HERACOMBNCEP575", "DIS_NCE")
hera_ep.write_new_commondata(
Path("data_EP-SIGMARED.yaml"),
Path("kinematics_EP-SIGMARED.yaml"),
Path("uncertainties_EP-SIGMARED.yaml"),
)


if __name__ == "__main__":
main()
Loading