コード例 #1
0
ファイル: shell.py プロジェクト: EndyLab/opentrons
 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))
コード例 #2
0
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']
コード例 #3
0
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())
コード例 #4
0
ファイル: parseOT1.py プロジェクト: npmurphy/Protocols
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()]
コード例 #5
0
ファイル: shell.py プロジェクト: EndyLab/opentrons
 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))
コード例 #6
0
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
コード例 #7
0
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
コード例 #8
0
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']
コード例 #9
0
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']
コード例 #10
0
ファイル: parseOT2.py プロジェクト: stjordanis/Protocols-1
def get_instruments(robot):
    return [{
        'name': instr.name,
        'mount': axis.lower()
    } for axis, instr in robot.get_instruments()]
コード例 #11
0
# 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