Trials
| Method | Description |
|---|---|
list_trials | List trials. |
iter_trials | Iterate over trials. |
get_trial | Get a trial by SID. |
create_trial | Create a trial from a model and optional related project items. |
create_trial_from_json | Create a trial from a raw JSON payload. |
list_trials
list_trials(
*,
name: str | None = None,
folder: Folder | str | None = None,
limit: int | None = None,
deleted: bool = False,
after: str | None = None
) -> Page[Trial]
List trials.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name | str | None | Optional name filter. | None |
folder | Folder | str | None | Optional folder filter. | None |
limit | int | None | Maximum number of results to return. | None |
deleted | bool | Whether to include deleted trials. | False |
after | str | None | Pagination cursor. | None |
Returns:
Page[Trial]: A page of Trial objects.
iter_trials
iter_trials(
*,
name: str | None = None,
folder: Folder | str | None = None,
deleted: bool = False
) -> Iterator[Trial]
Iterate over trials.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name | str | None | Optional name filter. | None |
folder | Folder | str | None | Optional folder filter. | None |
deleted | bool | Whether to include deleted trials. | False |
Yields:
Trial: Trial objects.
get_trial
get_trial(
sid: str, *, revision: int | None = None, allow_deleted: bool = False
) -> Trial
Get a trial by SID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sid | str | The SID of the trial. | |
revision | int | None | Optional revision number. | None |
allow_deleted | bool | Whether to allow retrieving deleted trials. | False |
Returns:
Trial: The requested Trial.
create_trial
create_trial(
model: Model,
*,
data_tables: Sequence[DataTable | dict[str, Any]] | None = None,
vpop: Vpop | None = None,
protocol: ProtocolDesign | None = None,
simple_output_set: SimpleOutputSet | None = None,
advanced_output_set: AdvancedOutputSet | None = None,
folder: Folder | str | None = None,
name: str | None = None,
description: str | None = None,
version: str | dict | None = None,
solving_allow_varying_stoichiometry: bool | None = None,
solving_discontinuity_events: Any = None,
solving_evaluator: Any = None,
solving_extent_units: str | None = None,
solving_inline_limit: int | None = None,
solving_max_events: int | None = None,
solving_mute_phenomena: Any = None,
solving_mute_variables: Any = None,
solving_ode_solver_absolute_tolerance: float | None = None,
solving_ode_solver_initial_step: float | None = None,
solving_ode_solver_maximum_step: float | None = None,
solving_ode_solver_relative_tolerance: float | None = None,
solving_output_compartments: Any = None,
solving_output_parameters: Any = None,
solving_output_rates: Any = None,
solving_output_variables: Any = None,
solving_scoring_mode: Any = None,
solving_solver: Any = None,
solving_solving_times: list[Any] | None = None,
solving_unit_check: Any = None
) -> Trial
Create a trial from a model and optional related project items.
Can also be accessed through Model.create_trial() for convenience.
data_tables is optional. Each entry represents one experimental data
table to attach to the trial. You can pass either:
- a
DataTableobject, which uses the default settings - a
dictwith aDataTableobject when you need custom inclusion or weighting behavior - a fully explicit
dictusing id fields instead of objects
A plain DataTable object is converted from the Python-side shorthand
equivalent of:
{"data_table": <that table>, "include": True, "options": {"weight": 1.0}}.
A custom dict entry should contain:
- either
data_tableordata_table_id: required.data_tableshould be aDataTableobject.data_table_idshould be an explicit id mapping{"core_item_id": ..., "snapshot_id": ...}. include: required boolean. Whether this table is included in the trial's generated data-table design.options: required dict of generator options.
Supported options keys are:
weight: numeric weight for this table when combined with others.label: custom label for the generated fitness contribution.time_tolerance: parameter that lets calibrated time series match the source data within a time window around the data-table time points.log_transform_wide_bounds: list of observable ids for which wide bounds are derived from the narrow bounds, using 50% of the left narrow bound and 200% of the right narrow bound unless explicit wide bounds are already defined in the data table.
Solving options are exposed as flattened solving_* keyword arguments
only when you need to supply a complete option set. Omit every
solving_* argument to inherit the model's solving options. Supplying
only some values raises ValueError; the exact required set depends on
the selected solver and model configuration.
Commonly useful solving arguments include:
solving_solver: numerical solver choice.solving_solving_times: output sampling definition; each entry may be an ISO 8601 duration string such as"P42D"or"PT10H5M", adatetime.timedelta, or a regularly spaced time-span mapping using either representation for its duration fields.solving_unit_check: unit-checking mode.solving_extent_units: unit to which species are converted.solving_ode_solver_absolute_toleranceandsolving_ode_solver_relative_tolerance: numerical tolerances.
Example:
from datetime import timedelta
client.create_trial(
model,
solving_solver="BDF",
solving_solving_times=[
"P42D",
timedelta(hours=10, minutes=5),
{
"tMin": timedelta(0),
"tMax": "P7D",
"tStep": timedelta(hours=12),
},
],
)
create_trial_from_json
create_trial_from_json(
*,
json_content: dict[str, Any] | bytes | str | None = None,
json_file_path: str | Path | None = None,
name: str | None = None,
folder: Folder | str | None = None,
description: str | None = None,
version: str | dict | None = None
) -> Trial
Create a trial from a raw JSON payload.
Exactly one of json_content or json_file_path must be provided.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json_content | dict[str, Any] | bytes | str | None | The trial payload as a dict, JSON bytes, or JSON string. When the dict payload contains solvingOptions.solvingTimes, duration entries may be ISO 8601 strings such as "P42D" or "PT10H5M" or datetime.timedelta objects; timedeltas are normalized before upload. | None |
json_file_path | str | Path | None | Path to a JSON file containing the trial payload. | None |
name | str | None | Optional name for the new project item. | None |
folder | Folder | str | None | Optional destination folder. | None |
description | str | None | Optional description for the new project item. | None |
version | str | dict | None | Optional version name str. Can also be a dict with the keys name and description to set a version description. | None |
Returns:
Trial: The created Trial.