Пример #1
0
def test_save_tip_length_calibration_data(monkeypatch, clear_tlc_calibration):
    assert not os.path.exists(tlc_path(PIPETTE_ID))

    test_data = {MOCK_HASH: {'tipLength': 22.0, 'lastModified': 1}}
    modify.save_tip_length_calibration(PIPETTE_ID, test_data)
    assert os.path.exists(tlc_path(PIPETTE_ID))
    # test an index file is also created
    assert os.path.exists(tlc_path('index'))
Пример #2
0
def test_load_tip_length_calibration_data(monkeypatch, clear_tlc_calibration):
    assert not os.path.exists(tlc_path(PIPETTE_ID))

    monkeypatch.setattr(helpers, 'hash_labware_def', mock_hash_labware)

    tip_length = 22.0
    parent = ''
    test_data = modify.create_tip_length_data(minimalLabwareDef, parent,
                                              tip_length)
    modify.save_tip_length_calibration(PIPETTE_ID, test_data)
    result = get.load_tip_length_calibration(PIPETTE_ID, minimalLabwareDef,
                                             parent)

    assert result == test_data[MOCK_HASH]
Пример #3
0
def test_load_tip_length_calibration_v1(robot):
    lw = containers_load(robot, 'opentrons_96_tiprack_10ul', '1')
    hash = lw.properties['labware_hash']

    tip_length_data = {'tipLength': 19.99, 'lastModified': utc_now()}
    tip_length_cal = {hash: tip_length_data}
    pip_id = 'fake_id'
    modify.save_tip_length_calibration(pip_id=pip_id,
                                       tip_length_cal=tip_length_cal)

    result = load_tip_length_calibration(pip_id, lw.wells('A1'))

    assert result == tip_length_data

    delete.clear_tip_length_calibration()  # clean up
Пример #4
0
    async def save_offset(self):
        cur_pt = await self._get_current_point()
        if self._current_state == State.measuringNozzleOffset:
            self._nozzle_height_at_reference = cur_pt.z
        elif self._current_state == State.measuringTipOffset:
            assert self._hw_pipette.has_tip
            tip_length_offset = cur_pt.z - self._nozzle_height_at_reference

            # TODO: 07-22-2020 parent slot is not important when tracking
            # tip length data, hence the empty string, we should remove it
            # from create_tip_length_data in a refactor
            tip_length_data = modify.create_tip_length_data(
                self._deck[TIP_RACK_SLOT]._definition, '',
                tip_length_offset)
            modify.save_tip_length_calibration(self._hw_pipette.pipette_id,
                                               tip_length_data)
Пример #5
0
    async def save_offset(self):
        if self._current_state == State.measuringNozzleOffset:
            # critical point would default to nozzle for z height
            cur_pt = await self._get_current_point(
                critical_point=None)
            self._nozzle_height_at_reference = cur_pt.z
        elif self._current_state == State.measuringTipOffset:
            assert self._hw_pipette.has_tip
            assert self._nozzle_height_at_reference is not None
            # set critical point explicitly to nozzle
            cur_pt = await self._get_current_point(
                critical_point=CriticalPoint.NOZZLE)
            tip_length_offset = cur_pt.z - self._nozzle_height_at_reference

            # TODO: 07-22-2020 parent slot is not important when tracking
            # tip length data, hence the empty string, we should remove it
            # from create_tip_length_data in a refactor
            tip_length_data = modify.create_tip_length_data(
                self._tip_rack._definition, '',
                tip_length_offset)
            modify.save_tip_length_calibration(self._hw_pipette.pipette_id,
                                               tip_length_data)