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

Py: Add failfast argument to simulate_petab #1528

Merged
merged 1 commit into from
Jul 9, 2021
Merged
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
9 changes: 7 additions & 2 deletions python/amici/petab_objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def simulate_petab(
scaled_parameters: Optional[bool] = False,
log_level: int = logging.WARNING,
num_threads: int = 1,
failfast: bool = True,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
failfast: bool = True,
fail_fast: bool = True,

) -> Dict[str, Any]:
"""Simulate PEtab model.

Expand Down Expand Up @@ -82,6 +83,9 @@ def simulate_petab(
:param num_threads:
Number of threads to use for simulating multiple conditions
(only used if compiled with OpenMP).
:param failfast:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
:param failfast:
:param fail_fast:

Returns as soon as an integration failure is encountered, skipping
any remaining simulations.

:return:
Dictionary of
Expand Down Expand Up @@ -140,8 +144,9 @@ def simulate_petab(
amici_model=amici_model)

# Simulate
rdatas = amici.runAmiciSimulations(amici_model, solver, edata_list=edatas,
num_threads=num_threads)
rdatas = amici.runAmiciSimulations(
amici_model, solver, edata_list=edatas,
num_threads=num_threads, failfast=failfast)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
num_threads=num_threads, failfast=failfast)
num_threads=num_threads, fail_fast=fail_fast)


# Compute total llh
llh = sum(rdata['llh'] for rdata in rdatas)
Expand Down