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.

pydantic model tcode_api.schemas.common.ValueWithUnits

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.

Show JSON schema
{
   "title": "ValueWithUnits",
   "description": "A numeric value with associated units.\n\n:note: The following values are all equivalent:\n\n    ``ValueWithUnits(magnitude=0.005, units=\"L\")``\n\n    ``ValueWithUnits(magnitude=5, units=\"mL\")``\n\n    ``ValueWithUnits(magnitude=5000, units=\"uL\")``\n\n    ``ValueWithUnits(magnitude=5000, units=\"mm\u00b3\")``\n\n:note: In the python implementation, ``pint`` is used to resolve units. see `tcode_api.units`.",
   "type": "object",
   "properties": {
      "type": {
         "const": "ValueWithUnits",
         "default": "ValueWithUnits",
         "title": "Type",
         "type": "string"
      },
      "magnitude": {
         "title": "Magnitude",
         "type": "number"
      },
      "units": {
         "title": "Units",
         "type": "string"
      }
   },
   "required": [
      "magnitude",
      "units"
   ]
}

Config:
  • strict: bool = True

  • extra: str = ignore

Fields:
  • magnitude (float)

  • type (Literal['ValueWithUnits'])

  • 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

field type: Literal['ValueWithUnits'] = 'ValueWithUnits'
field magnitude: float [Required]
field units: str [Required]
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.