AMICI-dev / AMICI

Advanced Multilanguage Interface to CVODES and IDAS
https://amici.readthedocs.io/
Other
107 stars 30 forks source link

`Benchmark Collection` workflow fails for Lang_PLOSComputBiol2024 #2444

Closed dweindl closed 1 month ago

dweindl commented 1 month ago

Benchmark Collection workflow fails with:

FAILED test_petab_benchmark.py::test_benchmark_gradient[Lang_PLOSComputBiol2024-True] - RuntimeWarning: divide by zero encountered in log
FAILED test_petab_benchmark.py::test_benchmark_gradient[Lang_PLOSComputBiol2024-False] - RuntimeWarning: divide by zero encountered in log

https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab/tree/master/Benchmark-Models/Lang_PLOSComputBiol2024

Check why we try to compute log(0) there.

dweindl commented 1 month ago

Check why we try to compute log(0) there.

Some log-scale parameters have a nominal value of 0 (parameter table discussion).

dweindl commented 1 month ago

Needs to be checked whether this is an issue in amici or petab:

/home/runner/.local/lib/python3.11/site-packages/amici/petab/simulations.py:204: in simulate_petab
    fill_in_parameters(
/home/runner/.local/lib/python3.11/site-packages/amici/petab/conditions.py:76: in fill_in_parameters
    fill_in_parameters_for_condition(
/home/runner/.local/lib/python3.11/site-packages/amici/petab/conditions.py:148: in fill_in_parameters_for_condition
    map_sim_fix = {
/home/runner/.local/lib/python3.11/site-packages/amici/petab/conditions.py:149: in <dictcomp>
    key: _get_par(key, val, map_sim_fix)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

model_par = 'initial__Cyt__CCND_sim', value = 'ic_wt_Cyt__CCND'
mapping = {'_InitialConc1': 60220000000.0, '_InitialConc10': 50629691000.0, '_InitialConc11': 4648479700.0, '_InitialConc12': 242609110000.0, ...}

    def _get_par(model_par, value, mapping):
        """Replace parameter IDs in mapping dicts by values from
        problem_parameters where necessary"""
        if isinstance(value, str):
            try:
                # estimated parameter
                return problem_parameters[value]
            except KeyError:
                # condition table overrides must have been handled already,
                # e.g. by the PEtab parameter mapping, but parameters from
                # InitialAssignments may still be present.
>               if mapping[value] == model_par:
E               KeyError: 'ic_wt_Cyt__CCND'

/home/runner/.local/lib/python3.11/site-packages/amici/petab/conditions.py:131: KeyError