Common Types

Common shared types used throughout the T-code API, including the ValueWithUnits class for representing physical quantities, documentation annotation types, and enumerations.

Documentation

Common TCode API types: units, documentation annotations, and enumerations.

class tcode_api.schemas.common.GraspType(*values)

Options for how a gripper should grasp a piece of labware.

UNSPECIFIED = 'UNSPECIFIED'

Gripper uses LIFT.

LIFT = 'LIFT'

Gripper lifts labware from the bottom. Only use in LabwareHolders that can support this behavior (e.g. DeckSlots).

PINCH = 'PINCH'

Gripper pinches labware from the sides. Only use this when your source or destination requires it, less stable!

class tcode_api.schemas.common.GripperStateType(*values)

Gripper fingers state.

OPEN = 1

The gripper is fully open.

CLOSE = 2

The gripper is fully closed.

WIDTH = 3

Gripper is set to a specific distance between the fingers.

class tcode_api.schemas.common.PathType(*values)

Options for how the robot should move to a target location.

DIRECT = 1

Robot moves to the target location directly in jointspace.

SAFE = 2

Robot moves to the target location via a safe path.

SHORTCUT = 3

Robot uses DIRECT if it is close to the target, otherwise SAFE.

class tcode_api.schemas.common.TrajectoryType(*values)

Options for profiles to use for a robot’s joint(s) when moving to a target location.

JOINT_SQUARE = 1

Robot moves in jointspace with square motor profiles.

JOINT_TRAPEZOIDAL = 2

Robot moves in joint space with trapezoidal motor profiles.

JOINT_LINEAR = 3

Robot moves in cartesian space with non-uniform motor profiles.

class tcode_api.schemas.common.ValueWithUnits(**data)

A numeric value with associated units.

Note:

The following values are all equivalent:

ValueWithUnits(magnitude=0.005, units="L")

ValueWithUnits(magnitude=5, units="mL")

ValueWithUnits(magnitude=5000, units="uL")

ValueWithUnits(magnitude=5000, units="mm³")

Note:

In the python implementation, pint is used to resolve units. see tcode_api.units.

Parameters:
  • type (Literal['ValueWithUnits'])

  • magnitude (float)

  • units (str)

to(units)

Convert to the specified units.

Note:

Units implementation in python uses pint under the hood.

Parameters:

units (str | Unit) – The units to convert to.

Return type:

ValueWithUnits

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'strict': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class tcode_api.schemas.common.WellPartType(*values)

Referenceable parts of a well.

TOP = 'TOP'

The center of a well, co-planar with the top of the labware.

BOTTOM = 'BOTTOM'

The deepest point of a well, as centered on it’s opening.

e.g. a well with a triangular bottom will have a BOTTOM that is NOT at the lowest point.