Skip to main content

Advanced output set: services

AdvancedOutputSetComponentsService​

Manages the components (constraints, scalars, objectives) of an advanced output set.

Do not instantiate directly — access via AdvancedOutputSet.components::

sd = client.advanced_output_sets.get("sd-abc123")
sd.components.list()
sd.components.add_scalar("auc", formula="AUC_drug", unit="mg/L*h")

Returned by: AdvancedOutputSet.components

MemberKindDescription
listmethod
list_constraintsmethodReturn only the constraint components of this advanced output set.
list_scalarsmethodReturn only the scalar components of this advanced output set.
list_objectivesmethodReturn only the objective components of this advanced output set.
getmethodRetrieve a single component by its user-defined id.
get_by_immutable_idmethodRetrieve a single component by its platform-assigned immutable id.
get_constraintmethodRetrieve a constraint component by its user-defined id.
get_scalarmethodRetrieve a scalar component by its user-defined id.
get_objectivemethodRetrieve an objective component by its user-defined id.
add_constraintmethodAdd a new constraint component to this advanced output set.
add_scalarmethodAdd a new scalar component to this advanced output set.
add_objectivemethodAdd a new objective component to this advanced output set.

list​

list(
*,
limit: int | None = None,
tags_all: Sequence[str | "AdvancedOutputSetTag"] | None = None,
tags_any: Sequence[str | "AdvancedOutputSetTag"] | None = None
) -> List[ConstraintComponent | ScalarComponent | ObjectiveComponent]

list_constraints​

list_constraints(
*,
limit: int | None = None,
tags_all: Sequence[str | "AdvancedOutputSetTag"] | None = None,
tags_any: Sequence[str | "AdvancedOutputSetTag"] | None = None
) -> List[ConstraintComponent]

Return only the constraint components of this advanced output set.

list_scalars​

list_scalars(
*,
limit: int | None = None,
tags_all: Sequence[str | "AdvancedOutputSetTag"] | None = None,
tags_any: Sequence[str | "AdvancedOutputSetTag"] | None = None
) -> List[ScalarComponent]

Return only the scalar components of this advanced output set.

list_objectives​

list_objectives(
*,
limit: int | None = None,
tags_all: Sequence[str | "AdvancedOutputSetTag"] | None = None,
tags_any: Sequence[str | "AdvancedOutputSetTag"] | None = None
) -> List[ObjectiveComponent]

Return only the objective components of this advanced output set.

get​

get(
component_id: str,
) -> ConstraintComponent | ScalarComponent | ObjectiveComponent

Retrieve a single component by its user-defined id.

Parameters:

NameTypeDescriptionDefault
component_idstrThe id you assigned when creating the component (e.g. "adults").

Returns:

Raises:

get_by_immutable_id​

get_by_immutable_id(
immutable_id: str,
) -> ConstraintComponent | ScalarComponent | ObjectiveComponent

Retrieve a single component by its platform-assigned immutable id.

Immutable ids are stable across renames and version changes and are available via the immutable_id property on any component handle. Prefer get for everyday use; use this method when you have stored an immutable id for cross-version tracking.

Parameters:

NameTypeDescriptionDefault
immutable_idstrThe platform-assigned immutable id string.

Returns:

Raises:

get_constraint​

get_constraint(component_id: str) -> ConstraintComponent

Retrieve a constraint component by its user-defined id.

Parameters:

NameTypeDescriptionDefault
component_idstrThe id of the constraint.

Returns:

Raises:

get_scalar​

get_scalar(component_id: str) -> ScalarComponent

Retrieve a scalar component by its user-defined id.

Parameters:

NameTypeDescriptionDefault
component_idstrThe id of the scalar.

Returns:

Raises:

get_objective​

get_objective(component_id: str) -> ObjectiveComponent

Retrieve an objective component by its user-defined id.

Parameters:

NameTypeDescriptionDefault
component_idstrThe id of the objective.

Returns:

Raises:

add_constraint​

add_constraint(
component_id: str,
*,
constraint: str,
filter: str | None = None,
description: str | None = None,
display_name: str | None = None,
is_active: bool | None = None,
tags: Sequence[str | "AdvancedOutputSetTag"] | None = None,
links: Sequence[str | ProjectItem] | None = None,
version: str | dict | None = None,
show_validation: bool | None = None
) -> ConstraintComponent

Add a new constraint component to this advanced output set.

A constraint is a boolean expression that determines which patients are eligible for scoring (e.g. "age >= 18 and weight < 120").

Parameters:

NameTypeDescriptionDefault
component_idstrUnique id for the new constraint (e.g. "adults"). Must not conflict with any existing component id.
constraintstrBoolean expression string evaluated per patient.
filterstr | NoneOptional expression to restrict which simulation time points or trial arms this constraint applies to.None
descriptionstr | NoneOptional free-text description shown in the UI.None
display_namestr | NoneOptional human-readable label shown in the UI.None
is_activebool | NoneWhether this constraint is active. Defaults to True when omitted.None
versionstr | dict | NoneOptional label for the new snapshot created by this edit (e.g. "add age constraint"). Can also be a dict with the keys name and description to set a version description.None
show_validationbool | NoneWhen True, print a validation report before saving. Defaults to True in Jupyter notebooks.None

Returns:

Raises:

  • ValidationError: If the expression fails server-side validation or if component_id is already in use.

add_scalar​

add_scalar(
component_id: str,
*,
formula: str,
unit: str | None = None,
description: str | None = None,
display_name: str | None = None,
is_active: bool | None = None,
tags: Sequence[str | "AdvancedOutputSetTag"] | None = None,
links: Sequence[str | ProjectItem] | None = None,
version: str | dict | None = None,
show_validation: bool | None = None
) -> ScalarComponent

Add a new scalar component to this advanced output set.

A scalar computes a numeric value from the simulation output for each patient (e.g. "AUC_drug"). Scalars can be referenced as the target of an objective.

Parameters:

NameTypeDescriptionDefault
component_idstrUnique id for the new scalar (e.g. "auc"). Must not conflict with any existing component id.
formulastrNumeric expression string evaluated per patient.
unitstr | NoneOptional unit string for display purposes (e.g. "mg/L*h").None
descriptionstr | NoneOptional free-text description shown in the UI.None
display_namestr | NoneOptional human-readable label shown in the UI.None
is_activebool | NoneWhether this scalar is active. Defaults to True.None
versionstr | dict | NoneOptional label for the new snapshot created by this edit. Can also be a dict with the keys name and description to set a version description.None
show_validationbool | NoneWhen True, print a validation report before saving. Defaults to True in Jupyter notebooks.None

Returns:

  • ScalarComponent: class:ScalarComponent handle for the newly added scalar.

Raises:

  • ValidationError: If the formula fails server-side validation or component_id is already in use.

add_objective​

add_objective(
component_id: str,
*,
formula_target: str | None,
narrow_range_low_bound: float,
narrow_range_high_bound: float,
wide_range_low_bound: float,
wide_range_high_bound: float,
weight: float,
filter: str | None = None,
description: str | None = None,
display_name: str | None = None,
is_active: bool | None = None,
tags: Sequence[str | "AdvancedOutputSetTag"] | None = None,
links: Sequence[str | ProjectItem] | None = None,
version: str | dict | None = None,
show_validation: bool | None = None
) -> ObjectiveComponent

Add a new objective component to this advanced output set.

An objective defines a scoring rule applied to a simulated quantity. The score is determined by how well the quantity falls within the specified narrow and wide ranges around a target.

Parameters:

NameTypeDescriptionDefault
component_idstrUnique id for the new objective (e.g. "obj_auc"). Must not conflict with any existing component id.
formula_targetstr | NoneExpression string for the target value, or None to use the range bounds directly without a central target.
narrow_range_low_boundfloatLower bound of the narrow (inner) acceptance range.
narrow_range_high_boundfloatUpper bound of the narrow (inner) acceptance range.
wide_range_low_boundfloatLower bound of the wide (outer) acceptance range. Typically further from the target than the narrow bounds.
wide_range_high_boundfloatUpper bound of the wide (outer) acceptance range.
weightfloatPositive float that controls how much this objective contributes to the overall score relative to other objectives.
filterstr | NoneOptional expression to restrict which simulation time points or trial arms this objective applies to.None
descriptionstr | NoneOptional free-text description shown in the UI.None
display_namestr | NoneOptional human-readable label shown in the UI.None
is_activebool | NoneWhether this objective is active. Defaults to True.None
versionstr | dict | NoneOptional label for the new snapshot created by this edit. Can also be a dict with the keys name and description to set a version description.None
show_validationbool | NoneWhen True, print a validation report before saving. Defaults to True in Jupyter notebooks.None

Returns:

Raises:

  • ValidationError: If the formula fails server-side validation or component_id is already in use.