From c7710d5bb02a3b70edf88490e8bf7aae307d45d3 Mon Sep 17 00:00:00 2001 From: Radonirinaunimi Date: Fri, 21 Feb 2025 18:16:26 +0100 Subject: [PATCH 01/19] Check if the difference between Grid and Fk is above some threshold and fail --- src/pineko/cli/compare.py | 13 +++++++++++-- src/pineko/comparator.py | 16 +++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/pineko/cli/compare.py b/src/pineko/cli/compare.py index 92e4d986..c231bf21 100644 --- a/src/pineko/cli/compare.py +++ b/src/pineko/cli/compare.py @@ -16,7 +16,14 @@ @click.argument("pdfs", type=click.STRING, nargs=-1) @click.option("--xir", default=1.0, help="renormalization scale variation") @click.option("--xif", default=1.0, help="factorization scale variation") -def subcommand(fktable_path, grid_path, max_as, max_al, pdfs, xir, xif): +@click.option( + "--check_accuracies/--no-check_accuracies", + default=True, + help="Check if the difference between Grid and FK is above 2 permille and if so fail", +) +def subcommand( + fktable_path, grid_path, max_as, max_al, pdfs, xir, xif, check_accuracies +): """Compare process level PineAPPL grid and derived FK Table. The comparison between the grid stored at PINEAPPL_PATH, and the FK table @@ -40,5 +47,7 @@ def subcommand(fktable_path, grid_path, max_as, max_al, pdfs, xir, xif): pdf2 = pdfs[1] if len(pdfs) == 2 else None # Note that we need to cast to string before printing to avoid ellipsis ... rich.print( - comparator.compare(pine, fk, max_as, max_al, pdf1, xir, xif, pdf2).to_string() + comparator.compare( + pine, fk, max_as, max_al, pdf1, xir, xif, check_accuracies, pdf2 + ).to_string() ) diff --git a/src/pineko/comparator.py b/src/pineko/comparator.py index bca2b382..1e9e0cca 100644 --- a/src/pineko/comparator.py +++ b/src/pineko/comparator.py @@ -6,7 +6,11 @@ import rich -def compare(pine, fktable, max_as, max_al, pdf1, xir, xif, pdf2=None): +class GridtoFKError(Exception): + """Raised when the difference between the Grid and FK table is above some threshold.""" + + +def compare(pine, fktable, max_as, max_al, pdf1, xir, xif, check_accuracies, pdf2=None): """Build comparison table. Parameters @@ -25,6 +29,9 @@ def compare(pine, fktable, max_as, max_al, pdf1, xir, xif, pdf2=None): renormalization scale variation xif : float factorization scale variation + check_accuracies: bool + check if the difference between the Grid and FK table is above 2 permille + and if so raise an error pdf2: str or None PDF set for the second convolution, if different from the first @@ -40,6 +47,7 @@ def compare(pine, fktable, max_as, max_al, pdf1, xir, xif, pdf2=None): pdfset2 = lhapdf.mkPDF(pdf2, 0) else: pdfset2 = pdfset1 + diff_threshold = 2 # in permille # TODO: This should probably changed in the future to use the Grid::convolutions try: @@ -112,4 +120,10 @@ def compare(pine, fktable, max_as, max_al, pdf1, xir, xif, pdf2=None): df["PineAPPL"] = before df["FkTable"] = after df["permille_error"] = (after / before - 1.0) * 1000.0 + + if check_accuracies and (df["permille_error"].abs() >= diff_threshold).any(): + raise GridtoFKError( + f"The difference between the Grid and FK is above {diff_threshold} permille." + ) + return df From 5532b079b764d5993b896ff8a647c63e2c4f4306 Mon Sep 17 00:00:00 2001 From: Radonirinaunimi Date: Fri, 21 Feb 2025 21:18:50 +0100 Subject: [PATCH 02/19] Add preliminary workflow --- .github/workflows/regression.yml | 58 ++++++++++++++++++++++++++++++++ download_test_data.sh | 1 + pineko.cli.toml | 16 +++++++++ 3 files changed, 75 insertions(+) create mode 100644 .github/workflows/regression.yml create mode 100644 pineko.cli.toml diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml new file mode 100644 index 00000000..e14e0528 --- /dev/null +++ b/.github/workflows/regression.yml @@ -0,0 +1,58 @@ +name: regression + +# Run only the CI upon request +on: + workflow_dispatch: + +# List of datasets separated by commas +env: + HADRONIC_DATASETS: "ATLAS_Z0_7TEV_36PB_ETA" + THEORYID: 40000000 + +jobs: + regresstion: + name: regression + runs-on: ubuntu-latest + + container: + image: ghcr.io/nnpdf/lhapdf:v2 + credentials: + username: ${{ github.repository_owner }} + password: ${{ github.token }} + + steps: + - uses: actions/checkout@v2 + with: + # tags needed for dynamic versioning + fetch-depth: 0 + - name: Install and configure Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: false + installer-parallel: true + - name: Install dependencies 🐍 + run: poetry install --no-interaction --no-root --with test -E nnpdf + - name: Install project 🐍 + # it is required to repeat extras, otherwise they will be removed from + # the environment + run: poetry install --no-interaction -E nnpdf + - name: Get data files 📦 + id: cache-data-files + uses: actions/cache@v4 + with: + path: theory_productions + key: theory_productions-v1 + - name: Download data files 📦 + if: steps.cache-data_files.outputs.cache-hit != 'true' + run: | + sh download_test_data.sh + - name: Generate the FK table predictions for Hadronic datasets + shell: bash -l {0} + run: | + IFS=',' read -r -a datasets_array <<< "$HADRONIC_DATASETS" + for dataset in "${datasets_array[@]}"; do + pineko theory -c pineko.cli.toml opcards --overwrite $THEORYID $dataset + pineko theory -c pineko.cli.toml ekos --overwrite $THEORYID $dataset + pineko theory -c pineko.cli.toml fks --overwrite $THEORYID $dataset + done + echo "✅ Hadronic FK tables generated succesfully." diff --git a/download_test_data.sh b/download_test_data.sh index 385d5c7e..4621dc0d 100644 --- a/download_test_data.sh +++ b/download_test_data.sh @@ -1,3 +1,4 @@ #!/bin/bash +wget -r -np -nH --cut-dirs=1 -l 4 -e robots=off --no-verbose -R index.* https://data.nnpdf.science/pineko/theory_productions/ wget -r -np -nH --cut-dirs=1 -l 4 -e robots=off --no-verbose -P benchmarks -R index.* https://data.nnpdf.science/pineko/data_files/ wget -r -np -nH --cut-dirs=1 -l 4 -e robots=off --no-verbose -P benchmarks -R index.* https://data.nnpdf.science/pineko/fakepdfs/ diff --git a/pineko.cli.toml b/pineko.cli.toml new file mode 100644 index 00000000..e1739c8f --- /dev/null +++ b/pineko.cli.toml @@ -0,0 +1,16 @@ +[general] +nnpdf=true + +[paths] +# inputs +grids = "./theory_productions/data/grids" +theory_cards = "./theory_productions/theory_cards" +operator_card_template_name = "_template.cli.toml" +# outputs +operator_cards = "./theory_productions/operator_cards" +ekos = "./theory_productions/data/ekos" +fktables = "./theory_productions/data/fktables" + +[paths.logs] +eko = "./theory_productions/logs/eko" +fk = "./theory_productions/logs/fk" From 1ed6173201ab5675a67d682bb393ab1669175a1d Mon Sep 17 00:00:00 2001 From: Radonirinaunimi Date: Fri, 21 Feb 2025 21:44:48 +0100 Subject: [PATCH 03/19] Fix how `threshold` is passed into the CLI for `compare` --- src/pineko/cli/compare.py | 10 +++------- src/pineko/comparator.py | 13 ++++++------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/pineko/cli/compare.py b/src/pineko/cli/compare.py index c231bf21..a6968eda 100644 --- a/src/pineko/cli/compare.py +++ b/src/pineko/cli/compare.py @@ -17,13 +17,9 @@ @click.option("--xir", default=1.0, help="renormalization scale variation") @click.option("--xif", default=1.0, help="factorization scale variation") @click.option( - "--check_accuracies/--no-check_accuracies", - default=True, - help="Check if the difference between Grid and FK is above 2 permille and if so fail", + "--threshold", default=5.0, help="threshold in permille to accept Grid -> FK" ) -def subcommand( - fktable_path, grid_path, max_as, max_al, pdfs, xir, xif, check_accuracies -): +def subcommand(fktable_path, grid_path, max_as, max_al, pdfs, xir, xif, threshold): """Compare process level PineAPPL grid and derived FK Table. The comparison between the grid stored at PINEAPPL_PATH, and the FK table @@ -48,6 +44,6 @@ def subcommand( # Note that we need to cast to string before printing to avoid ellipsis ... rich.print( comparator.compare( - pine, fk, max_as, max_al, pdf1, xir, xif, check_accuracies, pdf2 + pine, fk, max_as, max_al, pdf1, xir, xif, threshold, pdf2 ).to_string() ) diff --git a/src/pineko/comparator.py b/src/pineko/comparator.py index 1e9e0cca..b8375665 100644 --- a/src/pineko/comparator.py +++ b/src/pineko/comparator.py @@ -10,7 +10,7 @@ class GridtoFKError(Exception): """Raised when the difference between the Grid and FK table is above some threshold.""" -def compare(pine, fktable, max_as, max_al, pdf1, xir, xif, check_accuracies, pdf2=None): +def compare(pine, fktable, max_as, max_al, pdf1, xir, xif, threshold, pdf2=None): """Build comparison table. Parameters @@ -29,9 +29,9 @@ def compare(pine, fktable, max_as, max_al, pdf1, xir, xif, check_accuracies, pdf renormalization scale variation xif : float factorization scale variation - check_accuracies: bool - check if the difference between the Grid and FK table is above 2 permille - and if so raise an error + threshold: float + check if the difference between the Grid and FK table is above the + threshold then raise an error pdf2: str or None PDF set for the second convolution, if different from the first @@ -47,7 +47,6 @@ def compare(pine, fktable, max_as, max_al, pdf1, xir, xif, check_accuracies, pdf pdfset2 = lhapdf.mkPDF(pdf2, 0) else: pdfset2 = pdfset1 - diff_threshold = 2 # in permille # TODO: This should probably changed in the future to use the Grid::convolutions try: @@ -121,9 +120,9 @@ def compare(pine, fktable, max_as, max_al, pdf1, xir, xif, check_accuracies, pdf df["FkTable"] = after df["permille_error"] = (after / before - 1.0) * 1000.0 - if check_accuracies and (df["permille_error"].abs() >= diff_threshold).any(): + if (df["permille_error"].abs() >= threshold).any(): raise GridtoFKError( - f"The difference between the Grid and FK is above {diff_threshold} permille." + f"The difference between the Grid and FK is above {threshold} permille." ) return df From b41f755dcb8794d45475839d7cdba40e2961fffd Mon Sep 17 00:00:00 2001 From: Radonirinaunimi Date: Fri, 21 Feb 2025 21:54:41 +0100 Subject: [PATCH 04/19] Push forgotten fix for `pineko.comparator.compare` --- src/pineko/comparator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pineko/comparator.py b/src/pineko/comparator.py index b8375665..6856e81c 100644 --- a/src/pineko/comparator.py +++ b/src/pineko/comparator.py @@ -10,7 +10,7 @@ class GridtoFKError(Exception): """Raised when the difference between the Grid and FK table is above some threshold.""" -def compare(pine, fktable, max_as, max_al, pdf1, xir, xif, threshold, pdf2=None): +def compare(pine, fktable, max_as, max_al, pdf1, xir, xif, threshold=5.0, pdf2=None): """Build comparison table. Parameters From ad9d767102d9e2d2f5183225ab6cd9b14338f4f0 Mon Sep 17 00:00:00 2001 From: Radonirinaunimi Date: Fri, 21 Feb 2025 23:38:17 +0100 Subject: [PATCH 05/19] Change how the regression is triggered --- .github/workflows/regression.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index e14e0528..73923bb7 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -1,8 +1,9 @@ name: regression -# Run only the CI upon request +# start job only for PRs when a label is added. on: - workflow_dispatch: + pull_request: + types: [labeled] # List of datasets separated by commas env: @@ -11,6 +12,7 @@ env: jobs: regresstion: + if: contains(github.event.pull_request.labels.*.name, 'run-regression') name: regression runs-on: ubuntu-latest From 0ac62eb2ec3a399bc646d5079cb43f9b7d53a06f Mon Sep 17 00:00:00 2001 From: "Tanjona R. Rabemananjara" Date: Mon, 24 Feb 2025 09:58:06 +0100 Subject: [PATCH 06/19] Test self-hosted runner --- .github/workflows/regression.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 73923bb7..63ed2ad4 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -1,9 +1,9 @@ name: regression # start job only for PRs when a label is added. -on: - pull_request: - types: [labeled] +on: push + # pull_request: + # types: [labeled] # List of datasets separated by commas env: @@ -14,7 +14,7 @@ jobs: regresstion: if: contains(github.event.pull_request.labels.*.name, 'run-regression') name: regression - runs-on: ubuntu-latest + runs-on: pineko-stbc3 container: image: ghcr.io/nnpdf/lhapdf:v2 From f188499e672785f3512e449fac4cdc7cd426b3bb Mon Sep 17 00:00:00 2001 From: "Tanjona R. Rabemananjara" Date: Mon, 24 Feb 2025 09:59:06 +0100 Subject: [PATCH 07/19] Remove label check for the time being --- .github/workflows/regression.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 63ed2ad4..3c3a0632 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -12,7 +12,7 @@ env: jobs: regresstion: - if: contains(github.event.pull_request.labels.*.name, 'run-regression') + # if: contains(github.event.pull_request.labels.*.name, 'run-regression') name: regression runs-on: pineko-stbc3 From c68d9116e32c941bed897a54c84dcbb9a4c089e3 Mon Sep 17 00:00:00 2001 From: "Tanjona R. Rabemananjara" Date: Mon, 24 Feb 2025 10:23:40 +0100 Subject: [PATCH 08/19] Try without using LHAPDF container --- .github/workflows/regression.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 3c3a0632..d937694b 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -16,11 +16,11 @@ jobs: name: regression runs-on: pineko-stbc3 - container: - image: ghcr.io/nnpdf/lhapdf:v2 - credentials: - username: ${{ github.repository_owner }} - password: ${{ github.token }} + # container: + # image: ghcr.io/nnpdf/lhapdf:v2 + # credentials: + # username: ${{ github.repository_owner }} + # password: ${{ github.token }} steps: - uses: actions/checkout@v2 From b099ee7eb502e1d45c4620d69b58fd6416528f65 Mon Sep 17 00:00:00 2001 From: Tanjona Rabemananjara Date: Mon, 24 Feb 2025 13:43:12 +0100 Subject: [PATCH 09/19] Cache numba compiled codes --- .github/workflows/regression.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index d937694b..496577fa 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -48,6 +48,14 @@ jobs: if: steps.cache-data_files.outputs.cache-hit != 'true' run: | sh download_test_data.sh + - name: Restore cached numba compile code + # TODO: Make this more restrictive: check only numba-related codes. + id: cache-numba + uses: actions/cache@v4 + with: + path: src/pineko/__pycache__ + key: numba-cache-${{ runner.os }}-${{ hashFiles('**/*.py') }} + restore-keys: numba-cache-${{ runner.os }}- - name: Generate the FK table predictions for Hadronic datasets shell: bash -l {0} run: | @@ -58,3 +66,8 @@ jobs: pineko theory -c pineko.cli.toml fks --overwrite $THEORYID $dataset done echo "✅ Hadronic FK tables generated succesfully." + - name: Save updated numba cache + uses: actions/cache@v4 + with: + path: src/pineko/__pycache__ + key: numba-cache-${{ runner.os }}-${{ hashFiles('**/*.py') }} From 5b56436b59235f31b70d3686593ce96be5e5a3e3 Mon Sep 17 00:00:00 2001 From: Radonirinaunimi Date: Mon, 24 Feb 2025 16:43:04 +0100 Subject: [PATCH 10/19] Add nFONLL DIS to the regression --- .github/workflows/regression.yml | 22 +++++++++++++++++++++- pineko.cli.toml | 1 - 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 496577fa..cd784a12 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -7,6 +7,7 @@ on: push # List of datasets separated by commas env: + DIS_DATASETS: "HERA_CC_318GEV_EP-SIGMARED" HADRONIC_DATASETS: "ATLAS_Z0_7TEV_36PB_ETA" THEORYID: 40000000 @@ -43,7 +44,7 @@ jobs: uses: actions/cache@v4 with: path: theory_productions - key: theory_productions-v1 + key: theory_productions-v2 - name: Download data files 📦 if: steps.cache-data_files.outputs.cache-hit != 'true' run: | @@ -56,6 +57,25 @@ jobs: path: src/pineko/__pycache__ key: numba-cache-${{ runner.os }}-${{ hashFiles('**/*.py') }} restore-keys: numba-cache-${{ runner.os }}- + - name: Generate the FK table predictions for DIS datasets with nFONLL + shell: bash -l {0} + run: | + IFS=',' read -r -a datasets_array <<< "$DIS_DATASETS" + NFONLL_ID=$(($THEORYID*100)) + for dataset in "${datasets_array[@]}"; do + pineko fonll -c pineko.cli.toml tcards --overwrite $THEORYID + pineko fonll -c pineko.cli.toml ekos --overwrite $THEORYID $dataset + pineko fonll -c pineko.cli.toml fks --overwrite $THEORYID $dataset + pineko fonll -c pineko.cli.toml combine --overwrite $THEORYID $dataset \ + --FFNS3 $NFONLL_ID \ + --FFN03 $(($NFONLL_ID+1)) \ + --FFNS4zeromass $(($NFONLL_ID+2)) \ + --FFNS4massive $(($NFONLL_ID+3)) \ + --FFN04 $(($NFONLL_ID+4)) \ + --FFNS5zeromass $(($NFONLL_ID+5)) \ + --FFNS5massive $(($NFONLL_ID+6)) + done + echo "✅ DIS FK tables generated succesfully." - name: Generate the FK table predictions for Hadronic datasets shell: bash -l {0} run: | diff --git a/pineko.cli.toml b/pineko.cli.toml index e1739c8f..40acfbec 100644 --- a/pineko.cli.toml +++ b/pineko.cli.toml @@ -4,7 +4,6 @@ nnpdf=true [paths] # inputs grids = "./theory_productions/data/grids" -theory_cards = "./theory_productions/theory_cards" operator_card_template_name = "_template.cli.toml" # outputs operator_cards = "./theory_productions/operator_cards" From 60d18eb16b4b4d74dad2f00cc5f23766540cc1b8 Mon Sep 17 00:00:00 2001 From: Radonirinaunimi Date: Tue, 25 Feb 2025 00:02:03 +0100 Subject: [PATCH 11/19] Move full regression into a script and add skeleton compare with reference FKs --- .github/workflows/regression.yml | 37 ++---------- poetry.lock | 37 +++++++++++- pyproject.toml | 1 + regression_check.sh | 99 ++++++++++++++++++++++++++++++++ 4 files changed, 141 insertions(+), 33 deletions(-) create mode 100755 regression_check.sh diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index cd784a12..ddd974fc 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -38,7 +38,7 @@ jobs: - name: Install project 🐍 # it is required to repeat extras, otherwise they will be removed from # the environment - run: poetry install --no-interaction -E nnpdf + run: poetry install --no-interaction -E nnpdf --with test - name: Get data files 📦 id: cache-data-files uses: actions/cache@v4 @@ -49,44 +49,17 @@ jobs: if: steps.cache-data_files.outputs.cache-hit != 'true' run: | sh download_test_data.sh - - name: Restore cached numba compile code - # TODO: Make this more restrictive: check only numba-related codes. + - name: Restore cached numba compile code 📮 id: cache-numba uses: actions/cache@v4 with: path: src/pineko/__pycache__ key: numba-cache-${{ runner.os }}-${{ hashFiles('**/*.py') }} restore-keys: numba-cache-${{ runner.os }}- - - name: Generate the FK table predictions for DIS datasets with nFONLL - shell: bash -l {0} + - name: Generate FK table predictions and perform regression tests 💣 run: | - IFS=',' read -r -a datasets_array <<< "$DIS_DATASETS" - NFONLL_ID=$(($THEORYID*100)) - for dataset in "${datasets_array[@]}"; do - pineko fonll -c pineko.cli.toml tcards --overwrite $THEORYID - pineko fonll -c pineko.cli.toml ekos --overwrite $THEORYID $dataset - pineko fonll -c pineko.cli.toml fks --overwrite $THEORYID $dataset - pineko fonll -c pineko.cli.toml combine --overwrite $THEORYID $dataset \ - --FFNS3 $NFONLL_ID \ - --FFN03 $(($NFONLL_ID+1)) \ - --FFNS4zeromass $(($NFONLL_ID+2)) \ - --FFNS4massive $(($NFONLL_ID+3)) \ - --FFN04 $(($NFONLL_ID+4)) \ - --FFNS5zeromass $(($NFONLL_ID+5)) \ - --FFNS5massive $(($NFONLL_ID+6)) - done - echo "✅ DIS FK tables generated succesfully." - - name: Generate the FK table predictions for Hadronic datasets - shell: bash -l {0} - run: | - IFS=',' read -r -a datasets_array <<< "$HADRONIC_DATASETS" - for dataset in "${datasets_array[@]}"; do - pineko theory -c pineko.cli.toml opcards --overwrite $THEORYID $dataset - pineko theory -c pineko.cli.toml ekos --overwrite $THEORYID $dataset - pineko theory -c pineko.cli.toml fks --overwrite $THEORYID $dataset - done - echo "✅ Hadronic FK tables generated succesfully." - - name: Save updated numba cache + sh regression_check.sh + - name: Save updated numba cache 📮 uses: actions/cache@v4 with: path: src/pineko/__pycache__ diff --git a/poetry.lock b/poetry.lock index cc68482a..c246f704 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1721,6 +1721,41 @@ cli = ["pineappl-cli"] docs = ["nbsphinx (>=0.9.2)", "sphinx (>=6.2.1)", "sphinx-rtd-theme (>=1.2.2)", "sphinxcontrib-bibtex (>=2.5.0)"] test = ["pytest", "pytest-cov"] +[[package]] +name = "pineappl-cli" +version = "0.8.7" +description = "Read, write, and query PineAPPL grids" +optional = false +python-versions = "*" +files = [ + {file = "pineappl_cli-0.8.7-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:9623beb98b3a58da1050848598c41001468f61d43b56b0c6ec0a712c892931b0"}, + {file = "pineappl_cli-0.8.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:434f91fa09d7942b463026d11398d423821046dde4d80b17d6ddf43994c1f9a1"}, + {file = "pineappl_cli-0.8.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e5bbd6927fce4ecdcd7de327013448f6dfcf9e47067c3f5ee72815eee3443c8"}, + {file = "pineappl_cli-0.8.7-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:f59f9c8f048bf04e92a3ab030892d6093c71b3580ece682bca423c0d26c31a11"}, + {file = "pineappl_cli-0.8.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26625e80846b8eb0a590e1294eee22b5feda45ba6785131c3f70f00c168da398"}, + {file = "pineappl_cli-0.8.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c78f1a8a77d5c23cdbabb0a0f92e28234a6917ea49725e24ec2d84a4d00151a"}, + {file = "pineappl_cli-0.8.7-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:df56c693a998a1dcf9cf74882f212c6afd51375e90a73683cc16e795a7a48b98"}, + {file = "pineappl_cli-0.8.7-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b3ddeb079aab4741cc7e34e530eca3f6dea00afb1d0b0ea6406fec88b96d217d"}, + {file = "pineappl_cli-0.8.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c73222a02afeed8a5999f4a9a7e96aed5bee112b116f11f001994a3bc6f4b13"}, + {file = "pineappl_cli-0.8.7-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:1f2da5b73bd2ac4d7f5226db0d72bc424fde39a0cea42b3dfa266d100c3ceccb"}, + {file = "pineappl_cli-0.8.7-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:033543cd3be5d48f5e95abffd7638a6197f324566d734b21dbca83ce3bea9e10"}, + {file = "pineappl_cli-0.8.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:12a6457b5ae97aa392ca249974894e7f1e60cb881f48b3c409db2712f1928320"}, + {file = "pineappl_cli-0.8.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f77412b1ad7726e937c361868399fd8923a48ae7de9e768b31fe404337514179"}, + {file = "pineappl_cli-0.8.7-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:27eafd03b1a352f67bb6c0e26a03b027039efae67485be5d0dec7f650a559c33"}, + {file = "pineappl_cli-0.8.7-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:d8d1bfcbb1996387d020298bcf7d4b6276b935fcc8e89afb14ed86cc94db0b1f"}, + {file = "pineappl_cli-0.8.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:63ae66d14cfe38eb3d31e445a344ff5e672561d88bdf04da359f9b5a1f63def7"}, + {file = "pineappl_cli-0.8.7-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:1172d800b3e4d22c322892b2f7e603028f37d6848690407e759bfb16a320544a"}, + {file = "pineappl_cli-0.8.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0756f6ed6bf1bc081fe40647e2dded2c806afdd3ccbd1301d484f6c971977e1f"}, + {file = "pineappl_cli-0.8.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8753bcfeac586b084013b6731804a8c178dc9333faaf28d5e806178481f84a86"}, + {file = "pineappl_cli-0.8.7-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f6857e1add4d1028f0f5171dde30b3e1e5f2b0c4f722cd4f2c21717846d2a7c7"}, + {file = "pineappl_cli-0.8.7-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:0ae8539b0464faa2ab5fd22916fa12acd7b607ea97db3dbda7f189c70dc2402e"}, + {file = "pineappl_cli-0.8.7-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c7c1d6ce3b86ba1baa23eeb44bb7fde15d9d2cd51115d702d81a7965ea79dbf"}, + {file = "pineappl_cli-0.8.7-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:95dc225a1fd507c8979d96cd5195e62efab4449f72f4f4d12713a00a9e90bb25"}, + {file = "pineappl_cli-0.8.7-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:7436b6a048b9a526b19c04ad1577008b1fd089df75a920e4b8bb2dc9942d37da"}, + {file = "pineappl_cli-0.8.7-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:0d43ca94f4fa25848ea95048f1c451227bd68d022afb3c1e5346ab2e6d783e75"}, + {file = "pineappl_cli-0.8.7-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:2b7a9c8265b89cb176cec909003c9106bba5e13de4d6997fea7301111319ff2f"}, +] + [[package]] name = "platformdirs" version = "4.3.6" @@ -2682,4 +2717,4 @@ nnpdf = ["nnpdf-data"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.13" -content-hash = "650387179ae5ea33ecbb1046d689aaee9bbf9be8610194321da027eebb1a8814" +content-hash = "f2993360a53c3e750055dab848703d6915dc2ece42a24d0e6b43885bed9963e6" diff --git a/pyproject.toml b/pyproject.toml index b9c07b30..72211f57 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,6 +56,7 @@ pytest-cov = "^4.0.0" pytest-env = "^0.6.2" pylint = "^3.1.0" banana-hep = "^0.6.13" +pineappl-cli = "^0.8.7" [tool.poetry.group.dev.dependencies] pdbpp = "^0.10.3" diff --git a/regression_check.sh b/regression_check.sh new file mode 100755 index 00000000..389bb774 --- /dev/null +++ b/regression_check.sh @@ -0,0 +1,99 @@ +#!/bin/bash + +set -euo pipefail + +THEORY_ID=40000000 +LIST_DIS_DATASETS="HERA_CC_318GEV_EP-SIGMARED" +LIST_HADRONIC_DATASETS="ATLAS_Z0_7TEV_36PB_ETA" +PDF_NAME="NNPDF40_nnlo_as_01180" + +dis_predictions() { + THEORYID=$1 + DIS_DATASETS=$2 + NFONLL_ID=$(($THEORYID*100)) + + IFS=',' read -r -a datasets_array <<< "$DIS_DATASETS" + for dataset in "${datasets_array[@]}"; do + pineko fonll -c pineko.cli.toml tcards $THEORYID + pineko fonll -c pineko.cli.toml ekos --overwrite $THEORYID $dataset + pineko fonll -c pineko.cli.toml fks --overwrite $THEORYID $dataset + pineko fonll -c pineko.cli.toml combine --overwrite $THEORYID $dataset \ + --FFNS3 $NFONLL_ID \ + --FFN03 $(($NFONLL_ID+1)) \ + --FFNS4zeromass $(($NFONLL_ID+2)) \ + --FFNS4massive $(($NFONLL_ID+3)) \ + --FFN04 $(($NFONLL_ID+4)) \ + --FFNS5zeromass $(($NFONLL_ID+5)) \ + --FFNS5massive $(($NFONLL_ID+6)) + done + + # Compare the DIS FK tables with the Grids + grids=(./theory_productions/data/grids/"$NFONLL_ID"/*.pineappl.lz4) + for gridpath in "${grids[@]}"; do + gridname=$(basename "$gridpath") + for idx in {0..6}; do + NFONLL_IDX=$((NFONLL_ID+idx)) + pineko compare ./theory_productions/data/fktables/"$NFONLL_IDX"/"$gridname" \ + ./theory_productions/data/grids/"$NFONLL_IDX"/"$gridname" 2 0 \ + $PDF_NAME --threshold 2000 # TODO: Check what is happening here + done + done +} + +hadronic_predictions() { + THEORYID=$1 + HADRONIC_DATASETS=$2 + + IFS=',' read -r -a datasets_array <<< "$HADRONIC_DATASETS" + for dataset in "${datasets_array[@]}"; do + pineko theory -c pineko.cli.toml opcards --overwrite $THEORYID $dataset + pineko theory -c pineko.cli.toml ekos --overwrite $THEORYID $dataset + pineko theory -c pineko.cli.toml fks --overwrite $THEORYID $dataset + done + + # Compare the Hadronic FK tables with the Grids + grids=(theory_productions/data/grids/"$THEORYID"/*.pineappl.lz4) + for gridpath in "${grids[@]}"; do + gridname=$(basename "$gridpath") + pineko compare ./theory_productions/data/fktables/"$THEORYID"/"$gridname" \ + ./theory_productions/data/grids/"$THEORYID"/"$gridname" 2 0 \ + $PDF_NAME --threshold 2 + done +} + +compare_predictions() { + REFERED_FK=$1 + CURRENT_FK=$2 + + # Extract the predictions - the last column + diffs=($(pineappl diff $REFERED_FK $CURRENT_FK $PDF_NAME | awk 'NR>2 {print $NF}')) + + preds_length=${#diffs[@]} # Get the length of the predictions + for ((bin=0; bin 0.005" | bc) # Set threshold to 5 permille + + if [[ $check_diff -eq 1 ]]; then + echo "Bin $bin: ($REFERED_FK) and ($CURRENT_FK) differ more than 5 permille." + exit 1 + fi + done +} + +compare_fks_with_reference() { + THEORYID=$1 + fktables=(./theory_productions/data/fktables/"$THEORYID"/*.pineappl.lz4) + for fktable_path in "${fktables[@]}"; do + fkname=$(basename "$fktable_path") + fkref="./theory_productions/data/fktables/$THEORYID/$fkname" + fkcur="./theory_productions/data/fktables/$THEORYID/$fkname" # TODO + compare_predictions "$fkref" "$fkcur" + done +} + +dis_predictions $THEORY_ID $LIST_DIS_DATASETS +hadronic_predictions $THEORY_ID $LIST_HADRONIC_DATASETS +compare_fks_with_reference $THEORY_ID From 306d05bea7d17417294260445c45454ed01fb69f Mon Sep 17 00:00:00 2001 From: Tanjona Rabemananjara Date: Tue, 25 Feb 2025 00:46:55 +0100 Subject: [PATCH 12/19] Remove no longer needed env. variables --- .github/workflows/regression.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index ddd974fc..28bbae9b 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -5,12 +5,6 @@ on: push # pull_request: # types: [labeled] -# List of datasets separated by commas -env: - DIS_DATASETS: "HERA_CC_318GEV_EP-SIGMARED" - HADRONIC_DATASETS: "ATLAS_Z0_7TEV_36PB_ETA" - THEORYID: 40000000 - jobs: regresstion: # if: contains(github.event.pull_request.labels.*.name, 'run-regression') From 94ad99455039a20099d1c9300055e42e70ba9b25 Mon Sep 17 00:00:00 2001 From: Radonirinaunimi Date: Tue, 25 Feb 2025 09:30:46 +0100 Subject: [PATCH 13/19] Make datasets into proper lists --- regression_check.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/regression_check.sh b/regression_check.sh index 389bb774..b8f456f1 100755 --- a/regression_check.sh +++ b/regression_check.sh @@ -3,17 +3,17 @@ set -euo pipefail THEORY_ID=40000000 -LIST_DIS_DATASETS="HERA_CC_318GEV_EP-SIGMARED" -LIST_HADRONIC_DATASETS="ATLAS_Z0_7TEV_36PB_ETA" PDF_NAME="NNPDF40_nnlo_as_01180" +LIST_DIS_DATASETS=("HERA_CC_318GEV_EP-SIGMARED") +LIST_HADRONIC_DATASETS=("ATLAS_Z0_7TEV_36PB_ETA") + dis_predictions() { THEORYID=$1 DIS_DATASETS=$2 NFONLL_ID=$(($THEORYID*100)) - IFS=',' read -r -a datasets_array <<< "$DIS_DATASETS" - for dataset in "${datasets_array[@]}"; do + for dataset in "${DIS_DATASETS[@]}"; do pineko fonll -c pineko.cli.toml tcards $THEORYID pineko fonll -c pineko.cli.toml ekos --overwrite $THEORYID $dataset pineko fonll -c pineko.cli.toml fks --overwrite $THEORYID $dataset @@ -44,8 +44,7 @@ hadronic_predictions() { THEORYID=$1 HADRONIC_DATASETS=$2 - IFS=',' read -r -a datasets_array <<< "$HADRONIC_DATASETS" - for dataset in "${datasets_array[@]}"; do + for dataset in "${HADRONIC_DATASETS[@]}"; do pineko theory -c pineko.cli.toml opcards --overwrite $THEORYID $dataset pineko theory -c pineko.cli.toml ekos --overwrite $THEORYID $dataset pineko theory -c pineko.cli.toml fks --overwrite $THEORYID $dataset From e42c1340db258bbac2646ef12c21a47dcd6489fe Mon Sep 17 00:00:00 2001 From: Radonirinaunimi Date: Tue, 25 Feb 2025 22:31:29 +0100 Subject: [PATCH 14/19] Set `nnpdf-data` version to be `>=0.0.3` --- poetry.lock | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/poetry.lock b/poetry.lock index c246f704..b2382632 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2717,4 +2717,4 @@ nnpdf = ["nnpdf-data"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.13" -content-hash = "f2993360a53c3e750055dab848703d6915dc2ece42a24d0e6b43885bed9963e6" +content-hash = "ed38f32b8a314865b33cb54ac0f82d978a440ae9b3dc240edf0da8d65b2782c8" diff --git a/pyproject.toml b/pyproject.toml index 72211f57..342df04f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ pandas = "^2.1" rich = "^12.5.1" click = "^8.0.4" tomli = "^2.0.1" -nnpdf-data = { version = "*", optional = true} +nnpdf-data = { version = ">=0.0.3", optional = true} [tool.poetry.group.docs] optional = true From 1daec68da83d6a2fe9733b499fcc777992b5b5d8 Mon Sep 17 00:00:00 2001 From: Radonirinaunimi Date: Wed, 26 Feb 2025 16:15:54 +0100 Subject: [PATCH 15/19] Use a different theory and make full pipeline work --- .github/workflows/regression.yml | 2 +- regression_check.sh | 24 ++++++------------------ 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 28bbae9b..89b4f50c 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -38,7 +38,7 @@ jobs: uses: actions/cache@v4 with: path: theory_productions - key: theory_productions-v2 + key: theory_productions-v3 - name: Download data files 📦 if: steps.cache-data_files.outputs.cache-hit != 'true' run: | diff --git a/regression_check.sh b/regression_check.sh index b8f456f1..f7ef1d6c 100755 --- a/regression_check.sh +++ b/regression_check.sh @@ -2,7 +2,7 @@ set -euo pipefail -THEORY_ID=40000000 +THEORY_ID=40008005 PDF_NAME="NNPDF40_nnlo_as_01180" LIST_DIS_DATASETS=("HERA_CC_318GEV_EP-SIGMARED") @@ -26,18 +26,6 @@ dis_predictions() { --FFNS5zeromass $(($NFONLL_ID+5)) \ --FFNS5massive $(($NFONLL_ID+6)) done - - # Compare the DIS FK tables with the Grids - grids=(./theory_productions/data/grids/"$NFONLL_ID"/*.pineappl.lz4) - for gridpath in "${grids[@]}"; do - gridname=$(basename "$gridpath") - for idx in {0..6}; do - NFONLL_IDX=$((NFONLL_ID+idx)) - pineko compare ./theory_productions/data/fktables/"$NFONLL_IDX"/"$gridname" \ - ./theory_productions/data/grids/"$NFONLL_IDX"/"$gridname" 2 0 \ - $PDF_NAME --threshold 2000 # TODO: Check what is happening here - done - done } hadronic_predictions() { @@ -55,8 +43,8 @@ hadronic_predictions() { for gridpath in "${grids[@]}"; do gridname=$(basename "$gridpath") pineko compare ./theory_productions/data/fktables/"$THEORYID"/"$gridname" \ - ./theory_productions/data/grids/"$THEORYID"/"$gridname" 2 0 \ - $PDF_NAME --threshold 2 + ./theory_productions/data/grids/"$THEORYID"/"$gridname" 3 0 \ + $PDF_NAME --threshold 1 done } @@ -73,10 +61,10 @@ compare_predictions() { value=$(printf "%.16f" "$pred_value") # Make sure it is in float representation # https://www.shell-tips.com/bash/math-arithmetic-calculation/#gsc.tab=0 abs_diff=$(echo "scale=10; if ($value< 0) -($value) else $value" | bc) - check_diff=$(echo "$abs_diff > 0.005" | bc) # Set threshold to 5 permille + check_diff=$(echo "$abs_diff > 0.001" | bc) # Set threshold to 1 permille if [[ $check_diff -eq 1 ]]; then - echo "Bin $bin: ($REFERED_FK) and ($CURRENT_FK) differ more than 5 permille." + echo "Bin $bin: ($REFERED_FK) and ($CURRENT_FK) differ more than 1 permille." exit 1 fi done @@ -88,7 +76,7 @@ compare_fks_with_reference() { for fktable_path in "${fktables[@]}"; do fkname=$(basename "$fktable_path") fkref="./theory_productions/data/fktables/$THEORYID/$fkname" - fkcur="./theory_productions/data/fktables/$THEORYID/$fkname" # TODO + fkcur="./theory_productions/reference_fks/$THEORYID/$fkname" compare_predictions "$fkref" "$fkcur" done } From 5e89cb9964aefbae2cef1a9457a09c60b32bb99d Mon Sep 17 00:00:00 2001 From: Radonirinaunimi Date: Thu, 27 Feb 2025 16:39:40 +0100 Subject: [PATCH 16/19] Various minor fixes and add more datasets --- .github/workflows/regression.yml | 2 +- pineko.cli.toml => pineko.ci.toml | 2 +- regression_check.sh | 36 +++++++++++++++++-------------- 3 files changed, 22 insertions(+), 18 deletions(-) rename pineko.cli.toml => pineko.ci.toml (86%) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 89b4f50c..30ab4a07 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -38,7 +38,7 @@ jobs: uses: actions/cache@v4 with: path: theory_productions - key: theory_productions-v3 + key: theory_productions-v4 - name: Download data files 📦 if: steps.cache-data_files.outputs.cache-hit != 'true' run: | diff --git a/pineko.cli.toml b/pineko.ci.toml similarity index 86% rename from pineko.cli.toml rename to pineko.ci.toml index 40acfbec..0a202214 100644 --- a/pineko.cli.toml +++ b/pineko.ci.toml @@ -4,7 +4,7 @@ nnpdf=true [paths] # inputs grids = "./theory_productions/data/grids" -operator_card_template_name = "_template.cli.toml" +operator_card_template_name = "_template.ci.yaml" # outputs operator_cards = "./theory_productions/operator_cards" ekos = "./theory_productions/data/ekos" diff --git a/regression_check.sh b/regression_check.sh index f7ef1d6c..2caadb21 100755 --- a/regression_check.sh +++ b/regression_check.sh @@ -5,19 +5,24 @@ set -euo pipefail THEORY_ID=40008005 PDF_NAME="NNPDF40_nnlo_as_01180" -LIST_DIS_DATASETS=("HERA_CC_318GEV_EP-SIGMARED") -LIST_HADRONIC_DATASETS=("ATLAS_Z0_7TEV_36PB_ETA") +LIST_DIS_DATASETS=( + "HERA_CC_318GEV_EP-SIGMARED" +) +LIST_HADRONIC_DATASETS=( + "ATLAS_Z0_7TEV_36PB_ETA" + "LHCB_WPWM_8TEV_MUON_Y" + "ATLAS_SINGLETOP_8TEV_T-RAP-NORM" +) dis_predictions() { THEORYID=$1 - DIS_DATASETS=$2 NFONLL_ID=$(($THEORYID*100)) - for dataset in "${DIS_DATASETS[@]}"; do - pineko fonll -c pineko.cli.toml tcards $THEORYID - pineko fonll -c pineko.cli.toml ekos --overwrite $THEORYID $dataset - pineko fonll -c pineko.cli.toml fks --overwrite $THEORYID $dataset - pineko fonll -c pineko.cli.toml combine --overwrite $THEORYID $dataset \ + for dataset in "${LIST_DIS_DATASETS[@]}"; do + pineko fonll -c pineko.ci.toml tcards $THEORYID + pineko fonll -c pineko.ci.toml ekos --overwrite $THEORYID $dataset + pineko fonll -c pineko.ci.toml fks --overwrite $THEORYID $dataset + pineko fonll -c pineko.ci.toml combine --overwrite $THEORYID $dataset \ --FFNS3 $NFONLL_ID \ --FFN03 $(($NFONLL_ID+1)) \ --FFNS4zeromass $(($NFONLL_ID+2)) \ @@ -30,12 +35,11 @@ dis_predictions() { hadronic_predictions() { THEORYID=$1 - HADRONIC_DATASETS=$2 - for dataset in "${HADRONIC_DATASETS[@]}"; do - pineko theory -c pineko.cli.toml opcards --overwrite $THEORYID $dataset - pineko theory -c pineko.cli.toml ekos --overwrite $THEORYID $dataset - pineko theory -c pineko.cli.toml fks --overwrite $THEORYID $dataset + for dataset in "${LIST_HADRONIC_DATASETS[@]}"; do + pineko theory -c pineko.ci.toml opcards --overwrite $THEORYID $dataset + pineko theory -c pineko.ci.toml ekos --overwrite $THEORYID $dataset + pineko theory -c pineko.ci.toml fks --overwrite $THEORYID $dataset done # Compare the Hadronic FK tables with the Grids @@ -44,7 +48,7 @@ hadronic_predictions() { gridname=$(basename "$gridpath") pineko compare ./theory_productions/data/fktables/"$THEORYID"/"$gridname" \ ./theory_productions/data/grids/"$THEORYID"/"$gridname" 3 0 \ - $PDF_NAME --threshold 1 + $PDF_NAME --threshold 2 # set threshold to 2 permille done } @@ -81,6 +85,6 @@ compare_fks_with_reference() { done } -dis_predictions $THEORY_ID $LIST_DIS_DATASETS -hadronic_predictions $THEORY_ID $LIST_HADRONIC_DATASETS +dis_predictions $THEORY_ID +hadronic_predictions $THEORY_ID compare_fks_with_reference $THEORY_ID From 04e91d6a2abc0577ab8c5c6310b417f0e3a2676f Mon Sep 17 00:00:00 2001 From: Radonirinaunimi Date: Thu, 27 Feb 2025 16:43:00 +0100 Subject: [PATCH 17/19] Trigger only actions in presence of label --- .github/workflows/regression.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 30ab4a07..7b02cf47 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -1,22 +1,16 @@ name: regression # start job only for PRs when a label is added. -on: push - # pull_request: - # types: [labeled] +on: + pull_request: + types: [labeled] jobs: regresstion: - # if: contains(github.event.pull_request.labels.*.name, 'run-regression') + if: contains(github.event.pull_request.labels.*.name, 'run-regression') name: regression runs-on: pineko-stbc3 - # container: - # image: ghcr.io/nnpdf/lhapdf:v2 - # credentials: - # username: ${{ github.repository_owner }} - # password: ${{ github.token }} - steps: - uses: actions/checkout@v2 with: From 3727b9d05d3d77364844b151b7edc32efebade97 Mon Sep 17 00:00:00 2001 From: Radonirinaunimi Date: Mon, 10 Mar 2025 10:01:37 +0100 Subject: [PATCH 18/19] Add multiple convolutions --- .github/workflows/regression.yml | 2 +- regression_check.sh | 103 ++++++++++++++++++++++--------- 2 files changed, 75 insertions(+), 30 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 7b02cf47..7e68ad02 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v4 with: path: theory_productions - key: theory_productions-v4 + key: theory_productions-v5 - name: Download data files 📦 if: steps.cache-data_files.outputs.cache-hit != 'true' run: | diff --git a/regression_check.sh b/regression_check.sh index 2caadb21..06f0435e 100755 --- a/regression_check.sh +++ b/regression_check.sh @@ -2,62 +2,62 @@ set -euo pipefail -THEORY_ID=40008005 +THEORY_ID=40008005 # NNLO QCD with EXA PDF_NAME="NNPDF40_nnlo_as_01180" +POLARIZED_THEORY_ID=41100010 # NLO QCD⊗EWK with TRN +POLARIZED_POLPDF_NAME="NNPDFpol20_nlo_as_01180" +POLARIZED_UNPOLPDF_NAME="NNPDF40_nlo_pch_as_01180" + LIST_DIS_DATASETS=( "HERA_CC_318GEV_EP-SIGMARED" ) + LIST_HADRONIC_DATASETS=( "ATLAS_Z0_7TEV_36PB_ETA" "LHCB_WPWM_8TEV_MUON_Y" "ATLAS_SINGLETOP_8TEV_T-RAP-NORM" ) -dis_predictions() { - THEORYID=$1 - NFONLL_ID=$(($THEORYID*100)) +LIST_POLARIZED_HADRONIC_DATASETS=( + "STAR_WMWP_510GEV_WP-AL" +) - for dataset in "${LIST_DIS_DATASETS[@]}"; do - pineko fonll -c pineko.ci.toml tcards $THEORYID - pineko fonll -c pineko.ci.toml ekos --overwrite $THEORYID $dataset - pineko fonll -c pineko.ci.toml fks --overwrite $THEORYID $dataset - pineko fonll -c pineko.ci.toml combine --overwrite $THEORYID $dataset \ - --FFNS3 $NFONLL_ID \ - --FFN03 $(($NFONLL_ID+1)) \ - --FFNS4zeromass $(($NFONLL_ID+2)) \ - --FFNS4massive $(($NFONLL_ID+3)) \ - --FFN04 $(($NFONLL_ID+4)) \ - --FFNS5zeromass $(($NFONLL_ID+5)) \ - --FFNS5massive $(($NFONLL_ID+6)) - done +get_pdf_combinations() { + OBJECTNAME=$1 + + # Define the combination of PDF sets depending on the types + if [[ "$OBJECTNAME" == *"-POL"* ]]; then + PDFSETNAMES="$POLARIZED_POLPDF_NAME $POLARIZED_UNPOLPDF_NAME" + elif [[ "$OBJECTNAME" == *"-UNPOL"* ]]; then + PDFSETNAMES="$POLARIZED_UNPOLPDF_NAME" + else + PDFSETNAMES="$PDF_NAME" # Fall to the NNPDF4.0 unpolarized set + fi + echo "$PDFSETNAMES" } -hadronic_predictions() { +compare_fks_with_grids() { THEORYID=$1 - for dataset in "${LIST_HADRONIC_DATASETS[@]}"; do - pineko theory -c pineko.ci.toml opcards --overwrite $THEORYID $dataset - pineko theory -c pineko.ci.toml ekos --overwrite $THEORYID $dataset - pineko theory -c pineko.ci.toml fks --overwrite $THEORYID $dataset - done - # Compare the Hadronic FK tables with the Grids grids=(theory_productions/data/grids/"$THEORYID"/*.pineappl.lz4) for gridpath in "${grids[@]}"; do gridname=$(basename "$gridpath") + PDFSETNAMES=$(get_pdf_combinations "$gridname") pineko compare ./theory_productions/data/fktables/"$THEORYID"/"$gridname" \ ./theory_productions/data/grids/"$THEORYID"/"$gridname" 3 0 \ - $PDF_NAME --threshold 2 # set threshold to 2 permille + $PDFSETNAMES --threshold 2 # set threshold to 2 permille done } -compare_predictions() { +compare_fktables() { REFERED_FK=$1 CURRENT_FK=$2 + PDFSETNAMES=$3 # Extract the predictions - the last column - diffs=($(pineappl diff $REFERED_FK $CURRENT_FK $PDF_NAME | awk 'NR>2 {print $NF}')) + diffs=($(pineappl diff $REFERED_FK $CURRENT_FK "$PDFSETNAMES" | awk 'NR>2 {print $NF}')) preds_length=${#diffs[@]} # Get the length of the predictions for ((bin=0; bin Date: Tue, 11 Mar 2025 22:24:32 +0100 Subject: [PATCH 19/19] Add Positivity data --- .github/workflows/regression.yml | 2 +- regression_check.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 7e68ad02..c90e4363 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -32,7 +32,7 @@ jobs: uses: actions/cache@v4 with: path: theory_productions - key: theory_productions-v5 + key: theory_productions-v6 - name: Download data files 📦 if: steps.cache-data_files.outputs.cache-hit != 'true' run: | diff --git a/regression_check.sh b/regression_check.sh index 06f0435e..c01ea7f0 100755 --- a/regression_check.sh +++ b/regression_check.sh @@ -11,6 +11,7 @@ POLARIZED_UNPOLPDF_NAME="NNPDF40_nlo_pch_as_01180" LIST_DIS_DATASETS=( "HERA_CC_318GEV_EP-SIGMARED" + "NNPDF_POS_2P24GEV_F2D" ) LIST_HADRONIC_DATASETS=(