-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(shared-data): Re-apply update tip overlap values for Flex Pipettes (#15147) #15284
Merged
sfoster1
merged 5 commits into
chore_internal-release-1.5.1
from
chore-update-tip-overlap
Jun 5, 2024
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f4c790e
fix(shared-data) Update tip overlap values for Flex Pipettes (#15147)
Carlos-fernandez be2ac12
feat(api): API 2.19 uses updated tip overlap values
sfoster1 cd78552
glad i had this test
sfoster1 8d35644
correct data values
sfoster1 3670960
oops
sfoster1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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" | ||
|
||
|
||
DerekMaggio marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
snuck in there