Skip to content

Commit

Permalink
remove ht from name
Browse files Browse the repository at this point in the history
  • Loading branch information
caila-marashaj committed Apr 23, 2024
1 parent 16e0eb0 commit 7190114
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 30 deletions.
4 changes: 2 additions & 2 deletions api/src/opentrons/hardware_control/backends/ot3controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1524,10 +1524,10 @@ async def teardown_tip_detector(self, mount: OT3Mount) -> None:
async def get_tip_status(
self,
mount: OT3Mount,
ht_follow_singular_sensor: Optional[InstrumentProbeType] = None,
follow_singular_sensor: Optional[InstrumentProbeType] = None,
) -> TipStateType:
return await self.tip_presence_manager.get_tip_status(
mount, ht_follow_singular_sensor
mount, follow_singular_sensor
)

def current_tip_state(self, mount: OT3Mount) -> Optional[bool]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ def subsystems(self) -> Dict[SubSystem, SubSystemState]:
async def get_tip_status(
self,
mount: OT3Mount,
ht_follow_singular_sensor: Optional[InstrumentProbeType] = None,
follow_singular_sensor: Optional[InstrumentProbeType] = None,
) -> TipStateType:
return TipStateType(self._sim_tip_state[mount])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,21 @@ def current_tip_state(self, mount: OT3Mount) -> Optional[bool]:
@staticmethod
def _get_tip_presence(
results: List[tip_types.TipNotification],
ht_follow_singular_sensor: Optional[InstrumentProbeType] = None,
follow_singular_sensor: Optional[InstrumentProbeType] = None,
) -> TipStateType:
"""
We can use ht_follow_singular_sensor used to specify that we only care
We can use follow_singular_sensor used to specify that we only care
about the status of one tip presence sensor on a high throughput
pipette, and the other is allowed to be different.
"""
if ht_follow_singular_sensor:
target_sensor_id = sensor_id_for_instrument(ht_follow_singular_sensor)
if follow_singular_sensor:
target_sensor_id = sensor_id_for_instrument(follow_singular_sensor)
for r in results:
if r.sensor == target_sensor_id:
return TipStateType(r.presence)
# raise an error if requested sensor response isn't found
raise GeneralError(
message=f"Requested status for sensor {ht_follow_singular_sensor} not found."
message=f"Requested status for sensor {follow_singular_sensor} not found."
)
# more than one sensor reported, we have to check if their states match
if len(set(r.presence for r in results)) > 1:
Expand All @@ -142,11 +142,11 @@ def _get_tip_presence(
async def get_tip_status(
self,
mount: OT3Mount,
ht_follow_singular_sensor: Optional[InstrumentProbeType] = None,
follow_singular_sensor: Optional[InstrumentProbeType] = None,
) -> TipStateType:
detector = self.get_detector(mount)
return self._get_tip_presence(
await detector.request_tip_status(), ht_follow_singular_sensor
await detector.request_tip_status(), follow_singular_sensor
)

def get_detector(self, mount: OT3Mount) -> TipDetector:
Expand Down
10 changes: 4 additions & 6 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2072,7 +2072,7 @@ async def _high_throughput_check_tip(self) -> AsyncIterator[None]:
async def get_tip_presence_status(
self,
mount: Union[top_types.Mount, OT3Mount],
ht_follow_singular_sensor: Optional[InstrumentProbeType] = None,
follow_singular_sensor: Optional[InstrumentProbeType] = None,
) -> TipStateType:
"""
Check tip presence status. If a high throughput pipette is present,
Expand All @@ -2087,20 +2087,18 @@ async def get_tip_presence_status(
):
await stack.enter_async_context(self._high_throughput_check_tip())
result = await self._backend.get_tip_status(
real_mount, ht_follow_singular_sensor
real_mount, follow_singular_sensor
)
return result

async def verify_tip_presence(
self,
mount: Union[top_types.Mount, OT3Mount],
expected: TipStateType,
ht_follow_singular_sensor: Optional[InstrumentProbeType] = None,
follow_singular_sensor: Optional[InstrumentProbeType] = None,
) -> None:
real_mount = OT3Mount.from_mount(mount)
status = await self.get_tip_presence_status(
real_mount, ht_follow_singular_sensor
)
status = await self.get_tip_presence_status(real_mount, follow_singular_sensor)
if status != expected:
raise FailedTipStateCheck(expected, status.value)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def verify_tip_presence(
self,
mount: MountArgType,
expected: TipStateType,
ht_follow_singular_sensor: Optional[InstrumentProbeType] = None,
follow_singular_sensor: Optional[InstrumentProbeType] = None,
) -> None:
"""Check tip presence status and raise if it does not match `expected`."""
...
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class VerifyTipPresenceParams(PipetteIdMixin):
expectedState: TipPresenceStatus = Field(
..., description="The expected tip presence status on the pipette."
)
htFollowSingularSensor: Optional[InstrumentSensorId] = Field(
FollowSingularSensor: Optional[InstrumentSensorId] = Field(
default=None, description="The sensor id to follow if the other can be ignored."
)

Expand All @@ -50,16 +50,16 @@ async def execute(self, params: VerifyTipPresenceParams) -> VerifyTipPresenceRes
"""Verify if tip presence is as expected for the requested pipette."""
pipette_id = params.pipetteId
expected_state = params.expectedState
ht_follow_singular_sensor = (
InstrumentSensorId.to_instrument_probe_type(params.htFollowSingularSensor)
if params.htFollowSingularSensor
follow_singular_sensor = (
InstrumentSensorId.to_instrument_probe_type(params.FollowSingularSensor)
if params.FollowSingularSensor
else None
)

await self._tip_handler.verify_tip_presence(
pipette_id=pipette_id,
expected=expected_state,
ht_follow_singular_sensor=ht_follow_singular_sensor,
follow_singular_sensor=follow_singular_sensor,
)

return VerifyTipPresenceResult()
Expand Down
8 changes: 4 additions & 4 deletions api/src/opentrons/protocol_engine/execution/tip_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async def verify_tip_presence(
self,
pipette_id: str,
expected: TipPresenceStatus,
ht_follow_singular_sensor: Optional[InstrumentProbeType] = None,
follow_singular_sensor: Optional[InstrumentProbeType] = None,
) -> None:
"""Verify the expected tip presence status."""

Expand Down Expand Up @@ -243,7 +243,7 @@ async def verify_tip_presence(
self,
pipette_id: str,
expected: TipPresenceStatus,
ht_follow_singular_sensor: Optional[InstrumentProbeType] = None,
follow_singular_sensor: Optional[InstrumentProbeType] = None,
) -> None:
"""Verify the expecterd tip presence status of the pipette.
Expand All @@ -254,7 +254,7 @@ async def verify_tip_presence(
ot3api = ensure_ot3_hardware(hardware_api=self._hardware_api)
hw_mount = self._state_view.pipettes.get_mount(pipette_id).to_hw_mount()
await ot3api.verify_tip_presence(
hw_mount, expected.to_hw_state(), ht_follow_singular_sensor
hw_mount, expected.to_hw_state(), follow_singular_sensor
)
except HardwareNotSupportedError:
# Tip presence sensing is not supported on the OT2
Expand Down Expand Up @@ -343,7 +343,7 @@ async def verify_tip_presence(
self,
pipette_id: str,
expected: TipPresenceStatus,
ht_follow_singular_sensor: Optional[InstrumentProbeType] = None,
follow_singular_sensor: Optional[InstrumentProbeType] = None,
) -> None:
"""Verify tip presence.
Expand Down
2 changes: 1 addition & 1 deletion app/src/organisms/LabwarePositionCheck/AttachProbe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const AttachProbe = (props: AttachProbeProps): JSX.Element | null => {
const verifyCommands: CreateCommand[] = [
{
commandType: 'verifyTipPresence',
params: { pipetteId: pipetteId, expectedState: 'present', htFollowSingularSensor: 'primary' },
params: { pipetteId: pipetteId, expectedState: 'present', FollowSingularSensor: 'primary' },
},
]
const homeCommands: CreateCommand[] = [
Expand Down
2 changes: 1 addition & 1 deletion app/src/organisms/PipetteWizardFlows/AttachProbe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const AttachProbe = (props: AttachProbeProps): JSX.Element | null => {
const verifyCommands: CreateCommand[] = [
{
commandType: 'verifyTipPresence',
params: { pipetteId: pipetteId, expectedState: 'present', htFollowSingularSensor: 'primary' },
params: { pipetteId: pipetteId, expectedState: 'present', FollowSingularSensor: 'primary' },
},
]
const homeCommands: CreateCommand[] = [
Expand Down
2 changes: 1 addition & 1 deletion shared-data/command/schemas/8.json
Original file line number Diff line number Diff line change
Expand Up @@ -2600,7 +2600,7 @@
}
]
},
"htFollowSingularSensor": {
"FollowSingularSensor": {
"description": "Which high throughput sensor to use, if we're indifferent to the other.",
"allOf": [
{
Expand Down
2 changes: 1 addition & 1 deletion shared-data/command/types/pipetting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ interface WellLocationParam {

interface VerifyTipPresenceParams extends PipetteIdentityParams {
expectedState?: 'present' | 'absent'
htFollowSingularSensor?: 'primary' | 'secondary'
FollowSingularSensor?: 'primary' | 'secondary'
}

interface BasicLiquidHandlingResult {
Expand Down

0 comments on commit 7190114

Please sign in to comment.