From 9e26037ff52a1bdd8e60ba376cbf0736a17c45fd Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Wed, 13 Dec 2023 15:33:50 +0100 Subject: [PATCH 1/2] GHA: increased number of optimizations for ExampleSplinesSwameye2003.ipynb (#2237) and use all available cores. This example fails too frequently, e.g. https://github.com/dweindl/AMICI/actions/runs/7193472391/job/19591997110 > Exception: All multistarts failed (n_starts is probably too small)! If this error occurred during CI, just run the workflow again. --- .../example_splines_swameye/ExampleSplinesSwameye2003.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/examples/example_splines_swameye/ExampleSplinesSwameye2003.ipynb b/python/examples/example_splines_swameye/ExampleSplinesSwameye2003.ipynb index 2a3c113bc7..e8b75e49aa 100644 --- a/python/examples/example_splines_swameye/ExampleSplinesSwameye2003.ipynb +++ b/python/examples/example_splines_swameye/ExampleSplinesSwameye2003.ipynb @@ -101,11 +101,11 @@ "source": [ "# If running as a GitHub action, just do the minimal amount of work required to check whether the code is working\n", "if os.getenv(\"GITHUB_ACTIONS\") is not None:\n", - " n_starts = 15\n", + " n_starts = 25\n", " pypesto_optimizer = pypesto.optimize.FidesOptimizer(\n", " verbose=logging.WARNING, options=dict(maxiter=10)\n", " )\n", - " pypesto_engine = pypesto.engine.SingleCoreEngine()" + " pypesto_engine = pypesto.engine.MultiProcessEngine()" ] }, { From eba9557e04b755a89aec2dd5859f6e6578008832 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Wed, 13 Dec 2023 15:35:34 +0100 Subject: [PATCH 2/2] Set PEtab benchmark collection path via `$BENCHMARK_COLLECTION` (#2236) More convenient to use locally. Avoids having multiple copies of the PEtab benchmark collection lying around for different projects. --- tests/benchmark-models/test_petab_benchmark.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/benchmark-models/test_petab_benchmark.py b/tests/benchmark-models/test_petab_benchmark.py index d0a783e2c4..753c88e500 100755 --- a/tests/benchmark-models/test_petab_benchmark.py +++ b/tests/benchmark-models/test_petab_benchmark.py @@ -1,5 +1,5 @@ """Tests for simulate_petab on PEtab benchmark problems.""" - +import os from pathlib import Path import amici @@ -13,13 +13,13 @@ ATOL: float = 1e-3 RTOL: float = 1e-2 -benchmark_path = ( - Path(__file__).parent.parent.parent - / "Benchmark-Models-PEtab" - / "Benchmark-Models" -) +repo_root = Path(__file__).parent.parent.parent +benchmark_path = repo_root / "Benchmark-Models-PEtab" / "Benchmark-Models" +if not benchmark_path.exists(): + benchmark_path = Path(os.environ["BENCHMARK_COLLECTION"]) + # reuse compiled models from test_benchmark_collection.sh -benchmark_outdir = Path(__file__).parent.parent.parent / "test_bmc" +benchmark_outdir = repo_root / "test_bmc" models = [ str(petab_path.stem) for petab_path in benchmark_path.glob("*")