-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(shared-data): Re-apply update tip overlap values for Flex Pipettes (
#15147) (#15284) This is #15147 again but this time outside the context of an extremely imminent release. While this code needs to be merged, we should carefully consider how we do so. We can't ship this until we can separate this behavior by API level so that customers who may have tuned in offsets based on the old incorrect tip offsets won't have their protocols invalidated - this data needs to be loaded by API level. Closes EXEC-452 --------- Co-authored-by: Carlos-fernandez <[email protected]>
- Loading branch information
1 parent
085c140
commit 1754667
Showing
26 changed files
with
258 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
api/src/opentrons/protocol_api/core/engine/overlap_versions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"""Mappings between API versions and overlap versions.""" | ||
from functools import lru_cache | ||
from typing_extensions import Final | ||
from opentrons.protocols.api_support.types import APIVersion | ||
|
||
_OVERLAP_VERSION_MAP: Final = {APIVersion(2, 0): "v0", APIVersion(2, 19): "v1"} | ||
|
||
|
||
@lru_cache(1) | ||
def overlap_for_api_version(api_version: APIVersion) -> str: | ||
"""Get the overlap version for a specific API version.""" | ||
defined = list(reversed(sorted(_OVERLAP_VERSION_MAP.keys()))) | ||
for version in defined: | ||
if version <= api_version: | ||
return _OVERLAP_VERSION_MAP[version] | ||
return _OVERLAP_VERSION_MAP[APIVersion(2, 0)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
api/tests/opentrons/protocol_api/core/engine/test_overlap_versions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""Test the tip overlap selection logic in the API core.""" | ||
import pytest | ||
|
||
from opentrons.protocol_api.core.engine.overlap_versions import overlap_for_api_version | ||
from opentrons.protocols.api_support.types import APIVersion | ||
|
||
from ... import versions_below, versions_at_or_above | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"api_version", versions_below(APIVersion(2, 19), flex_only=False) | ||
) | ||
def test_all_below_219_use_v0(api_version: APIVersion) -> None: | ||
"""Versions below 2.19 should use v0.""" | ||
assert overlap_for_api_version(api_version) == "v0" | ||
|
||
|
||
@pytest.mark.parametrize("api_version", versions_at_or_above(APIVersion(2, 19))) | ||
def test_all_above_219_use_v1(api_version: APIVersion) -> None: | ||
"""Versions above 2.19 should use v1.""" | ||
assert overlap_for_api_version(api_version) == "v1" | ||
|
||
|
||
def test_future_api_version_uses_v1() -> None: | ||
"""Future versions should use v1.""" | ||
assert overlap_for_api_version(APIVersion(2, 99)) == "v1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.