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 doc/rtd_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ setuptools>=67.7.2
git+https://github.com/jmuhlich/pysb@22d69a350b472f33d85ba64ffb10b190483c1c98
# For forward type definition in generate_equinox
matplotlib>=3.7.1
optax
optax==0.2.6
Copy link
Collaborator Author

@BSnelling BSnelling Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #3130 to keep track of this.

nbsphinx
nbformat
myst-parser
Expand Down
4 changes: 2 additions & 2 deletions python/sdist/amici/jax/petab.py
Original file line number Diff line number Diff line change
Expand Up @@ -1550,7 +1550,7 @@ def run_simulations(
steady_state_event: Callable[
..., diffrax._custom_types.BoolScalarLike
] = diffrax.steady_state_event(),
max_steps: int = 2**10,
max_steps: int = 2**13,
ret: ReturnValue | str = ReturnValue.llh,
):
"""
Expand Down Expand Up @@ -1653,7 +1653,7 @@ def petab_simulate(
steady_state_event: Callable[
..., diffrax._custom_types.BoolScalarLike
] = diffrax.steady_state_event(),
max_steps: int = 2**10,
max_steps: int = 2**13,
):
"""
Run simulations for a problem and return the results as a petab simulation dataframe.
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_jax.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def check_fields_jax(
"iy_trafos": jnp.array(iy_trafos),
"x_preeq": jnp.array([]),
"solver": diffrax.Kvaerno5(),
"controller": diffrax.PIDController(atol=ATOL_SIM, rtol=RTOL_SIM),
"controller": diffrax.PIDController(atol=1e-8, rtol=1e-8),
"root_finder": optimistix.Newton(atol=ATOL_SIM, rtol=RTOL_SIM),
"adjoint": diffrax.RecursiveCheckpointAdjoint(),
"steady_state_event": diffrax.steady_state_event(),
Expand Down
2 changes: 1 addition & 1 deletion scripts/installAmiciSource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ python -m pip install --upgrade pip wheel
python -m pip install --upgrade pip setuptools cmake_build_extension==0.6.0 numpy petab swig
python -m pip install git+https://github.com/pysb/pysb@master # for SPM with compartments
python -m pip install git+https://github.com/patrick-kidger/diffrax@main # for events with direction
python -m pip install optax # for jax petab notebook
python -m pip install 'optax<0.2.7' # for jax petab notebook
AMICI_BUILD_TEMP="${AMICI_PATH}/python/sdist/build/temp" \
python -m pip install --verbose -e "${AMICI_PATH}/python/sdist[petab,test,vis,jax]" --no-build-isolation
deactivate
11 changes: 7 additions & 4 deletions tests/benchmark_models/test_petab_benchmark_jax.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from amici.importers.petab.v1 import (
import_petab_problem,
)
from amici.jax.petab import run_simulations
from amici.jax.petab import run_simulations, DEFAULT_CONTROLLER_SETTINGS
from amici.sim.sundials import SensitivityMethod, SensitivityOrder
from amici.sim.sundials.petab.v1 import (
LLH,
Expand Down Expand Up @@ -113,11 +113,11 @@ def test_jax_llh(benchmark_problem):
if problem_id == "Weber_BMC2015":
atol = cur_settings.atol_sim
rtol = cur_settings.rtol_sim
max_steps = 2 * 10**5
max_steps = 4 * 10**7
else:
atol = 1e-8
rtol = 1e-8
max_steps = 1024
max_steps = 2 * 10**5
beartype(run_simulations)(jax_problem)
(llh_jax, _), sllh_jax = eqx.filter_value_and_grad(
run_simulations, has_aux=True
Expand All @@ -130,7 +130,10 @@ def test_jax_llh(benchmark_problem):
),
)
else:
llh_jax, _ = beartype(run_simulations)(jax_problem)
llh_jax, _ = beartype(run_simulations)(
jax_problem,
max_steps=2 * 10**5,
)

np.testing.assert_allclose(
llh_jax,
Expand Down
Loading