science_jubilee.tools package#

Subpackages#

Submodules#

science_jubilee.tools.Camera module#

science_jubilee.tools.Loop module#

class science_jubilee.tools.Loop.Loop(index, name)[source]#

Bases: Tool

A class representation of an inoculation loop.

Parameters:

Tool (Tool) – The base tool class

transfer(*args, **kwargs)[source]#

science_jubilee.tools.PeristalticPumps module#

class science_jubilee.tools.PeristalticPumps.PeristalticPumps(n_pumps: int, steps_per_ml: float | int | list, tool_axis: str = 'E', name: str = 'dispenser_pumps')[source]#

Bases: Tool

class representation of peristaltic pumps. Due to duet-level axis definition requirements, currently requires an accompanying PumpDispenser tool to control pumps.

Parameters:
  • n_pumps (int) – Number of peristaltic pumps

  • steps_per_mL (float, int, list) – stepper motor steps to turn pump to pump 1mL of liquid. calibrate gravimetrically. Can pass a float or int to apply same value to each pump or list to apply unique value to each pump.

  • tool_axis (str) – Motion axis tool is defined to on duet. Default E

  • name (str) – name of tool

classmethod from_config(config_file: str, path: str = '/home/docs/checkouts/readthedocs.org/user_builds/science-jubilee/checkouts/stable/docs/../src/science_jubilee/tools/configs')[source]#

Initialize a PeristalticPumps object from a config file

Parameters:

config_file (str) – The name of the config file containign the pump parameters

Returns:

A PeristalticPumps object

Return type:

PeristalticPumps

post_load()[source]#

After tool load, set steps per mm on machine

pump(volume: int | float | list)[source]#

transfer volume using pump

Parameters:

volume (int, float, list) – volume to pump. Specify a number (int/float) to pump same amount from all pumps simultaneously, or a list of numbers to pump unique amount from each pump.

science_jubilee.tools.Pipette module#

class science_jubilee.tools.Pipette.Pipette(index, name, brand, model, max_volume, min_volume, zero_position, blowout_position, drop_tip_position, mm_to_ul)[source]#

Bases: Tool

A class representation of an Opentrons OT2 pipette.

add_tiprack(tiprack: Labware | list)[source]#

Associate a tiprack with the pipette tool

Parameters:

tiprack (Union[Labware, list]) – The tiprack to associate with the pipette

air_gap(*args, **kwargs)[source]#
aspirate(*args, **kwargs)[source]#
blowout(*args, **kwargs)[source]#
dispense(*args, **kwargs)[source]#
drop_tip(*args, **kwargs)[source]#
classmethod from_config(index, name, config_file: str, path: str = '/home/docs/checkouts/readthedocs.org/user_builds/science-jubilee/checkouts/stable/docs/../src/science_jubilee/tools/configs')[source]#

Initialize the pipette object from a config file

Parameters:
  • index (int) – The tool index of the pipette on the machine

  • name (str) – The tool name

  • config_file (str) – The name of the config file containign the pipette parameters

  • path – The path to the labware configuration .json files for the labware, defaults to the ‘labware_definition/’ in the science_jubilee/labware directory.

Returns:

A Pipette object

Return type:

Pipette

mix(*args, **kwargs)[source]#
pickup_tip(*args, **kwargs)[source]#
post_load()[source]#

Prime the Pipette after loading it onto the Machine sot hat it is ready to use

prime(s=2500)[source]#

Moves the plunger to the low-point on the pipette motor axis to prepare for further commands Note::This position should not engage the pipette tip plunger

Parameters:

s (int) – The speed of the plunger movement in mm/min

return_tip(*args, **kwargs)[source]#
stir(*args, **kwargs)[source]#
transfer(*args, **kwargs)[source]#
update_z_offset(tip: bool = None)[source]#

Shift the z-offset of the tool to account for the tip length

Parameters:

tip (bool, optional) – Parameter to indicated whether to add or remove the tip offset, defaults to None

vol2move(vol)[source]#

Converts desired volume in uL to a movement of the pipette motor axis

Parameters:

vol (float) – The desired amount of liquid expressed in uL

Returns:

The corresponding motor movement in mm

Return type:

float

class science_jubilee.tools.Pipette.TipTracker(tips, start_well=None)[source]#

Bases: object

A class to track the usage of pipette tips and their location in the tiprack

Parameters:
  • tips (list[Well]) – The list of tips in the tiprack

  • start_well (Well, optional) – The starting well to begin tracking the tips from, defaults to None

Note: This function was taken from the Opentrons API and modified to work with the Pipette class of Science_Jubilee

assign_tip_to_stock(tip_well, stock_well)[source]#
next_tip(start_well=None)[source]#
previous_tip()[source]#
return_tip(well=None)[source]#
use_tip(tip_well)[source]#
science_jubilee.tools.Pipette.tip_check(func)[source]#

Decorator to check if the pipette has a tip attached before performing an action.

science_jubilee.tools.PumpDispenser module#

class science_jubilee.tools.PumpDispenser.PumpDispenser(index, name, pump_group, dispense_tip_offsets, line_volume, waste=None)[source]#

Bases: Tool

Class to manage dispenser tool, for example for a color mixing demo

Parameters:
  • index – The tool index of the dispenser head on the machine

  • name (str) – The tool name

  • pump_group (science_jubilee.tools.PeristalticPump.PeristalticPumps) – science_jubilee.tools.PeristalticPump.PeristalticPumps object to assign to dispenser head

  • dispense_tip_offset (list) – Offsets from tool reference point for every dispense tip on the tool

  • line_volume (int, float) – Volume in mL of tubing line between pump and dispense head for 1 line

  • waste (class 'Well') – Location of waste basin

add_waste(location: Well | Tuple | Location)[source]#

Specify a waste collection container to dump extra liquid into. This should be large enough to catch liquid from all dispenser tips simultaneously.

Parameters:

location (class 'Well') – location of container

dispense(vol: float | int | list, location: Well | Tuple | Location, dispense_head_index=None)[source]#

Dispense volume vol from dispense head dispense_head_index into location

Parameters:
  • vol (float, int list) – Volume to dispense, in mL. Specify a single number (float, int) and a dispense head index (int) to dispense from a single specific dispense head, the single volume with no dispense head to dispense this amount from all dispense tips, or a list of volumes to dispense unique amount from each dispense tip

  • location (class 'Well') – Location to dispense

  • dispense_head_index (int) – index of dispense tip to dispense from, if passing single number for vol

empty_lines(volume: int | float = None)[source]#

return line contents to stock wells.

Parameters:

volume (int, float) – line volume to return, if not set in instance already

classmethod from_config(index, pump_group, config_file: str, path: str = '/home/docs/checkouts/readthedocs.org/user_builds/science-jubilee/checkouts/stable/docs/../src/science_jubilee/tools/configs')[source]#

Initialize the pipette object from a config file

Parameters:
  • index (int) – The tool index of the dispenser_head on the machine

  • config_file (str) – The name of the config file containign the dispenser tool parameters

Returns:

A PumpDispenser object

Return type:

PumpDispenser

prime_lines(volume: int | float = None, location: Well | Tuple | Location = None)[source]#

Fill all lines with liquid from all pumps simultaneously.

Parameters:
  • volume – volume to prime with, if not specified in config file

  • location (class 'Well') – location of waste container, if not already specified

science_jubilee.tools.Sonicator module#

class science_jubilee.tools.Sonicator.Sonicator(index, name, mode: str, port: str = None)[source]#

Bases: Tool

A class representation for a Qsonica Sonicator tool.

perform_cleanining_protocol(plunge_depth: float = None)[source]#

Perform the cleaning protocol on the sonicator.

Parameters:

plunge_depth (float, optional) – depth to plunge the sonicator into the well, defaults to None

set_cleaning_protocol(wells: List[Well], power: List[float], time: List[float], plunge_depth: float = None)[source]#

Set the cleaning protocol for the sonicator.

Parameters:
  • wells (List[Well]) – list of wells to clean

  • power (List[float]) – power level to clean at

  • time (List[float]) – time to clean for

  • plunge_depth (float, optional) – depth of the sonicator into the well, defaults to None

sonicate_well(*args, **kwargs)[source]#

science_jubilee.tools.Spectrometer module#

science_jubilee.tools.Syringe module#

class science_jubilee.tools.Syringe.Syringe(index, name, config)[source]#

Bases: Tool

A class representation of a syringe.

Parameters:

Tool (Tool) – The base tool class

aspirate(*args, **kwargs)[source]#
check_bounds(pos)[source]#

Disallow commands outside of the syringe’s configured range

Parameters:

pos (float) – The E position to check

dispense(*args, **kwargs)[source]#
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.

transfer(*args, **kwargs)[source]#

science_jubilee.tools.SyringeExtruder module#

class science_jubilee.tools.SyringeExtruder.SyringeExtruder(index, name, config)[source]#

Bases: Tool

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

Parameters:

Tool (Tool) – The base tool class

aspirate(*args, **kwargs)[source]#
check_bounds(pos)[source]#

Disallow commands outside of the syringe’s configured range

Parameters:

pos (float) – The E position to check

dispense(*args, **kwargs)[source]#
dist(start, end)[source]#
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

make_e(x, y, z)[source]#
move_extrude(*args, **kwargs)[source]#
post_load()[source]#

Query the object model after loading the tool to find the extruder number of this syringe.

wipe_nozzle(x=285, y=250, z=0.2)[source]#
wipe_tower(x=285, y=250, z=0.2)[source]#

science_jubilee.tools.Tool module#

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

Bases: object

post_load()[source]#

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

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

Bases: Exception

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

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

Bases: Exception

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

science_jubilee.tools.Tool.requires_active_tool(func)[source]#

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

science_jubilee.tools.WebCamera module#

class science_jubilee.tools.WebCamera.Camera(index, name, ip_address, port, video_endpoint, still_endpoint, image_folder, focus_height, light: bool = False, light_pin: int = None)[source]#

Bases: Tool

A class representation of a Raspberry Pi camera server client.

capture_image(*args, **kwargs)[source]#
decode_image(image_bin)[source]#

Decode a bstring image into an np.array

Parameters:

image_bin (bytes) – the image as a bstring

Returns:

the image as an np.array

Return type:

np.array

classmethod from_config(index, name, config_file: str, path: str = '/home/docs/checkouts/readthedocs.org/user_builds/science-jubilee/checkouts/stable/docs/../src/science_jubilee/tools/configs')[source]#

Initialize the pipette object from a config file

Parameters:
  • index (int) – The tool index of the pipette on the machine

  • name (str) – The name associated with the tool (e.g. ‘WebCamera’)

  • config_file (str) – The name of the config file containing the tool parameters

  • path (str, optional) – The path to the labware configuration .json files for the labware, defaults to the ‘labware_definition/’ in the science_jubilee/labware directory.

Returns:

the initialized Camera object

Return type:

Camera object

process_image(image_bin, radius=50)[source]#

Externally callable function to run processing pipeline

Parameters:
  • image_bin (bytes) – the image as a bstring

  • radius (int, optional) – the radius (in pixels) of the circular mask, defaults to 50

Returns:

the average rgb values of the masked image

Return type:

list

video_feed()[source]#

Deploys a video feed at the url specified in the config file

view_image(image_bin, masked=False, radius=50)[source]#

Show the image in a matplotlib window

Parameters:
  • image_bin (bytes) – the image as a bstring

  • masked (bool, optional) – Wether to mask the image or not, defaults to False

  • radius (int, optional) – the size (in pixel) of the circular mask toapply to the image , defaults to 50

Module contents#