AttributeValueSchema

A single stored attribute value with an optional physical unit.

Usage

Source

AttributeValueSchema()

Instances of this class are what you read and write when accessing resource properties or step parameters at runtime::

well.properties.content.volume.value   # 10.0
well.properties.content.volume.unit    # "uL"
str(well.properties.content.volume)    # "10.0uL"

# Mutate the value in-place (unit is preserved)
well.properties.content.volume = 8.5

Attributes: value: The stored scalar value. Type is validated against the corresponding AttributeTemplateSchema at write time. unit: Physical unit string, or None for dimensionless attributes. Preserved across value assignments.

Methods

Name Description
__str__() Return "<value><unit>" when a unit is set, otherwise str(value).
coerce_scalar_value() Allow constructing an AttributeValueSchema from a bare scalar.

__str__()

Return "<value><unit>" when a unit is set, otherwise str(value).

Usage

Source

__str__()

coerce_scalar_value()

Allow constructing an AttributeValueSchema from a bare scalar.

Usage

Source

coerce_scalar_value(data)

When data is not a dict (e.g. AttributeValueSchema(42)), it is wrapped as {"value": data} so the scalar becomes the .value field. Dict inputs pass through unchanged.