pylabrobot.opentrons.flex.Flex#

class pylabrobot.opentrons.flex.Flex(host: str, port: int = 31950, deck: FlexDeck | None = None, io: HTTP | None = None, command_timeout: float = 30.0, command_poll_interval: float = 0.05)#

Bases: object

Opentrons Flex liquid handler, over the robot-server HTTP API.

A device shell composed on the shared pylabrobot.io.HTTP transport (OpentronsAPI + a run-scoped OpentronsRun): it owns the deck, deck-scoped labware loading, and the discover-then-compose lifecycle that builds mount-addressed head sub-objects (left/right/head96). Liquid-handling ops live on the heads, not here — see pylabrobot.opentrons.flex.flex_head.

connect() opens the transport for health/discovery queries; setup() also creates a run, homes, and composes the heads.

Attributes

left_pipette

Pipette on the left mount, also available as left.

pipettes

Mounted pipettes in discovery order, including a 96-channel head.

right_pipette

Pipette on the right mount, also available as right.

software_version

Robot software version read at connection time.

traversal_height

Minimum tip/nozzle Z for travel, above the tallest modeled labware.

Methods

__init__(host[, port, deck, io, ...])

add_comment(message)

Record message in the run's command log; the robot does nothing else with it.

attach_deck(deck)

Replace the deck before setup or after stopping the active run.

cancel_run()

End the control session, handing the robot back to its own touchscreen.

connect()

Open the link and confirm the robot answers.

create_run()

Start a control session.

disconnect()

Drop the link, moving nothing.

get_health()

Read fresh robot health without creating a run.

get_instruments()

Read physical instruments before setup, without loading them into a run.

get_runs()

Read server runs without selecting or stopping them.

home()

Home all axes.

initialize()

Discover what is mounted and compose the heads.

labware_moved_off_deck(resource)

Tell the robot an EXTERNAL agent (human or lab transporter) removed labware.

list_connected_modules()

Read module identities without loading them into a run.

move_axes_relative(axis_map[, speed])

Jog the named axes by distances (mm) from where they are, returning where they land.

move_axes_to(axis_map[, critical_point, speed])

Move the named axes to absolute deck-frame positions (mm), returning where they land.

reload_labware(resource)

Re-read the labware's position after a human moved it in its own slot.

retract_axis(axis)

Retract axis to its home position, clearing the deck below it.

send_command(command_type[, params, wait, ...])

Send any robot command by name, for the parts of the robot this class does not wrap.

set_rail_lights(on)

Turn the deck rail lights on or off.

set_status_bar(animation)

Play a built-in light-bar animation: "idle", "confirm", "updating", "disco" or "off".

setup([skip_home])

Bring the robot fully up, PyLabRobot's usual one-call lifecycle entry.

stop()

Park the gantry and release the robot, dropping any mounted tips first.

sync_tips_to_robot(tip_rack)

Make the robot's tip-rack model agree with PyLabRobot's.

wait_for_duration(seconds)

Hold the run for seconds before the next command runs.

Parameters:
  • host (str)

  • port (int)

  • deck (FlexDeck | None)

  • io (HTTP | None)

  • command_timeout (float)

  • command_poll_interval (float)