Design Candidate Sets (🧪Beta)
albert.resources.design_candidate_sets
CandidateSetSourceType
Bases: StrEnum
What produced a candidate set.
Attributes:
| Name | Type | Description |
|---|---|---|
DESIGN_RUN |
|
|
MODEL_PREDICTION |
|
|
IMPORT |
|
|
MANUAL |
|
CandidateSetSource
Bases: BaseAlbertModel
A reference to what produced a candidate set.
Show JSON schema:
{
"$defs": {
"CandidateSetSourceType": {
"description": "What produced a candidate set.",
"enum": [
"design_run",
"model_prediction",
"import",
"manual"
],
"title": "CandidateSetSourceType",
"type": "string"
}
},
"description": "A reference to what produced a candidate set.",
"properties": {
"sourceType": {
"$ref": "#/$defs/CandidateSetSourceType",
"description": "The kind of producer."
},
"sourceId": {
"description": "The ID of the producer, such as a design run (format ``DSR...``).",
"title": "Sourceid",
"type": "string"
}
},
"required": [
"sourceType",
"sourceId"
],
"title": "CandidateSetSource",
"type": "object"
}
Fields:
DesignCandidateSet
Bases: BaseResource
The candidates a design run produced. A set is read-only.
List its candidates with
get_all.
Show JSON schema:
{
"$defs": {
"AuditFields": {
"description": "The audit fields for a resource",
"properties": {
"by": {
"default": null,
"title": "By",
"type": "string"
},
"byName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Byname"
},
"at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "At"
}
},
"title": "AuditFields",
"type": "object"
},
"CandidateSetSource": {
"description": "A reference to what produced a candidate set.",
"properties": {
"sourceType": {
"$ref": "#/$defs/CandidateSetSourceType",
"description": "The kind of producer."
},
"sourceId": {
"description": "The ID of the producer, such as a design run (format ``DSR...``).",
"title": "Sourceid",
"type": "string"
}
},
"required": [
"sourceType",
"sourceId"
],
"title": "CandidateSetSource",
"type": "object"
},
"CandidateSetSourceType": {
"description": "What produced a candidate set.",
"enum": [
"design_run",
"model_prediction",
"import",
"manual"
],
"title": "CandidateSetSourceType",
"type": "string"
},
"ComparisonOperator": {
"description": "How a measured value is compared against a target value.\n\nAttributes\n----------\nEQ : str\n Equal to the target value.\nGT : str\n Strictly greater than the target value.\nGTE : str\n Greater than or equal to the target value.\nLT : str\n Strictly less than the target value.\nLTE : str\n Less than or equal to the target value.\nBETWEEN : str\n Within an inclusive range; pairs with a [`NumericRange`][albert.resources.targets.NumericRange] value.\nIN_SET : str\n Among a set of allowed values; pairs with a list value.",
"enum": [
"eq",
"gt",
"gte",
"lt",
"lte",
"between",
"in-set"
],
"title": "ComparisonOperator",
"type": "string"
},
"DesignObjective": {
"description": "A per-run optimization goal: a success criterion plus how much it matters.\n\nA [`Criterion`][albert.resources.targets.Criterion] states what good looks like.\n``weight`` states how much that goal counts relative to the other objectives on the\nsame run, and belongs to the run rather than to the Target. A Target carries no\npriority of its own, so the same targets can be reweighted from one run to the next\nto see how the trade-off moves the candidates.\n\nA plain ``Criterion`` is accepted anywhere a ``DesignObjective`` is expected and\ntakes the default weight.\n\n!!! example\n ```python\n from albert.resources.design import DesignObjective\n\n # a hard specification that should not be traded away\n DesignObjective(operator=\"gte\", value=95, weight=3.0)\n\n # the same goal at the default weight\n DesignObjective(operator=\"gte\", value=95)\n ```",
"properties": {
"operator": {
"$ref": "#/$defs/ComparisonOperator",
"description": "How the measured value is compared against ``value``."
},
"value": {
"anyOf": [
{
"$ref": "#/$defs/NumericRange"
},
{
"type": "string"
},
{
"type": "number"
},
{
"items": {},
"type": "array"
}
],
"description": "The value being compared against. Use a [`NumericRange`][albert.resources.targets.NumericRange] with the ``between`` operator, a list with the ``in-set`` operator, or a single number/string for the scalar operators.",
"title": "Value"
},
"weight": {
"default": 1.0,
"description": "How much this objective counts relative to the others on the same run.\n\nCandidate scores are combined as a product of each objective's score raised to its\nweight, so a weight above ``1.0`` makes the objective harder to trade away and a\nweight below ``1.0`` makes it easier. Must be positive; to ignore an objective,\nleave it out.\n\nAlways a float, never ``None``: an unweighted objective is ``1.0``, which weighs it\nequally against the others. Omitting the field, or passing an explicit ``None``,\nboth give ``1.0``.",
"exclusiveMinimum": 0,
"title": "Weight",
"type": "number"
}
},
"required": [
"operator",
"value"
],
"title": "DesignObjective",
"type": "object"
},
"NumericRange": {
"description": "An inclusive numeric range, used with the ``between`` operator.",
"properties": {
"min": {
"description": "The lower bound of the range.",
"title": "Min",
"type": "number"
},
"max": {
"description": "The upper bound of the range.",
"title": "Max",
"type": "number"
}
},
"required": [
"min",
"max"
],
"title": "NumericRange",
"type": "object"
},
"Status": {
"description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n The resource is fully operational and visible in normal operations.\nINACTIVE : str\n The resource is hidden from normal operations and disabled from use.",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
}
},
"description": "The candidates a design run produced. A set is read-only.\n\nList its candidates with\n[`get_all`][albert.collections.design_candidates.DesignCandidateCollection.get_all].",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null,
"description": "The status of the resource, optional."
},
"created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the creation of the set."
},
"updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the last update of the set."
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unique identifier of the set (format ``DCS...``).",
"title": "Id"
},
"schemaVersion": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "The version of the set record layout.",
"title": "Schemaversion"
},
"parentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The project (format ``PRO...``) that controls access to the set.",
"title": "Parentid"
},
"source": {
"anyOf": [
{
"$ref": "#/$defs/CandidateSetSource"
},
{
"type": "null"
}
],
"default": null,
"description": "What produced the set."
},
"smartDatasetId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The smart dataset (format ``SDT...``) the candidates were generated against.",
"title": "Smartdatasetid"
},
"designSpaceId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The design space (format ``DSP...``) used. ``None`` for the dataset-derived default.",
"title": "Designspaceid"
},
"designModelConfigId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The design model config (format ``DMC...``) used. ``None`` for the dataset-derived default.",
"title": "Designmodelconfigid"
},
"objectives": {
"anyOf": [
{
"additionalProperties": {
"$ref": "#/$defs/DesignObjective"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "The objectives the candidates were optimized for, keyed by target ID.",
"title": "Objectives"
},
"version": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Version counter of the record.",
"title": "Version"
}
},
"title": "DesignCandidateSet",
"type": "object"
}
Fields:
-
status(Status | None) -
id(DesignCandidateSetId | None) -
schema_version(int | None) -
parent_id(ProjectId | None) -
source(CandidateSetSource | None) -
smart_dataset_id(SmartDatasetId | None) -
design_space_id(DesignSpaceId | None) -
design_model_config_id(DesignModelConfigId | None) -
objectives(dict[TargetId, DesignObjective] | None) -
version(int | None) -
created(AuditFields | None) -
updated(AuditFields | None)
parent_id
parent_id: ProjectId | None = None
The project (format PRO...) that controls access to the set.
smart_dataset_id
smart_dataset_id: SmartDatasetId | None = None
The smart dataset (format SDT...) the candidates were generated against.
design_space_id
design_space_id: DesignSpaceId | None = None
The design space (format DSP...) used. None for the dataset-derived default.
design_model_config_id
design_model_config_id: DesignModelConfigId | None = None
The design model config (format DMC...) used. None for the dataset-derived default.
objectives
objectives: dict[TargetId, DesignObjective] | None = None
The objectives the candidates were optimized for, keyed by target ID.