-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(api): Choose the deck type slightly less implicitly (#11812)
- Loading branch information
1 parent
1e81662
commit 611aaba
Showing
29 changed files
with
233 additions
and
107 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,8 @@ | ||
from pathlib import Path | ||
|
||
from opentrons.config import get_opentrons_path | ||
from opentrons.config import feature_flags as ff | ||
|
||
OPENTRONS_NAMESPACE = "opentrons" | ||
CUSTOM_NAMESPACE = "custom_beta" | ||
STANDARD_DEFS_PATH = Path("labware/definitions/2") | ||
USER_DEFS_PATH = get_opentrons_path("labware_user_definitions_dir_v2") | ||
|
||
SHORT_TRASH_DECK = "ot2_short_trash" | ||
STANDARD_OT2_DECK = "ot2_standard" | ||
STANDARD_OT3_DECK = "ot3_standard" | ||
|
||
|
||
def deck_type() -> str: | ||
if ff.enable_ot3_hardware_controller(): | ||
return STANDARD_OT3_DECK | ||
elif ff.short_fixed_trash(): | ||
return SHORT_TRASH_DECK | ||
else: | ||
return STANDARD_OT2_DECK |
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,29 @@ | ||
from opentrons.config import feature_flags | ||
|
||
|
||
# TODO(mm, 2023-05-10): Deduplicate these constants with | ||
# opentrons.protocol_engine.types.DeckType and consider moving to shared-data. | ||
SHORT_TRASH_DECK = "ot2_short_trash" | ||
STANDARD_OT2_DECK = "ot2_standard" | ||
STANDARD_OT3_DECK = "ot3_standard" | ||
|
||
|
||
def guess_from_global_config() -> str: | ||
"""Return a default deck type based on global environment configuration. | ||
Deprecated: | ||
The notion of "a default deck type" doesn't make sense now that we have: | ||
* Decks that are meaningfully different from each other (OT-2 vs. OT-3). | ||
* Protocol analysis running off-robot, in environments that cannot be | ||
permanently configured for any single specific deck type. | ||
If you need to know the deck type, derive it from explicit sources, | ||
like the protocol's declared robot type, instead. | ||
""" | ||
if feature_flags.enable_ot3_hardware_controller(): | ||
return STANDARD_OT3_DECK | ||
elif feature_flags.short_fixed_trash(): | ||
return SHORT_TRASH_DECK | ||
else: | ||
return STANDARD_OT2_DECK |
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.