TofuPilotTofuPilot

Measurements

Capture and validate structured results within your phases.

Device Name
Device-Ax!=""Pass
Output Voltage
5.00V4.8<x<5.2Pass
Power Enabled
Truex==FalseFail

You can capture numeric, string, boolean, and multi-dimensional measurements with validators and aggregations.

TofuPilot will evaluate validators, record outcomes, and timestamp each measurement.

Type

Name

You can create a new measurement by adding it to the phase's measurements list.

main:
  - name: Measure Voltage
    measurements: 
      - name: Output Voltage

TofuPilot will automatically trim whitespace and enforce a 100 character limit.

Description

You can add an optional description to explain what the measurement captures.

measurements:
  - name: Output Voltage
    description: "5V power rail output voltage"

TofuPilot will enforce a 1,000 character limit on descriptions.

Key

You can define a key for referencing this measurement in your Python phases or YAML procedure.

measurements:
  - name: Output Voltage
    key: output_voltage

If not specified, TofuPilot auto-generates a key from the measurement name. You can use the key in Python phases and for binding to operator UI. Keys must be valid Python identifiers: start with a letter or underscore, followed by letters, numbers, or underscores.

Value

You can set measurement values using the measurement name as an attribute on measurements.

def measure_voltage(run, measurements, multimeter):
    voltage = multimeter.read_voltage()
    measurements.output_voltage = voltage 

TofuPilot will automatically detect the measurement type from the value.

Validators

You can validate measurements against expected ranges or patterns.

measurements:
  - name: Output Voltage
    validators: 
      - operator: ">="
        expected_value: 4.8
      - operator: "<="
        expected_value: 5.2

TofuPilot will evaluate each validator and set the measurement outcome to pass or fail. See type-specific pages for available operators.

Outcome

You can check measurement outcomes to determine if validators passed or failed.

TofuPilot will set the outcome based on validator results: PASS when all validators succeed, FAIL when any validator fails, or UNSET when no validators are defined. The outcome is automatically computed and stored with each measurement.

An UNSET outcome does not affect the final phase result.

Aggregations

You can compute statistics across numeric arrays.

measurements:
  - name: Voltage Readings
    aggregations: 
      - type: mean
        validators: 
          - operator: ">="
            expected_value: 4.9

TofuPilot will compute aggregations and validate the results. Learn more in Aggregations.

How is this guide?