Skip to content

Commit

Permalink
Support valid AMICI noise distributions that are invalid in PEtab (#1157
Browse files Browse the repository at this point in the history
)

Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com>
  • Loading branch information
dilpath and dweindl authored Nov 3, 2023
1 parent 59004de commit ddf7798
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pypesto/petab/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import amici.petab_objective
import petab
from petab.C import PREEQUILIBRATION_CONDITION_ID, SIMULATION_CONDITION_ID
from petab.models import MODEL_TYPE_SBML
except ImportError:
pass

Expand Down Expand Up @@ -128,7 +129,8 @@ def __init__(

self.validate_inner_options()

if validate_petab:
self.validate_petab = validate_petab
if self.validate_petab:
if petab.lint_problem(petab_problem):
raise ValueError("Invalid PEtab problem.")
if self._hierarchical and validate_petab_hierarchical:
Expand Down Expand Up @@ -280,7 +282,13 @@ def create_model(
logger.info(
f"Compiling amici model to folder " f"{self.output_folder}."
)
self.compile_model(**kwargs)
if self.petab_problem.model.type_id == MODEL_TYPE_SBML:
self.compile_model(
validate=self.validate_petab,
**kwargs,
)
else:
self.compile_model(**kwargs)
else:
logger.debug(
f"Using existing amici model in folder "
Expand Down

0 comments on commit ddf7798

Please sign in to comment.