science_jubilee.tools package#
Subpackages#
Submodules#
science_jubilee.tools.AS7341 module#
- class science_jubilee.tools.AS7341.AS7341(index, name, config)[source]#
Bases:
ToolA class representation of the AS7341 spectral sensor.
- Parameters:
Tool (
Tool) – The base tool class
- blink(cmd: int | str) None[source]#
Send a blink command to the connected Seeed device
- Parameters:
- Raises:
ToolStateError – If no serial port is connected
- connect_seeed(ser_port_index: int = 0) Serial[source]#
Connect to a Seeed device at the specified port index
- Parameters:
ser_port_index (int, optional) – Index of the serial port to connect to, defaults to 0
- Returns:
Connected serial port
- Return type:
serial.Serial
- disconnect_seeed() bool[source]#
Disconnect from the currently connected Seeed device
- Returns:
True if disconnection was successful
- Return type:
- find_seeed() List[Serial][source]#
Find all Seeed Studio or Espressif devices connected to the system
- Returns:
List of serial ports for connected Seeed devices
- Return type:
List[serial.Serial]
- Raises:
IOError – If no Seeed devices are found
- get_raw_spectrum(duty_cycle: int = 100) str[source]#
Get the raw spectral data string from the AS7341 sensor
- Parameters:
duty_cycle (int, optional) – The duty cycle for the measurement (0-100), defaults to 100
- Returns:
Raw string output from the sensor
- Return type:
- Raises:
ToolStateError – If no serial port is connected
- measure_spectrum(duty_cycle: int = 100) Dict[str, Any][source]#
Measure the spectral values from the AS7341 sensor
- Parameters:
duty_cycle (int, optional) – The duty cycle for the measurement (0-100), defaults to 100
- Returns:
Dictionary containing the spectral readings from different channels
- Return type:
Dict[str, Any]
- Raises:
ToolStateError – If no serial port is connected
ValueError – If duty cycle is out of range
science_jubilee.tools.Camera module#
science_jubilee.tools.HTTPSyringe module#
- class science_jubilee.tools.HTTPSyringe.HTTPSyringe(index, name, url)[source]#
Bases:
Tool- load_syringe(volume, pulsewidth)[source]#
Configure a syringe after physically loading it
volume: Current loaded volume in syringe pulsewidth: current pulsewidth position of servo
science_jubilee.tools.Loop module#
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:
Toolclass 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/latest/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
PeristalticPumpsobject- Return type:
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:
ToolA class representation of an Opentrons OT2 pipette.
- classmethod from_config(index, name, config_file: str, path: str = '/home/docs/checkouts/readthedocs.org/user_builds/science-jubilee/checkouts/latest/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 pipette configuration .json files for the tool, defaults to the ‘config/’ in the science_jubilee/tools/configs directory.
- Returns:
A
Pipetteobject- Return type:
- 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
- class science_jubilee.tools.Pipette.TipTracker(tips, start_well=None)[source]#
Bases:
objectA class to track the usage of pipette tips and their location in the tiprack
- Parameters:
tips (list[
Well]) – The list of tips in the tiprackstart_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
science_jubilee.tools.PneumaticSampleLoader module#
- class science_jubilee.tools.PneumaticSampleLoader.PneumaticSampleLoader(url, port, name, cell_location, safe_position, username, password)[source]#
Bases:
ToolInterfaces the AFL sample loader tool with Jubilee deck
- enqueue(task: dict)[source]#
Enqueue a task to be executed by the pneumatic sample loader.
returns task uuid
- get_cell_state() str[source]#
Get the current state of the sample cell.
- Returns:
The current state of the sample cell (e.g., ‘LOADED’, ‘IDLE’, etc.)
- Return type:
- load_sample(tool, sample_location: str, volume) bool[source]#
Load a sample into the sample cell using pneumatic pressure. First moves to the specified position, then performs the loading operation.
- Parameters:
tool – pipette-like tool (ie OT P300, HTTP syringe)
sample_location – location
- Returns:
True if sample was loaded successfully, False otherwise.
- Return type:
- parse_state(status_list: str) tuple[str, str][source]#
Parse the state and arm state from a status string.
science_jubilee.tools.PumpDispenser module#
- class science_jubilee.tools.PumpDispenser.PumpDispenser(index, name, pump_group, dispense_tip_offsets, line_volume, waste=None)[source]#
Bases:
ToolClass 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
- classmethod from_config(index, pump_group, config_file: str, path: str = '/home/docs/checkouts/readthedocs.org/user_builds/science-jubilee/checkouts/latest/docs/../src/science_jubilee/tools/configs')[source]#
Initialize the pipette object from a config file
- Parameters:
- Returns:
A
PumpDispenserobject- Return type:
- 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:
ToolA 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
science_jubilee.tools.Spectrometer module#
science_jubilee.tools.Syringe module#
- class science_jubilee.tools.Syringe.Syringe(index, name, config)[source]#
Bases:
ToolA class representation of a syringe.
- Parameters:
Tool (
Tool) – The base tool class
- check_bounds(pos)[source]#
Disallow commands outside of the syringe’s configured range
- Parameters:
pos (float) – The E position to check
- 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
science_jubilee.tools.SyringeExtruder module#
- class science_jubilee.tools.SyringeExtruder.SyringeExtruder(index, name, config)[source]#
Bases:
ToolA class representation of a syringe for extrusion 3D printing.
- Parameters:
Tool (
Tool) – The base tool class
- check_bounds(pos)[source]#
Disallow commands outside of the syringe’s configured range
- Parameters:
pos (float) – The E position to check
- 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
science_jubilee.tools.Tool module#
- exception science_jubilee.tools.Tool.ToolConfigurationError[source]#
Bases:
ExceptionRaise this error if there is something wrong with how the tool is configured
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:
ToolA class representation of a Raspberry Pi camera server client.
- 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/latest/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
Cameraobject- Return type:
Cameraobject
- process_image(image_bin, radius=50)[source]#
Externally callable function to run processing pipeline