Skip to content
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 HepData raw tables from the repository #2228

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
19 changes: 10 additions & 9 deletions .github/workflows/check_newcd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ jobs:
- name: Run the filters 📦
shell: bash -l {0}
run: |
download-hepdata
here=$PWD
readarray -d '' array < <(find ./nnpdf_data/nnpdf_data/commondata -name "filter.py" -print0)
for datname in "${array[@]}"; do dirpath=${datname%/*}; cd $dirpath; python filter.py || exit $?; cd $here; done
- name: Check for modified files 🛎️
uses: tj-actions/verify-changed-files@v20
id: verify-changed-files
- name: List all changed files and fail if any 🛎️
if: steps.verify-changed-files.outputs.files_changed == 'true'
env:
CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }}
- name: Check for modified commondata files 🛎️
shell: bash -l {0}
run: |
echo "Changed files: $CHANGED_FILES"
exit 1
if [[ -n "$(git diff --name-only)" ]]; then
echo "Some of the commondata files have changed ❌"
git diff --name-only
exit 1
else
echo "No modified commondata files ✅"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ iNSPIRE:
url: https://inspirehep.net/literature/856131
hepdata:
url: https://www.hepdata.net/record/ins856131
version: 1
implemented_observables:
- observable_name: ZRAP
observable:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ iNSPIRE:
url: "https://inspirehep.net/literature/1972986"
hepdata:
url: "https://www.hepdata.net/record/ins1972986"
version: 1
version: 2

version: 1
version_comment: "NA"
Expand Down
12 changes: 7 additions & 5 deletions nnpdf_data/nnpdf_data/commondata/LHCB_WPWM_7TEV_MUON/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def load_yaml(table_id: int, version: int = 1) -> dict:
ditionary containing the table contents

"""
filename = f"HEPData-ins1373300-v{version}-Table_{table_id}"
table = pathlib.Path(f"./rawdata/{filename}.yaml")
foldername = f"HEPData-ins1373300-v{version}-yaml"
table = pathlib.Path(f"./{foldername}/Table{table_id}.yaml")

return yaml.safe_load(table.read_text())

Expand Down Expand Up @@ -147,13 +147,15 @@ def get_errors(hepdata: dict, bin_index: list, indx: int = 0) -> dict:
return {"stat": stat, "sys_corr": sys_corr, "sys_beam": sys_beam, "sys_lumi": sys_lumi}


def read_corrmatrix(nb_datapoints: int) -> np.ndarray:
def read_corrmatrix(nb_datapoints: int, version: int = 1) -> np.ndarray:
"""Read the matrix and returns a symmetrized verions.

Parameters
----------
nb_datapoints: int
total number of datapoints
version: int
HepData version

Returns
-------
Expand All @@ -162,7 +164,7 @@ def read_corrmatrix(nb_datapoints: int) -> np.ndarray:

"""
corrmat = pd.read_csv(
"./rawdata/corrmat.corr",
f"./HEPData-ins1373300-v{version}-yaml/corrmat.corr",
names=[f'{i}' for i in range(nb_datapoints)],
delim_whitespace=True,
)
Expand Down Expand Up @@ -366,7 +368,7 @@ def main_filter(boson: str = "Z") -> None:

errors_combined = concatenate_dicts(combined_errors)
# Compute the Artifical Systematics from CovMat
corrmat = read_corrmatrix(nb_datapoints=nbpoints)
corrmat = read_corrmatrix(nb_datapoints=nbpoints, version=version)
covmat = multiply_syst(corrmat, errors_combined["sys_corr"])
artunc = generate_artificial_unc(ndata=nbpoints, covmat_list=covmat.tolist(), no_of_norm_mat=0)
errors = format_uncertainties(errors_combined, artunc, bslice)
Expand Down

This file was deleted.

Loading
Loading