science_jubilee.tools.Syringe#
Exceptions#
Raise this error if there is something wrong with how the tool is configured |
|
Raise this error if the tool is in the wrong state to perform such a command. |
Classes#
Functions#
|
Decorator to ensure that a tool cannot complete an action unless it is the |
Module Contents#
- class science_jubilee.tools.Syringe.Labware(labware_filename: str, offset: Tuple[float] = None, order: str = 'rows', path: str = os.path.join(os.path.dirname(__file__), 'labware_definition'))[source]#
Bases:
WellSetA class representing a basic laboratory labware made up of a set of wells/pipette tips.
- Parameters:
labware_filename (str) – The name of the config .json
offset (Tuple[float], optional) – Coordinates to use to offset all the wells in a labware for easier handling of coordinates. For example this is called by the :method:`Deck.load_labware` when assignign a labware to a deck slot, defaults to None
order (str, optional) – Option to order the wells of a labware either by row or columns, defaults to ‘rows’
path (str, optional) – Path to the folder containing the configuration .json files for the labware, defaults to the ‘labware_definition/’ in the science_jubilee/labware directory.
- __repr__()[source]#
Displayed representation of a
Labwareobject indicating the type of labware and its name. Additionally, it will show the :attribute:`Deck.slots` number if the labware has been already assigned to it.
- _create_rows_and_columns()[source]#
Creates a dictionary of
RowandColumnandWellobjects from the data in the config .json file.
- get_row(row_id: str) Row[source]#
Fucntions to fetch the
Well.nameof the indicated row.- Parameters:
row_id (str) – The name of a row of the labware, usually indicated by a capital letter (e.g., A, B, etc.)
- Returns:
A list of
Wellobjects diplayed by their :attribute:`Well.name`- Return type:
Row
- get_column(col_id: int) Column[source]#
Fucntions to fetch the
Well.nameof the indicated column.- Parameters:
col_id (str) – The name of a column of the labware, usually indicated by an integer number (e.g., 1, 2, etc.)
- Returns:
A list of
Wellobjects diplayed by their :attribute:`Well.name`- Return type:
Column
- property shape#
- Returns the shape of the labware as a tuple of (rows, columns)
- property ordering: List[List[str]]#
Returns the ordering of the wells in the labware as a list of lists. Each list represents a row of the labware.
- property brand: dict#
Returns the brand of the labware as a strin
- Returns:
A string with the brand of the labware
- Return type:
- metadata() dict[source]#
Returns the metadata of the labware as a dictionary
The metadata of a labware will generally contain the display name, the type of labware, and the units of volume. These can also be found as attributes of the
Labwareobject.- Returns:
A dictionary with the metadata of the labware
- Return type:
- property display_name#
- Returns the display name of the labware as a string
- Returns:
A string with the display name of the labware
- Return type:
- property labware_type#
- Returns the type of labware as a string
The type fo labware will generally either be a tiprack, wellplate, reservoir, etc.
- Returns:
A string with the type of labware
- Return type:
- property volume_units#
- Returns the units of volume of the labware as a string
The volume units will be either uL or mL.
- Returns:
A string with the units of volume of the labware
- Return type:
- property dimensions: dict#
Returns the dimensions of the labware as a dictionary
- Returns:
A dictionary with the x,y, and z dimensions of the labware
- Return type:
- parameters() dict[source]#
Returns the parameters describing certain features of the labware as a dictionary
The parameters genereally include whether the shape of the labware is regular or irregular, if it is a tiprack, and other Opentrons specific parameters as we are using their ‘Custom Labware Page’ to generate the .json config files.
- Returns:
A dictionary with the parameters of the labware
- Return type:
- property is_tip_rack#
- Returns a boolean indicating if the labware is a tiprack
- Returns:
True if the labware is a tiprack, False otherwise
- Return type:
- property load_name#
- Returns the name of the labware as a string
- Returns:
A string with the name of the labware
- Return type:
- property tip_length#
- Returns the length of the tip of the labware as a float if the labware is a tiprack, otherwise returns None
- Returns:
A float with the length of the tip of the labware or None otherwise
- Return type:
- property tip_overlap#
- Returns the overlap of the tip of the labware as a float if the labware is a tiprack, otherwise returns None
- Returns:
A float with the overlap of the tip of the labware or None otherwise
- Return type:
- property offset#
- Returns the offset of the labware as a tuple of floats
- Returns:
A tuple of floats with the offset of the labware
- Return type:
Tuple[float]
- add_slot(slot_)[source]#
Add name of deck slot after labware has been loaded
- Parameters:
slot (str) – The name of the deck slot
- withWellOrder(order) list[source]#
Reorders the wells by rows or by columns. Automatically updates the :attribute:`Labware.wells`
- Parameters:
order (str) – The order in which to reorder the wells. Can be either ‘rows’ or ‘columns’
- Returns:
A list of
Wellobjects diplayed by their :attribute:`Well.name`- Return type:
- _translate_point(well: Well, theta: float, x_space: float, y_space: float, upper_left: Tuple[float])[source]#
Helper function to translate the coordinates of a well by a given angle theta.
- static _nominal_coordinates(well: Well, x_space: float, y_space: float)[source]#
Helper function to calculate the nominal coordinates of a well in a labware based on its row and column index.
- manual_offset(corner_wells: List[Tuple[float]], save: bool = False)[source]#
Allows the user to manually offset the coordinates of the labware based on three corner wells.
Adapted from https://github.com/machineagency/sonication_station labware calibration procedure.
- load_manualOffset(apply: bool = True)[source]#
Loads the manual offset of a labware from its config .json file for a specific slot
- static _getxyz(location: Well | Tuple | Location)[source]#
Helper function to extract the x, y, z coordinates of a location object.
- Parameters:
location (Union[Well, Tuple, Location]) – The location object to extract the coordinates from. This can either be a
Well, a :tuple: of x, y, z coordinates, or aLocationobject- Raises:
ValueError – If the location is not a
Well, atuple, or aLocationobject- Returns:
The x, y, z coordinates of the location
- Return type:
- class science_jubilee.tools.Syringe.Location(point: Point, labware: Well | Labware)[source]#
A location to target as a motion.
The location contains a
Pointand possibly an associatedLabwareorWellinstance.- property point: Point#
The coordinates (x,y,z) of a Well or a Labware
- Returns:
A tuple of coordinates (x,y,z)
- Return type:
Point
- property labware#
- The :class:`Well` object associated with the coordinates (x,y,z)
- __iter__() Iterable[Point | Well | Labware][source]#
Iterable interface to support unpacking of
Locationobjects.
- class science_jubilee.tools.Syringe.Well[source]#
A class representing a well of a labware.
Each Well is associated with a specific name, depth, total liquid volume, shape, diameter, x, y, and z dimension, y-dimension, as well as its coordinates and any applied offset
- Returns:
A
Wellobject with various information about the geometry of the well and its position in the labware- Return type:
- property x#
- Offsets the x-position of the each well with respect to the deck-slot coordinates
- Returns:
The x-coordinate of the well
- Return type:
- property y#
- Offsets the y-position of the each well with respect to the deck-slot coordinates
- Returns:
The y-coordinate of the well
- Return type:
- property z#
- Offsets the z-position of each well with respect to the deck-slot coordinates
- Returns:
The z-coordinate of the well
- Return type:
- apply_offset(offset: Tuple[float])[source]#
Allows the user to offset the coordinates of the well with respect to the deck-slot coordinates
- Parameters:
offset (Tuple[float]) – A tuple of floats with the new offset of the well
- property top_#
- Defines the top-most point of the well
- Returns:
The z-coordinate of the top of the well
- Return type:
- property bottom_#
- Defines the bottom-most point of the well
- Returns:
The z-coordinate of the bottom of the well
- Return type:
- bottom(z: float, check=False)[source]#
Allows the user to dinamically indicate a new Z location relative to the bottom of the well.
- Parameters:
z (float) – the distance in mm to offset the coordinates from the bottom of the well. Should be +
check (bool, optional) – the ‘z’ parameters can either be + or -. If negative, an assert error is raised to avoid collision with the labware. However, there might be instances of custom labware where the bottom of the well is purposely set as higher during the generation of its config .json file., defaults to False
- Returns:
A
Locationwhich contains information about the new coordinates generated and theWellobject- Return type:
- top(z: float)[source]#
Allows the user to dinamically indicate a new Z location relative to the top of the well.
- __repr__()[source]#
Displayed representation of a
Wellobject indicating its name and its coordinates- Returns:
A string representation of the name and coordinates of a well
- Return type:
- exception science_jubilee.tools.Syringe.ToolConfigurationError[source]#
Bases:
ExceptionRaise this error if there is something wrong with how the tool is configured
- exception science_jubilee.tools.Syringe.ToolStateError[source]#
Bases:
ExceptionRaise this error if the tool is in the wrong state to perform such a command.
- science_jubilee.tools.Syringe.requires_active_tool(func)[source]#
Decorator to ensure that a tool cannot complete an action unless it is the current active tool.
- class science_jubilee.tools.Syringe.Syringe(index, name, config)[source]#
Bases:
science_jubilee.tools.Tool.ToolA class representation of a syringe.
- Parameters:
Tool (
Tool) – The base tool class
- load_config(config)[source]#
Loads the confirguration file for the syringe tool
- Parameters:
config (str) – Name of the config file for your syringe. Expects the file to be in /tools/configs
- post_load()[source]#
Query the object model after loading the tool to find the extruder number of this syringe.
- check_bounds(pos)[source]#
Disallow commands outside of the syringe’s configured range
- Parameters:
pos (float) – The E position to check
- _aspirate(vol: float, s: int = 2000)[source]#
Aspirate a certain volume in milliliters. Used only to move the syringe; to aspirate from a particular well, see aspirate()
- _dispense(vol, s: int = 2000)[source]#
Dispense a certain volume in milliliters. Used only to move the syringe; to dispense into a particular well, see dispense()
- aspirate(vol: float, location: science_jubilee.labware.Labware.Well | Tuple | science_jubilee.labware.Labware.Location, s: int = 2000)[source]#
Aspirate a certain volume from a given well.
- dispense(vol: float, location: science_jubilee.labware.Labware.Well | Tuple | science_jubilee.labware.Labware.Location, s: int = 2000)[source]#
Dispense a certain volume into a given well.
- transfer(vol: float, s: int = 2000, source: science_jubilee.labware.Labware.Well = None, destination: science_jubilee.labware.Labware.Well = None, mix_before: tuple = None, mix_after: tuple = None)[source]#
Transfer liquid from source well(s) to a set of destination well(s). Accommodates one-to-one, one-to-many, many-to-one, and uneven transfers.
- Parameters:
vol (float) – Volume to transfer in milliliters
s (int, optional) – Speed at which to aspirate and dispense in mm/min, defaults to 2000
source (Well, optional) – A source well or set of source wells, defaults to None
destination (Well, optional) – A destination well or set of destination wells, defaults to None
mix_before (tuple, optional) – Mix the source well before transfering, defaults to None
mix_after (tuple, optional) – Mix the destination well after transfering, defaults to None