Calibrations
| Method | Description |
|---|---|
list_pop_calibrations | List population calibrations. |
get_pop_calibration | Get a population calibration by SID. |
create_pop_calibration | Create a population calibration from a complete JSON payload. |
update_pop_calibration | Replace a population calibration's complete JSON payload. |
list_calibrations | List calibrations. |
iter_calibrations | Iterate over calibrations. |
get_calibration | Get a calibration by SID. |
create_calibration | Create a calibration from data tables, parameters, and optional references. |
create_calibration_from_json | Create a calibration from a raw JSON payload. |
list_pop_calibrations
list_pop_calibrations(
*,
name: str | None = None,
folder: Folder | str | None = None,
limit: int | None = None,
deleted: bool = False,
after: str | None = None
) -> Page[PopCalibration]
List population calibrations.
get_pop_calibration
get_pop_calibration(
sid: str, *, revision: int | None = None, allow_deleted: bool = False
) -> PopCalibration
Get a population calibration by SID.
create_pop_calibration
create_pop_calibration(
data: dict[str, Any],
*,
name: str | None = None,
folder: Folder | str | None = None,
description: str | None = None,
version: str | dict | None = None
) -> PopCalibration
Create a population calibration from a complete JSON payload.
update_pop_calibration
update_pop_calibration(
sid: str, data: dict[str, Any], *, version: str | dict | None = None
) -> PopCalibration
Replace a population calibration's complete JSON payload.
list_calibrations
list_calibrations(
*,
name: str | None = None,
folder: Folder | str | None = None,
limit: int | None = None,
deleted: bool = False,
after: str | None = None
) -> Page[Calibration]
List calibrations.
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 calibrations. | False |
after | str | None | Pagination cursor. | None |
Returns:
Page[Calibration]: A page of Calibration objects.
iter_calibrations
iter_calibrations(
*,
name: str | None = None,
folder: Folder | str | None = None,
deleted: bool = False
) -> Iterator[Calibration]
Iterate over calibrations.
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 calibrations. | False |
Yields:
Calibration: Calibration objects.
get_calibration
get_calibration(
sid: str, *, revision: int | None = None, allow_deleted: bool = False
) -> Calibration
Get a calibration by SID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sid | str | The SID of the calibration. | |
revision | int | None | Optional revision number. | None |
allow_deleted | bool | Whether to allow retrieving deleted calibrations. | False |
Returns:
Calibration: The requested Calibration.
create_calibration
create_calibration(
*,
data_tables: Sequence[DataTable | dict[str, Any]] = (),
parameters: Sequence[dict[str, Any]] = (),
model: Model | None = None,
simple_output_set: SimpleOutputSet | None = None,
protocol: ProtocolDesign | 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,
calib_number_of_iterations: int | None = None,
calib_population_size: int | None = None,
calib_seed: int | None = None,
calib_stagnation_absolute_tolerance: float | None = None,
calib_stagnation_burn_in_period: int | None = None,
calib_stagnation_iteration_window_size: int | None = None,
calib_stagnation_relative_tolerance: float | None = None,
calib_threshold_weighted_score: float | 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
) -> Calibration
Create a calibration from data tables, parameters, and optional references.
data_tables describes the experimental data used by the calibration.
Each entry represents one attached data table. 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 contributes to the calibration objective construction.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.
These Pythonic keys are translated by the SDK to the API field names.
parameters defines what model quantities the calibration may vary.
Each entry is a dict with:
id: required. Parameter, species, or compartment id to calibrate.mean: optionalmuof the normal prior on the quantity, or onlog10(x)whenlog_transformis enabled.std: optionalsigmaof the normal prior on the quantity, or onlog10(x)whenlog_transformis enabled.min_bound: optional minimum bound enforced through a penalty term.max_bound: optional maximum bound enforced through a penalty term.log_transform: optional boolean, defaultFalse. When true, the prior applies in log10 space.
These Pythonic parameter keys are also translated by the SDK.
Calibration options are exposed as flattened calib_* keyword
arguments so you do not need to build a nested options object yourself.
Commonly useful calibration arguments include:
calib_seed: random seed.calib_threshold_weighted_score: stop as soon as a patient exceeds this weighted score threshold.calib_number_of_iterations: maximum number of iterations.calib_population_size: virtual population size used per iteration.
Solving options are also 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 ones 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.
When a model is provided and solving_solving_times is omitted,
the calibration defaults to that model's solving times.
Example:
from datetime import timedelta
client.create_calibration(
data_tables=[data_table],
parameters=[{"id": "ka"}],
solving_solver="BDF",
solving_solving_times=[
"P42D",
timedelta(hours=10, minutes=5),
{
"tMin": timedelta(0),
"tMax": "P7D",
"tStep": timedelta(hours=12),
},
],
)
create_calibration_from_json
create_calibration_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
) -> Calibration
Create a calibration 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 calibration 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 calibration 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:
Calibration: The created Calibration.