diff --git a/.github/actions/prepare_environment/action.yml b/.github/actions/prepare_environment/action.yml index 1d0b91dcad..8e1767f6c9 100644 --- a/.github/actions/prepare_environment/action.yml +++ b/.github/actions/prepare_environment/action.yml @@ -14,6 +14,10 @@ name: Prepare a conda environment for NNPDF installation # Remember that these actions are only available after checking out the repository, # which should always be the first step! # - uses: actions/checkout@v4 +# +# This action also removes part of the cache of the runner to avoid using too much storage +# (see at the bottom) +# It would probably be clever to start using a different runner though TODO inputs: python-version: @@ -38,4 +42,5 @@ runs: run: | sudo rm -rf /opt/hostedtoolcache/Python/3.9* sudo rm -rf /opt/hostedtoolcache/CodeQL + sudo rm -rf /usr/local/lib/android/sdk echo "$NETRC_FILE" | base64 --decode > ~/.netrc diff --git a/.github/workflows/all_tests_nnpdf.yml b/.github/workflows/all_tests_nnpdf.yml index 565e635f56..2ba5b4f0fd 100644 --- a/.github/workflows/all_tests_nnpdf.yml +++ b/.github/workflows/all_tests_nnpdf.yml @@ -102,6 +102,7 @@ jobs: run: | sudo rm -rf /opt/hostedtoolcache/Python/{3.9*} sudo rm -rf /opt/hostedtoolcache/CodeQL + sudo rm -rf /usr/local/lib/android/sdk pip install .[nolha,torch] # Since there is no LHAPDF in the system, initialize the folder and download pdfsets.index lhapdf-management update --init diff --git a/n3fit/src/evolven3fit/eko_utils.py b/n3fit/src/evolven3fit/eko_utils.py index 72ec246241..b9a3ff2ac4 100644 --- a/n3fit/src/evolven3fit/eko_utils.py +++ b/n3fit/src/evolven3fit/eko_utils.py @@ -106,7 +106,6 @@ def construct_eko_cards( def construct_eko_photon_cards( nnpdf_theory, - q_fin, x_grid, q_gamma, op_card_dict: Optional[Dict[str, Any]] = None, @@ -114,8 +113,8 @@ def construct_eko_photon_cards( ): """ Return the theory and operator cards used to construct the eko_photon. - nnpdf_theory is a NNPDF theory card for which we are computing the operator card and eko - q_fin is the final point of the q grid while q_points is the number of points of the grid. + nnpdf_theory is a NNPDF theory card for which we are computing the operator card and eko. + The q grid ends at Q0. x_grid is the x grid to be used. op_card_dict and theory_card_dict are optional updates that can be provided respectively to the operator card and to the theory card. diff --git a/n3fit/src/n3fit/scripts/evolven3fit.py b/n3fit/src/n3fit/scripts/evolven3fit.py index fe095a1ac6..7c6be6447c 100644 --- a/n3fit/src/n3fit/scripts/evolven3fit.py +++ b/n3fit/src/n3fit/scripts/evolven3fit.py @@ -45,8 +45,7 @@ def construct_eko_parser(subparsers): "produce_eko", help=( """Produce the eko for the specified theory. - The q_grid starts at the Q0 given by the theory but the last point is q_fin - and its number of points can be specified by q_points. + The q_grid starts at 1.0 and ends at 1e5. The x_grid starts at x_grid_ini and ends at 1.0 and contains the provided number of points. The eko will be dumped in the provided path.""" ), @@ -80,7 +79,7 @@ def construct_eko_photon_parser(subparsers): def construct_evolven3fit_parser(subparsers): parser = subparsers.add_parser( "evolve", - help="Evolves the fitted PDFs. The q_grid starts at the Q0 given by the theory but the last point is q_fin and its number of points can be specified by q_points. If a path is given for the dump option, the eko will be dumped in that path after the computation. If a path is given for the load option, the eko to be used for the evolution will be loaded from that path. The two options are mutually exclusive.", + help="Evolves the fitted PDFs. The q_grid starts at 1.0 and ends at 1e5. If a path is given for the dump option, the eko will be dumped in that path after the computation. If a path is given for the load option, the eko to be used for the evolution will be loaded from that path. The two options are mutually exclusive.", ) parser.add_argument( "fit_folder", help="Path to the folder containing the (pre-DGLAP) fit result" @@ -108,12 +107,6 @@ def construct_evolven3fit_parser(subparsers): def main(): parser = ArgumentParser(description="evolven3fit - a script with tools to evolve PDF fits") - parser.add_argument( - "-q", "--q-fin", type=float, default=None, help="Final q-value of the evolution" - ) - parser.add_argument( - "-p", "--q-points", type=int, default=None, help="Number of q points for the evolution" - ) parser.add_argument("--no-net", action="store_true", help="Emulates validphys' --no-net") subparsers = parser.add_subparsers(title="actions", dest="actions") @@ -185,8 +178,6 @@ def main(): if args.actions == "produce_eko": tcard, opcard = eko_utils.construct_eko_cards( nnpdf_theory, - args.q_fin, - args.q_points, x_grid, op_card_info, theory_card_info, @@ -194,7 +185,7 @@ def main(): ) elif args.actions == "produce_eko_photon": tcard, opcard = eko_utils.construct_eko_photon_cards( - nnpdf_theory, args.q_fin, x_grid, args.q_gamma, op_card_info, theory_card_info + nnpdf_theory, x_grid, args.q_gamma, op_card_info, theory_card_info ) solve(tcard, opcard, args.dump) diff --git a/n3fit/src/n3fit/tests/test_evolven3fit.py b/n3fit/src/n3fit/tests/test_evolven3fit.py index dde05154ef..90176912e0 100644 --- a/n3fit/src/n3fit/tests/test_evolven3fit.py +++ b/n3fit/src/n3fit/tests/test_evolven3fit.py @@ -155,6 +155,10 @@ def test_eko_utils(tmp_path, nnpdf_theory_card): np.testing.assert_allclose(eko_op.operator_card.raw["xgrid"], x_grid) np.testing.assert_allclose(list(eko_op.operator_card.raw["mugrid"]), op_card_dict["mugrid"]) + # Testing if you can produce an eko with the CLI, then kill the job after 60 seconds + with pytest.raises(sp.TimeoutExpired): + sp.run(f"evolven3fit produce_eko 40000000 test.tar".split(), cwd=tmp_path, timeout=60) + # Keep old theory 399 and 398 EKOs here to avoid having to download many GB of data # the only _actual_ eko test is given by the fit-bot