Skip to content

Commit d43fdd7

Browse files
authored
fix(api): do not cache tip lengths because it breaks calibration (#7778)
Because of this cache, tip lengths wouldn't properly be applied during labware calibration but would be during run.
1 parent 0b67e91 commit d43fdd7

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

api/src/opentrons/protocol_api/instrument_context.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import logging
4-
from functools import lru_cache
54
from typing import (
65
List, Optional, Sequence, TYPE_CHECKING, Union)
76
from opentrons.broker import Broker
@@ -1420,7 +1419,6 @@ def run(ctx: protocol_api.ProtocolContext):
14201419
log_parent=self._log
14211420
)
14221421

1423-
@lru_cache(maxsize=12)
14241422
def _tip_length_for(self, tiprack: Labware) -> float:
14251423
""" Get the tip length, including overlap, for a tip from this rack """
14261424
return tip_length_for(self.hw_pipette, tiprack)

api/tests/opentrons/protocol_api/test_context.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,6 @@ def test_order_of_module_load(loop):
938938
def test_tip_length_for(ctx, monkeypatch):
939939
instr = ctx.load_instrument('p20_single_gen2', 'left')
940940
tiprack = ctx.load_labware('geb_96_tiprack_10ul', '1')
941-
instr._tip_length_for.cache_clear()
942941
assert instr._tip_length_for(tiprack)\
943942
== (tiprack._implementation.get_definition()['parameters']['tipLength']
944943
- instr.hw_pipette['tip_overlap']
@@ -959,9 +958,7 @@ def test_tip_length_for_caldata(ctx, monkeypatch, use_new_calibration):
959958
status=cs_types.CalibrationStatus(markedBad=False),
960959
uri='opentrons/geb_96_tiprack_10ul/1')
961960
monkeypatch.setattr(get, 'load_tip_length_calibration', mock_tip_length)
962-
instr._tip_length_for.cache_clear()
963961
assert instr._tip_length_for(tiprack) == 2
964-
instr._tip_length_for.cache_clear()
965962
mock_tip_length.side_effect = cs_types.TipLengthCalNotFound
966963
assert instr._tip_length_for(tiprack) == (
967964
tiprack._implementation.get_definition()['parameters']['tipLength']

0 commit comments

Comments
 (0)