Skip to main content

Calibrations

MethodDescription
list_pop_calibrationsList population calibrations.
get_pop_calibrationGet a population calibration by SID.
create_pop_calibrationCreate a population calibration from a complete JSON payload.
update_pop_calibrationReplace a population calibration's complete JSON payload.
list_calibrationsList calibrations.
iter_calibrationsIterate over calibrations.
get_calibrationGet a calibration by SID.
create_calibrationCreate a calibration from data tables, parameters, and optional references.
create_calibration_from_jsonCreate 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:

NameTypeDescriptionDefault
namestr | NoneOptional name filter.None
folderFolder | str | NoneOptional folder filter.None
limitint | NoneMaximum number of results to return.None
deletedboolWhether to include deleted calibrations.False
afterstr | NonePagination cursor.None

Returns:

iter_calibrations​

iter_calibrations(
*,
name: str | None = None,
folder: Folder | str | None = None,
deleted: bool = False
) -> Iterator[Calibration]

Iterate over calibrations.

Parameters:

NameTypeDescriptionDefault
namestr | NoneOptional name filter.None
folderFolder | str | NoneOptional folder filter.None
deletedboolWhether to include deleted calibrations.False

Yields:

get_calibration​

get_calibration(
sid: str, *, revision: int | None = None, allow_deleted: bool = False
) -> Calibration

Get a calibration by SID.

Parameters:

NameTypeDescriptionDefault
sidstrThe SID of the calibration.
revisionint | NoneOptional revision number.None
allow_deletedboolWhether to allow retrieving deleted calibrations.False

Returns:

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 DataTable object, which uses the default settings
  • a dict with a DataTable object when you need custom inclusion or weighting behavior
  • a fully explicit dict using 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_table or data_table_id: required. data_table should be a DataTable object. data_table_id should 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: optional mu of the normal prior on the quantity, or on log10(x) when log_transform is enabled.
  • std: optional sigma of the normal prior on the quantity, or on log10(x) when log_transform is 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, default False. 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", a datetime.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_tolerance and solving_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:

NameTypeDescriptionDefault
json_contentdict[str, Any] | bytes | str | NoneThe 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_pathstr | Path | NonePath to a JSON file containing the calibration payload.None
namestr | NoneOptional name for the new project item.None
folderFolder | str | NoneOptional destination folder.None
descriptionstr | NoneOptional description for the new project item.None
versionstr | dict | NoneOptional version name str. Can also be a dict with the keys name and description to set a version description.None

Returns: