From ec3c749792353e1f5f8eef001aa2211f1f271ae1 Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Fri, 26 Jan 2024 15:40:56 -0500 Subject: [PATCH] fix(api): remove tip presence feature flag (#14362) It does not do anything, so this removes it. Closes RQA-2131 --- api/src/opentrons/config/advanced_settings.py | 15 +++++++++------ api/src/opentrons/config/feature_flags.py | 7 ------- api/src/opentrons/hardware_control/types.py | 2 -- .../config/test_advanced_settings_migration.py | 12 +++++++++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/api/src/opentrons/config/advanced_settings.py b/api/src/opentrons/config/advanced_settings.py index d78cc9e5b92..f4c88626e4d 100644 --- a/api/src/opentrons/config/advanced_settings.py +++ b/api/src/opentrons/config/advanced_settings.py @@ -236,12 +236,6 @@ class Setting(NamedTuple): description="When this setting is on, Flex will continue its activities regardless of pressure changes inside the pipette. Do not turn this setting on unless you are intentionally causing pressures over 8 kPa inside the pipette air channel.", robot_type=[RobotTypeEnum.FLEX], ), - SettingDefinition( - _id="disableTipPresenceDetection", - title="Disable tip presence detection on pipettes.", - description="This setting disables tip presence detection on pipettes, do not turn this feature off unless recommended.", - robot_type=[RobotTypeEnum.FLEX], - ), ] if ( @@ -683,6 +677,14 @@ def _migrate28to29(previous: SettingsMap) -> SettingsMap: return newmap +def _migrate29to30(previous: SettingsMap) -> SettingsMap: + """Migrate to version 30 of the feature flags file. + + - Removes the disableTipPresenceDetection flag. + """ + return {k: v for k, v in previous.items() if "disableTipPresenceDetection" != k} + + _MIGRATIONS = [ _migrate0to1, _migrate1to2, @@ -713,6 +715,7 @@ def _migrate28to29(previous: SettingsMap) -> SettingsMap: _migrate26to27, _migrate27to28, _migrate28to29, + _migrate29to30, ] """ List of all migrations to apply, indexed by (version - 1). See _migrate below diff --git a/api/src/opentrons/config/feature_flags.py b/api/src/opentrons/config/feature_flags.py index 5bf289a49d2..583dae0b141 100644 --- a/api/src/opentrons/config/feature_flags.py +++ b/api/src/opentrons/config/feature_flags.py @@ -65,13 +65,6 @@ def status_bar_enabled() -> bool: ) -def tip_presence_detection_enabled() -> bool: - """Whether tip presence is enabled on the Flex""" - return not advs.get_setting_with_env_overload( - "disableTipPresenceDetection", RobotTypeEnum.FLEX - ) - - def require_estop() -> bool: """Whether the OT3 should allow gantry movements with no Estop plugged in.""" return not advs.get_setting_with_env_overload( diff --git a/api/src/opentrons/hardware_control/types.py b/api/src/opentrons/hardware_control/types.py index aaf05a30796..67d2307e589 100644 --- a/api/src/opentrons/hardware_control/types.py +++ b/api/src/opentrons/hardware_control/types.py @@ -638,7 +638,6 @@ class HardwareFeatureFlags: use_old_aspiration_functions: bool = ( False # To support pipette backwards compatability ) - tip_presence_detection_enabled: bool = True require_estop: bool = True stall_detection_enabled: bool = True overpressure_detection_enabled: bool = True @@ -654,7 +653,6 @@ def build_from_ff(cls) -> "HardwareFeatureFlags": """ return HardwareFeatureFlags( use_old_aspiration_functions=feature_flags.use_old_aspiration_functions(), - tip_presence_detection_enabled=feature_flags.tip_presence_detection_enabled(), require_estop=feature_flags.require_estop(), stall_detection_enabled=feature_flags.stall_detection_enabled(), overpressure_detection_enabled=feature_flags.overpressure_detection_enabled(), diff --git a/api/tests/opentrons/config/test_advanced_settings_migration.py b/api/tests/opentrons/config/test_advanced_settings_migration.py index bcdeff2ee03..14725e94390 100644 --- a/api/tests/opentrons/config/test_advanced_settings_migration.py +++ b/api/tests/opentrons/config/test_advanced_settings_migration.py @@ -7,7 +7,7 @@ @pytest.fixture def migrated_file_version() -> int: - return 29 + return 30 # make sure to set a boolean value in default_file_settings only if @@ -27,7 +27,6 @@ def default_file_settings() -> Dict[str, Any]: "disableStallDetection": None, "disableStatusBar": None, "disableOverpressureDetection": None, - "disableTipPresenceDetection": None, "estopNotRequired": None, } @@ -359,6 +358,13 @@ def v29_config(v28_config: Dict[str, Any]) -> Dict[str, Any]: return r +@pytest.fixture +def v30_config(v29_config: Dict[str, Any]) -> Dict[str, Any]: + r = {k: v for k, v in v29_config.items() if k != "disableTipPresenceDetection"} + r["_version"] = 30 + return r + + @pytest.fixture( scope="session", params=[ @@ -393,6 +399,7 @@ def v29_config(v28_config: Dict[str, Any]) -> Dict[str, Any]: lazy_fixture("v27_config"), lazy_fixture("v28_config"), lazy_fixture("v29_config"), + lazy_fixture("v30_config"), ], ) def old_settings(request: pytest.FixtureRequest) -> Dict[str, Any]: @@ -483,6 +490,5 @@ def test_ensures_config() -> None: "disableStallDetection": None, "disableStatusBar": None, "estopNotRequired": None, - "disableTipPresenceDetection": None, "disableOverpressureDetection": None, }