science_jubilee.tools.SyringeExtruder#

Exceptions#

ToolConfigurationError

Raise this error if there is something wrong with how the tool is configured

ToolStateError

Raise this error if the tool is in the wrong state to perform such a command.

Classes#

Labware

A class representing a basic laboratory labware made up of a set of wells/pipette tips.

Location

A location to target as a motion.

Well

A class representing a well of a labware.

Tool

SyringeExtruder

A class representation of a syringe for extrusion 3D printing.

Functions#

requires_active_tool(func)

Decorator to ensure that a tool cannot complete an action unless it is the

Module Contents#

class science_jubilee.tools.SyringeExtruder.Labware(labware_filename: str, offset: Tuple[float] = None, order: str = 'rows', path: str = os.path.join(os.path.dirname(__file__), 'labware_definition'))[source]#

Bases: WellSet

A 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 Labware object 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 Row and Column and Well objects from the data in the config .json file.

Returns:

A dictionary of Row and Column and Well objects

Return type:

Row, Column, Well

get_row(row_id: str) Row[source]#

Fucntions to fetch the Well.name of 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 Well objects diplayed by their :attribute:`Well.name`

Return type:

Row

get_column(col_id: int) Column[source]#

Fucntions to fetch the Well.name of 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 Well objects diplayed by their :attribute:`Well.name`

Return type:

Column

property shape#
Returns the shape of the labware as a tuple of (rows, columns)
Returns:

A tuple of (rows, columns)

Return type:

Tuple[int, int]

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.

Returns:

A list of lists of Well.name objects

Return type:

List[List[str]]

property brand: dict#

Returns the brand of the labware as a strin

Returns:

A string with the brand of the labware

Return type:

str

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 Labware object.

Returns:

A dictionary with the metadata of the labware

Return type:

dict

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:

str

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:

str

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:

str

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:

dict

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:

dict

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:

bool

property load_name#
Returns the name of the labware as a string
Returns:

A string with the name of the labware

Return type:

str

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:

float

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:

float

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 Well objects diplayed by their :attribute:`Well.name`

Return type:

list

_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.

Parameters:
  • well (Well) – A Well object

  • theta (float) – The angle by which to translate the coordinates of the well

Returns:

The new x and y coordinates of the well

Return type:

float, float

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.

Parameters:
  • offset (Tuple[float]) – A list containing tuples of floats

  • save (bool, optional) – Option to save the manual offset to the original config .json file, defaults to False

Returns:

An updated Labware object with the new coordinates of the wells

Return type:

Labware

load_manualOffset(apply: bool = True)[source]#

Loads the manual offset of a labware from its config .json file for a specific slot

Parameters:

apply (bool, optional) – Option to apply the manual offset to the labware or return values, defaults to False

Returns:

A list of tuples containing the manual offset of the labware

Return type:

List[Tuple[float]]

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 a Location object

Raises:

ValueError – If the location is not a Well, a tuple, or a Location object

Returns:

The x, y, z coordinates of the location

Return type:

float, float, float

class science_jubilee.tools.SyringeExtruder.Location(point: Point, labware: Well | Labware)[source]#

A location to target as a motion.

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

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)
Returns:

A Well object

Return type:

Well

__iter__() Iterable[Point | Well | Labware][source]#

Iterable interface to support unpacking of Location objects.

Returns:

An interable of Location objects

Return type:

Iterable[Union[Point, Well, Labware]]

__eq__(other: object) bool[source]#

Comparison between two Location objects.

Parameters:

other (Location) – A Location object

Returns:

True if the two Location objects are equal, False otherwise

Return type:

bool

__repr__() str[source]#

Returns a string representation of the Location object.

Returns:

A string representation of the Location object

Return type:

str

class science_jubilee.tools.SyringeExtruder.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 Well object with various information about the geometry of the well and its position in the labware

Return type:

Well

name: str#
depth: float#
totalLiquidVolume: float#
shape: str#
diameter: float = None#
xDimension: float = None#
yDimension: float = None#
x: float#
y: float#
z: float#
offset: Tuple[float] = None#
slot: int = None#
has_tip: bool = False#
clean_tip: bool = False#
labware_name: str = None#
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:

float

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:

float

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:

float

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:

float

property bottom_#
Defines the bottom-most point of the well
Returns:

The z-coordinate of the bottom of the well

Return type:

float

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 Location which contains information about the new coordinates generated and the Well object

Return type:

Location

top(z: float)[source]#

Allows the user to dinamically indicate a new Z location relative to the top of the well.

Parameters:

z (float) – the distance in mm to offset the coordinates from the top of the well.Can be either + or -

Returns:

A Location which contains information about the new coordinates generated and the Well object.

Return type:

Location

__repr__()[source]#

Displayed representation of a Well object indicating its name and its coordinates

Returns:

A string representation of the name and coordinates of a well

Return type:

str

set_has_tip(value: bool)[source]#

Set the value of the has_tip attribute.

Parameters:

value (bool) – The new value for the has_tip attribute

set_clean_tip(value: bool)[source]#

Returns the value of the clean_tip attribute.

Parameters:

value (bool) – The new value for the clean_tip attribute

class science_jubilee.tools.SyringeExtruder.Tool(index, name, **kwargs)[source]#
post_load()[source]#

Run any code after tool has been associated with the machine.

exception science_jubilee.tools.SyringeExtruder.ToolConfigurationError[source]#

Bases: Exception

Raise this error if there is something wrong with how the tool is configured

exception science_jubilee.tools.SyringeExtruder.ToolStateError[source]#

Bases: Exception

Raise this error if the tool is in the wrong state to perform such a command.

science_jubilee.tools.SyringeExtruder.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.SyringeExtruder.SyringeExtruder(index, name, config)[source]#

Bases: science_jubilee.tools.Tool.Tool

A class representation of a syringe for extrusion 3D printing.

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

make_e(x, y, z)[source]#
dist(start, end)[source]#
wipe_nozzle(x=285, y=250, z=0.2)[source]#
wipe_tower(x=285, y=250, z=0.2)[source]#
move_extrude(x=None, y=None, z=None, s=180, multiplier=1, e=None)[source]#
_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()

Parameters:
  • vol (float) – Volume to aspirate, in milliliters

  • s (int, optional) – Speed at which to aspirate in mm/min, defaults to 2000

_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()

Parameters:
  • vol (float) – Volume to dispense, in milliliters

  • s (int, optional) – Speed at which to dispense in mm/min, defaults to 2000

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.

Parameters:
  • vol (float) – Volume to aspirate, in milliliters

  • location (Union[Well, Tuple, Location]) – The location (e.g. a Well object) from where to aspirate the liquid from.

  • s (int, optional) – Speed at which to aspirate in mm/min, defaults to 2000

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.

Parameters:
  • vol (float) – Volume to dispense, in milliliters

  • location (Union[Well, Tuple, Location]) – The location to dispense the liquid into.

  • s (int, optional) – Speed at which to dispense in mm/min, defaults to 2000