Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support valid AMICI noise distributions that are invalid in PEtab #1157

Merged
merged 7 commits into from
Nov 3, 2023
5 changes: 3 additions & 2 deletions pypesto/petab/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,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 +281,7 @@ def create_model(
logger.info(
f"Compiling amici model to folder " f"{self.output_folder}."
)
self.compile_model(**kwargs)
self.compile_model(validate=self.validate_petab, **kwargs)
Copy link
Member

@dweindl dweindl Oct 25, 2023

Choose a reason for hiding this comment

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

This fails for pysb models. Pass validate only if from petab.models import MODEL_TYPE_SBML; petab_problem.model.type_id == MODEL_TYPE_SBML. Requires petab>=0.1.27

else:
logger.debug(
f"Using existing amici model in folder "
Expand Down
Loading