Skip to content

Commit

Permalink
fix(api): remove tip presence feature flag (#14362)
Browse files Browse the repository at this point in the history
It does not do anything, so this removes it.

Closes RQA-2131
  • Loading branch information
sfoster1 authored Jan 26, 2024
1 parent a368abc commit ec3c749
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
15 changes: 9 additions & 6 deletions api/src/opentrons/config/advanced_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions api/src/opentrons/config/feature_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 0 additions & 2 deletions api/src/opentrons/hardware_control/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(),
Expand Down
12 changes: 9 additions & 3 deletions api/tests/opentrons/config/test_advanced_settings_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -27,7 +27,6 @@ def default_file_settings() -> Dict[str, Any]:
"disableStallDetection": None,
"disableStatusBar": None,
"disableOverpressureDetection": None,
"disableTipPresenceDetection": None,
"estopNotRequired": None,
}

Expand Down Expand Up @@ -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=[
Expand Down Expand Up @@ -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]:
Expand Down Expand Up @@ -483,6 +490,5 @@ def test_ensures_config() -> None:
"disableStallDetection": None,
"disableStatusBar": None,
"estopNotRequired": None,
"disableTipPresenceDetection": None,
"disableOverpressureDetection": None,
}

0 comments on commit ec3c749

Please sign in to comment.