diff --git a/doc/conf.py b/doc/conf.py index da3e999..0f5cb71 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -60,7 +60,10 @@ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] -autodoc_mock_imports = ["amici", "amici.amici", "amici.petab_objective"] +autodoc_mock_imports = [ + "amici", "amici.amici", "amici.petab", "amici.petab.simulations", + "amici.petab.parameter_mapping", "amici.petab.conditions" +] for mod_name in autodoc_mock_imports: sys.modules[mod_name] = mock.MagicMock() diff --git a/fiddy/extensions/amici/amici.py b/fiddy/extensions/amici/amici.py index 0cb0668..aeb2e31 100644 --- a/fiddy/extensions/amici/amici.py +++ b/fiddy/extensions/amici/amici.py @@ -3,15 +3,12 @@ from typing import Any, Callable, Dict, List, Tuple import amici -import amici.petab_objective +import amici.petab.simulations import numpy as np import petab.v1 as petab -from amici.petab_objective import ( # RDATAS, - LLH, - SLLH, - create_edatas, - create_parameter_mapping, -) +from amici.petab.parameter_mapping import create_parameter_mapping +from amici.petab.simulations import LLH, SLLH +from amici.petab.conditions import create_edatas from petab.v1.C import LIN, LOG, LOG10 from ...constants import Type @@ -331,7 +328,7 @@ def simulate_petab_to_cached_functions( parameter_ids = list(petab_problem.parameter_df.index) if simulate_petab is None: - simulate_petab = amici.petab_objective.simulate_petab + simulate_petab = amici.petab.simulations.simulate_petab edatas = None if precreate_edatas: @@ -391,6 +388,9 @@ def function(point: Type.POINT): def derivative(point: Type.POINT) -> Type.POINT: result = simulate_petab_full(point, order=amici.SensitivityOrder.first) + if result[SLLH] is None: + raise RuntimeError("Simulation failed.") + sllh = np.array( [result[SLLH][parameter_id] for parameter_id in parameter_ids] ) diff --git a/setup.cfg b/setup.cfg index e7017a6..b1d928b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -55,7 +55,8 @@ all = %(examples)s %(tests)s doc = - sphinx + sphinx<8 + docutils<0.19 sphinx_rtd_theme sphinx-autodoc-typehints mock