Skip to content

Parameters

albert.resources.parameters

SpecialParameterType

Bases: str, Enum

The specific entity type referenced by a Special Parameter.

Not returned by the platform parameter API (use Zeus reports RET48/RET52 to read the subtype from experiment data). Writable on ParameterValue and TargetParameter.

Each member implies an id-namespace for the value column in experiment reports (RET48/RET52): RAW_MATERIALS values carry INVA... ids, CONSUMABLES carry INVB... ids, EQUIPMENT carry INVC... ids, and FORMULAS carry INVMO... ids.

Mirrors InventoryCategory, the canonical "kind of material" an InventoryItem belongs to. A Special parameter's value is always a reference to an InventoryItem, so its subtype is one of that enum's members.

Attributes:

Name Type Description
RAW_MATERIALS str

A raw material entity. Values appear as INVA... ids in report columns.

CONSUMABLES str

A consumable entity. Values appear as INVB... ids in report columns.

EQUIPMENT str

An equipment entity. Values appear as INVC... ids in report columns.

FORMULAS str

A formula entity (a mixture designed through a Worksheet). Values appear as INVMO... ids in report columns.

RAW_MATERIALS

RAW_MATERIALS = 'RawMaterials'

CONSUMABLES

CONSUMABLES = 'Consumables'

EQUIPMENT

EQUIPMENT = 'Equipment'

FORMULAS

FORMULAS = 'Formulas'

ParameterCategory

Bases: str, Enum

Whether a Parameter's value is a plain scalar or an entity reference.

Set by the platform and read-only. It determines how a parameter's value is interpreted when a setpoint is assigned to it inside a Workflow.

Attributes:

Name Type Description
NORMAL str

A "normal" parameter whose value is a plain scalar (e.g. a number or text), such as Temperature or Spin Speed.

SPECIAL str

A "special" parameter whose value references another entity (e.g. Equipment, a Consumable, or a Template). The setpoint value is that entity's ID rather than a plain scalar.

NORMAL

NORMAL = 'Normal'

SPECIAL

SPECIAL = 'Special'

Parameter

Bases: BaseResource

The definition of a single experimental condition or input variable.

A Parameter (ID format PRM...) names an "indirect variable" such as Temperature, Spin Speed, or Instrument. The Parameter itself only defines the variable; its actual value and unit are fixed to a setpoint later, inside a Workflow. Parameters are the building blocks of Parameter Groups (ParameterGroup) and form the parameter side of Data Templates (DataTemplate).

Manage parameters through ParameterCollection (client.parameters).

Example

from albert import Albert
from albert.resources.parameters import Parameter
client = Albert()
param = client.parameters.create(parameter=Parameter(name="Temperature"))
param.id
# 'PRM9999999'
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"
    },
    "EntityLink": {
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Category"
        }
      },
      "required": [
        "id"
      ],
      "title": "EntityLink",
      "type": "object"
    },
    "EntityLinkWithName": {
      "description": "EntityLink that includes the name field in serialization.",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Category"
        }
      },
      "required": [
        "id"
      ],
      "title": "EntityLinkWithName",
      "type": "object"
    },
    "ParameterCategory": {
      "description": "Whether a [`Parameter`][albert.resources.parameters.Parameter]'s value is a plain scalar or an entity reference.\n\nSet by the platform and read-only. It determines how a parameter's value is\ninterpreted when a setpoint is assigned to it inside a\n[`Workflow`][albert.resources.workflows.Workflow].\n\nAttributes\n----------\nNORMAL : str\n    A \"normal\" parameter whose value is a plain scalar (e.g. a number or text),\n    such as Temperature or Spin Speed.\nSPECIAL : str\n    A \"special\" parameter whose value references another entity (e.g. Equipment,\n    a Consumable, or a Template). The setpoint value is that entity's ID rather\n    than a plain scalar.",
      "enum": [
        "Normal",
        "Special"
      ],
      "title": "ParameterCategory",
      "type": "string"
    },
    "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 definition of a single experimental condition or input variable.\n\nA Parameter (ID format ``PRM...``) names an \"indirect variable\" such as\nTemperature, Spin Speed, or Instrument. The Parameter itself only defines the\nvariable; its actual value and unit are fixed to a setpoint later, inside a\n[`Workflow`][albert.resources.workflows.Workflow]. Parameters are the building\nblocks of Parameter Groups\n([`ParameterGroup`][albert.resources.parameter_groups.ParameterGroup]) and form the\nparameter side of Data Templates\n([`DataTemplate`][albert.resources.data_templates.DataTemplate]).\n\nManage parameters through\n[`ParameterCollection`][albert.collections.parameters.ParameterCollection]\n(``client.parameters``).\n\n!!! example\n    ```python\n    from albert import Albert\n    from albert.resources.parameters import Parameter\n    client = Albert()\n    param = client.parameters.create(parameter=Parameter(name=\"Temperature\"))\n    param.id\n    # 'PRM9999999'\n    ```",
  "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 resource, optional."
    },
    "Updated": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Audit fields for the update of the resource, optional."
    },
    "name": {
      "description": "The name of the parameter. Names must be unique.",
      "title": "Name",
      "type": "string"
    },
    "albertId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The Albert ID of the parameter (format ``PRM...``). Set when the parameter is retrieved from or created in Albert.",
      "title": "Albertid"
    },
    "Metadata": {
      "anyOf": [
        {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "integer"
              },
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/EntityLinkWithName"
              },
              {
                "$ref": "#/$defs/EntityLink"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/EntityLinkWithName"
                    },
                    {
                      "$ref": "#/$defs/EntityLink"
                    }
                  ]
                },
                "type": "array"
              }
            ]
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional user-defined metadata keyed by field name.",
      "title": "Metadata"
    },
    "category": {
      "anyOf": [
        {
          "$ref": "#/$defs/ParameterCategory"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether the parameter is ``Normal`` (scalar value) or ``Special`` (entity reference). Set by the platform and read-only."
    },
    "rank": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The rank of the returned parameter. Read-only.",
      "title": "Rank"
    },
    "required": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether this parameter must be filled in within a Parameter Group.",
      "title": "Required"
    }
  },
  "required": [
    "name"
  ],
  "title": "Parameter",
  "type": "object"
}

Fields:

name

name: str

The name of the parameter. Names must be unique.

id

id: str | None = None

The Albert ID of the parameter (format PRM...). Set when the parameter is retrieved from or created in Albert.

metadata

metadata: dict[str, MetadataItem] | None = None

Optional user-defined metadata keyed by field name.

category

category: ParameterCategory | None = None

Whether the parameter is Normal (scalar value) or Special (entity reference). Set by the platform and read-only.

rank

rank: int | None = None

The rank of the returned parameter. Read-only.

required

required: bool | None = None

Whether this parameter must be filled in within a Parameter Group.