def calibrate(): curr_container = get_selected_container() if curr_container is not None: rel_pos = curr_container.from_center(x=0,y=0,z=-1, reference=curr_container) print('Current position: ' + str(robot._driver.get_head_position()['current'])) # currently only one instrument robot.get_instruments()[0][1].calibrate_position((curr_container, rel_pos))
def test_load_pipettes(): # TODO Ian 2018-11-07 when `model` is dropped, delete its test case test_cases = [ # deprecated case { "pipettes": { "leftPipetteHere": { "mount": "left", "model": "p10_single_v1.3" } } }, # future case { "pipettes": { "leftPipetteHere": { "mount": "left", "name": "p10_single" } } } ] for data in test_cases: robot.reset() loaded_pipettes = execute_v1.load_pipettes(data) robot_instruments = robot.get_instruments() assert len(robot_instruments) == 1 mount, pipette = robot_instruments[0] assert mount == 'left' # loaded pipette in result dict should match that in robot_instruments assert pipette == loaded_pipettes['leftPipetteHere']
def _get_all_pipettes(): robot = Robot.get_instance() pipette_list = [] for _, p in robot.get_instruments(): if isinstance(p, instruments.Pipette): pipette_list.append(p) return sorted(pipette_list, key=lambda p: p.name.lower())
def get_instruments(robot): return [{ 'name': instr.name, 'axis': axis.lower(), 'channels': getattr(instr, 'channels', None), 'type': instr.__class__.__name__.lower(), 'min_volume': getattr(instr, 'min_volume', None), 'max_volume': getattr(instr, 'max_volume', None) } for axis, instr in robot.get_instruments()]
def move_to_container(): curr_container = get_selected_container() if curr_container is not None: pipette = robot.get_instruments()[0][1] robot.clear_commands() # has default location based on slot even if not set pipette.move_to(curr_container) print(robot.commands()) robot.run() coords = get_coords() pos_str.set("x: " + str(coords.x) + "\ny: " + str(coords.y) + "\nz: " + str(coords.z))
def _fetch_or_create_pipette(mount, model=None): existing_pipettes = robot.get_instruments() pipette = None for existing_mount, existing_pipette in existing_pipettes: if existing_mount == mount: pipette = existing_pipette if pipette is None: if model is None: pipette = instruments.Pipette(mount=mount) else: config = pipette_config.load(model) pipette = instruments._create_pipette_from_config(config=config, mount=mount) return pipette
def create_container_instance(name, grid, spacing, diameter, depth, volume=0, slot=None, label=None, Transposed=False): from opentrons import robot from opentrons.containers.placeable import Container, Well if slot is None: raise RuntimeError('"slot" argument is required.') if label is None: label = name columns, rows = grid col_spacing, row_spacing = spacing custom_container = Container() well_properties = { 'type': 'custom', 'diameter': diameter, 'height': depth, 'total-liquid-volume': volume } for r in range(rows): for c in range(columns): well = Well(properties=well_properties) well_name = chr(c + ord('A')) + str(1 + r) if Transposed: coordinates = (r * col_spacing, c * row_spacing, 0) else: coordinates = (c * col_spacing, r * row_spacing, 0) custom_container.add(well, well_name, coordinates) # if a container is added to Deck AFTER a Pipette, the Pipette's # Calibrator must update to include all children of Deck for _, instr in robot.get_instruments(): if hasattr(instr, 'update_calibrator'): instr.update_calibrator() custom_container.properties['type'] = name custom_container.get_name = lambda: label # add to robot deck robot.deck[slot].add(custom_container, label) return custom_container
def test_load_pipettes(): robot.reset() data = { "pipettes": { "leftPipetteHere": { "mount": "left", "model": "p10_single_v1" } } } loaded_pipettes = protocols.load_pipettes(data) robot_instruments = robot.get_instruments() assert len(robot_instruments) == 1 mount, pipette = robot_instruments[0] assert mount == 'left' # loaded pipette in result dict should match that in robot_instruments assert pipette == loaded_pipettes['leftPipetteHere']
def test_load_pipettes(): data = { "pipettes": { "leftPipetteHere": { "mount": "left", "name": "p10_single" } } } robot.reset() loaded_pipettes = execute_v3.load_pipettes(data) robot_instruments = robot.get_instruments() assert len(robot_instruments) == 1 mount, pipette = robot_instruments[0] assert mount == 'left' # loaded pipette in result dict should match that in robot_instruments assert pipette == loaded_pipettes['leftPipetteHere']
def get_instruments(robot): return [{ 'name': instr.name, 'mount': axis.lower() } for axis, instr in robot.get_instruments()]
# In[ ]: print("================================ Setup recap ================================") # ### Instruments # In[ ]: # list of (mount, instrument) print("\nRecap Instruments") print(robot.get_instruments()) # ### Containers # In[ ]: # List all containers on the deck print("\nRecap containers") for elt in robot.get_containers(): print("\t",elt.parent, elt) # ### Reagents