Skip to content

Useful Types

types

Point

from_xyz_attrs classmethod

from_xyz_attrs(has_xyz)

Construct a Point from another object that has .x/.y/.z attributes.

Location

A location to target as a motion.

The location contains a Pointand possibly an associated Labware or Well instance.

It should rarely be constructed directly by the user; rather, it is the return type of most Well accessors like Well.top() and is passed directly into a method like InstrumentContext.aspirate().

Warning

The .labware attribute of this class is used by the protocol API internals to, among other things, determine safe heights to retract the instruments to when moving between locations. If constructing an instance of this class manually, be sure to either specify None as the labware (so the robot does its worst case retraction) or specify the correct labware for the .point attribute.

Warning

The == operation compares both the position and associated labware. If you only need to compare locations, compare the .point of each item.

move

move(point)

Alter the point stored in the location while preserving the labware.

This returns a new Location and does not alter the current one. It should be used like

    loc = Location(Point(1, 1, 1), None)
    new_loc = loc.move(Point(1, 1, 1))

    # The new point is the old one plus the given offset.
    assert new_loc.point == Point(2, 2, 2)  # True

    # The old point hasn't changed.
    assert loc.point == Point(1, 1, 1)  # True

Mount

StringAxisMap module-attribute

StringAxisMap = Dict[str, float]

types

APIVersion

CSVParameter

contents property

contents

Returns the full contents of the CSV file as a single string.

file property

file

Returns the file handler for the CSV file.

The file is treated as read-only, UTF-8-encoded text.

file_opened property

file_opened

Returns True if a file handler is open for the CSV parameter.

parse_as_csv

parse_as_csv(detect_dialect=True, **kwargs)

Parses the CSV data and returns a list of lists.

Each item in the parent list corresponds to a row in the CSV file. If the CSV has a header, that will be the first row in the list: .parse_as_csv()[0].

Each item in the child lists corresponds to a single cell within its row. The data for each cell is represented as a string. You may need to trim whitespace or otherwise validate string contents before passing them as inputs to other API methods. For numeric data, cast these strings to integers or floating point numbers, as appropriate.

Parameters:

  • detect_dialect (bool, default: True ) –

    If True, examine the file and try to assign it a csv.Dialect to improve parsing behavior. Set this to False when using the file output of AbsorbanceReaderContext.read() as a runtime parameter.

  • **kwargs (Any, default: {} ) –

    For advanced CSV handling, you can pass any of the formatting parameters accepted by csv.reader() from the Python standard library.

OFF_DECK module-attribute

OFF_DECK = OFF_DECK