Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
64a8de1
add place tipracks step and stubbing mechanism
b-cooper Apr 6, 2020
3cbb2db
refactor(app): add tiprack setup prompt to robot calibration check flow
b-cooper Apr 6, 2020
9c326d1
remove unnecessary spacing diff
b-cooper Apr 6, 2020
9481ca6
little lint
b-cooper Apr 7, 2020
61c3970
revert stubs
b-cooper Apr 8, 2020
35a5814
unstyled full flow
b-cooper Apr 7, 2020
a5fbba8
build up update session
b-cooper Apr 9, 2020
f4b6ab8
add to cal action type
b-cooper Apr 13, 2020
a2b3b9d
test fetch epic
b-cooper Apr 21, 2020
03603b3
update epic test with first action
b-cooper Apr 21, 2020
8407928
handle update with params passed
b-cooper Apr 21, 2020
e29982c
add shim current step
b-cooper Apr 21, 2020
0ecdde0
fix up tests and add temporary step shimmer
b-cooper Apr 21, 2020
166f9c1
wire up shim a bit more
b-cooper Apr 22, 2020
e881f33
prepare pipette
b-cooper Apr 22, 2020
224050a
bit of lint
b-cooper Apr 22, 2020
2d644c3
wire jog up
b-cooper Apr 22, 2020
c4342b2
jog sending correct vector values
b-cooper Apr 22, 2020
6b94b71
add img assets
b-cooper Apr 23, 2020
bac5c08
assets and styling for jog to tiprack
b-cooper Apr 23, 2020
3377760
wire up inspecting tip
b-cooper Apr 23, 2020
89ae13f
add domain layer for confirm and invalidate tip
b-cooper Apr 23, 2020
58c582f
style confirm tip attached propmt
b-cooper Apr 23, 2020
57c9407
check x and y with parameterized jog controls
b-cooper Apr 23, 2020
e6415ed
imprt video assets
b-cooper Apr 23, 2020
d5dc456
ensure jog label logic
b-cooper Apr 23, 2020
337f229
move to point webm in place
b-cooper Apr 23, 2020
f91525c
connect confirm step
b-cooper Apr 24, 2020
fd7293a
make sure video updates
b-cooper Apr 24, 2020
41117e6
add check height
b-cooper Apr 24, 2020
a955f84
placeholder spinner
b-cooper Apr 24, 2020
b0e9e64
remove temporary shim for state update
b-cooper Apr 24, 2020
13d413f
hide controls on video demos
b-cooper Apr 24, 2020
86a891d
update all video assets and replace gifs with webm
b-cooper Apr 24, 2020
8d92d25
clean up lint
b-cooper Apr 24, 2020
5d44112
button up flow errors
b-cooper Apr 24, 2020
eebace9
bit of lint
b-cooper Apr 24, 2020
471192c
tests for tip pick up component
b-cooper Apr 24, 2020
fcf8d19
test Check xy point component
b-cooper Apr 24, 2020
8625896
test check height component
b-cooper Apr 24, 2020
e2d3395
add tests for fetch and update actions
b-cooper Apr 24, 2020
51ee0ec
test all actions
b-cooper Apr 24, 2020
ed9fe5a
update deck setup test
b-cooper Apr 27, 2020
e25efbe
update index component test
b-cooper Apr 27, 2020
02b9924
add provider to connected component test
b-cooper Apr 27, 2020
9610ca4
test all session update epic actions
b-cooper Apr 27, 2020
b0ad546
refactor(app): add load labware, deck setup, tip pick up, point check…
b-cooper Apr 27, 2020
e2e01db
remove a little lint
b-cooper Apr 27, 2020
0c53885
delint css
b-cooper Apr 28, 2020
21cc13c
capital U
b-cooper Apr 28, 2020
2b58df2
address a couple of pr comments
b-cooper Apr 29, 2020
4d33c76
use robot api epic test utils for fetch
b-cooper Apr 29, 2020
cacbc31
address mike pr comments
b-cooper Apr 29, 2020
820a04f
old friend Mu
b-cooper Apr 29, 2020
5788774
add todo
b-cooper Apr 29, 2020
286ccb1
explicit null return in default case
b-cooper Apr 29, 2020
b19edb4
remove old test cruft
b-cooper Apr 29, 2020
31844dc
actually check request and not whole tuple
b-cooper Apr 30, 2020
61fd9fe
1mm jog step instead of 2mm
b-cooper Apr 30, 2020
2f862fc
refactor(protocol-designer): Update announcement and export modal tex…
Kadee80 Apr 23, 2020
9569e02
fix(api): Load the correct gantry calibration upon deck calibration e…
Laura-Danielle Apr 24, 2020
7c5287a
refactor(api): Remove diagonal movement from touch tip (#5470)
Laura-Danielle Apr 24, 2020
d2d3f70
chore(release): 3.17.0 (#5476)
sfoster1 Apr 23, 2020
f9dad4b
refactor(api): Move to the specified height offset in touch tip befor…
Laura-Danielle Apr 24, 2020
72f5a86
chore(api): add support for multi v2.1 (#5484)
sfoster1 Apr 24, 2020
a8a2c5b
feat(robot-server, api): calibration check overhaul (#5465)
Apr 24, 2020
094f758
refactor(protocol-designer): Update tooltip logic for transfer ingred…
Kadee80 Apr 24, 2020
99d22dc
refactor(protocol-designer): Update tooltip logic for ChangeTipOption…
Kadee80 Apr 24, 2020
0514335
docs(api): Add in information about touch tip and api 2.4 to docs (#5…
Laura-Danielle Apr 24, 2020
7b43e1a
chore(protocol-designer): bump PD version to 4.0.1 (#5495)
IanLondon Apr 27, 2020
9f4424b
refactor(api): Avoid collisions with modules during touch tip (#5485)
Laura-Danielle Apr 28, 2020
ddff0a3
refactor(app): Collect system USB information (#5482)
mcous Apr 28, 2020
5fe8690
feat(shared-data): add nest_96_wellplate_2ml_deep (#5503)
sfoster1 Apr 28, 2020
3f277bf
feat(api): Allow Non-Full plate Thermocycler Configuration (#5498)
Laura-Danielle Apr 28, 2020
dc602ca
refactor(protocol-designer): Update ModuleRow tooltip and tests (#5492)
Kadee80 Apr 29, 2020
23c24e5
refactor(app): add Network & System page with U2E adapter info (#5508)
mcous Apr 29, 2020
7055d30
refactor(protocol-designer): refactor edit modules modal (#5445)
shlokamin Apr 30, 2020
8c95894
add point comparison for tip pick up
b-cooper Apr 30, 2020
c8bb909
working tip pick up bailout
b-cooper Apr 30, 2020
cfcb70e
load second pip tiprack
b-cooper May 1, 2020
a451d7e
session states added, need to reflect in middleware up
b-cooper May 1, 2020
199fd5c
separate out pipette move funcs
b-cooper May 4, 2020
9cc7083
pick up tip for pipette
b-cooper May 4, 2020
a53066b
trash tip over return tip
b-cooper May 4, 2020
d0d4d57
happy path through both pipettes working, need to unit test new states
b-cooper May 5, 2020
a791bc1
add format comparisons method
b-cooper May 5, 2020
e6ad8b9
comparisons by step in session status
b-cooper May 5, 2020
03fcab9
unit tests for session through happy path for both mounts and only left
b-cooper May 5, 2020
bc5532f
test jogs to identity states
b-cooper May 5, 2020
9c5255f
de lint py
b-cooper May 5, 2020
b9edd76
update check calibration index component test
b-cooper May 5, 2020
01853bb
clean up flow errors
b-cooper May 5, 2020
a66763f
update check step component tests
b-cooper May 5, 2020
0063c92
merge edge in
b-cooper May 6, 2020
3980722
refactor(app,api): add comparison states support for both mounts in c…
b-cooper May 6, 2020
597e036
indentation
b-cooper May 6, 2020
a50eaa7
get pip_vol back
b-cooper May 6, 2020
4253edb
pip info by id in place of relate mount
b-cooper May 6, 2020
8c4d85f
reinsert critical point change
b-cooper May 6, 2020
ee53349
attempt to get integration test patched
b-cooper May 6, 2020
e8e12f1
update integration test bits
b-cooper May 6, 2020
65a05d6
fix tiprack sharing
b-cooper May 6, 2020
868a58d
address pr comments, compare magnitudes vs vectors
b-cooper May 6, 2020
cb21123
import star for states
b-cooper May 6, 2020
1b11677
pull out step to slot mapping into helper func
b-cooper May 6, 2020
fa7f006
import typeof for step constant
b-cooper May 6, 2020
25068e8
de lint
b-cooper May 6, 2020
2f6fb4c
iron out merge conflicts from amit's changes
b-cooper May 6, 2020
5df7f35
wire comparisons by step to fast api and add mount to instr
b-cooper May 6, 2020
65747dc
re import axis type
b-cooper May 6, 2020
d13ed34
add float equality for point
b-cooper May 6, 2020
cc184fd
test pick up tip
b-cooper May 6, 2020
a40f2ce
unit test for invalidate tip
b-cooper May 6, 2020
a56c21e
unit test for check complete
b-cooper May 6, 2020
7ddc676
remove deprecated test
b-cooper May 6, 2020
d26729a
remove deprecated integration test
b-cooper May 6, 2020
3f4f2bc
clean up magnitude handling
b-cooper May 6, 2020
d065f3f
fix type of session commands
b-cooper May 6, 2020
7068994
load tipracks by mount
b-cooper May 7, 2020
a535660
patch lint
b-cooper May 7, 2020
c0d26f0
fix broken session status test
b-cooper May 7, 2020
a1207e9
bit more lint
b-cooper May 7, 2020
fd42481
patch up router test_session
b-cooper May 7, 2020
de2a9c3
use all to iter pairs in Point __eq__
b-cooper May 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 11 additions & 34 deletions api/src/opentrons/server/endpoints/calibration/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from opentrons import types
from .session import CheckCalibrationSession, CalibrationCheckTrigger
from .models import SpecificPipette, JogPosition
from .models import JogPosition


async def get_session(request: web.Request, session) -> web.Response:
Expand Down Expand Up @@ -64,66 +64,43 @@ async def load_labware(request: web.Request, session) -> web.Response:
return web.json_response(status=200)


# TODO: BC: make this function use SpecificPipette, as it
# shouldn't need locations
async def prepare_pipette(request: web.Request, session) -> web.Response:
req = await request.json()
pipette = SpecificPipette(**req)
await session.trigger_transition(CalibrationCheckTrigger.prepare_pipette,
pipette_id=pipette.pipetteId)
await session.trigger_transition(CalibrationCheckTrigger.prepare_pipette)
return web.json_response(status=200)


async def compare_point(request: web.Request, session) -> web.Response:
await session.trigger_transition(CalibrationCheckTrigger.compare_point)
return web.json_response(status=200)


async def confirm_step(request: web.Request, session) -> web.Response:
req = await request.json()
pipette = SpecificPipette(**req)
await session.trigger_transition(CalibrationCheckTrigger.confirm_step,
pipette_id=pipette.pipetteId)
await session.trigger_transition(CalibrationCheckTrigger.go_to_next_check)
return web.json_response(status=200)


async def jog(request: web.Request, session: 'CheckCalibrationSession'):
req = await request.json()
jog_position = JogPosition(**req)
await session.trigger_transition(CalibrationCheckTrigger.jog,
jog_position.pipetteId,
types.Point(*jog_position.vector))
return web.json_response(status=200)


async def pick_up_tip(
request: web.Request, session: 'CheckCalibrationSession'):
req = await request.json()
pipette = SpecificPipette(**req)
await session.trigger_transition(CalibrationCheckTrigger.pick_up_tip,
pipette.pipetteId)
await session.trigger_transition(CalibrationCheckTrigger.pick_up_tip)
return web.json_response(status=200)


async def invalidate_tip(
request: web.Request, session: 'CheckCalibrationSession'):
req = await request.json()
pipette = SpecificPipette(**req)
await session.trigger_transition(CalibrationCheckTrigger.invalidate_tip,
pipette.pipetteId)
await session.trigger_transition(CalibrationCheckTrigger.invalidate_tip)
return web.json_response(status=200)


async def confirm_tip(
request: web.Request, session: 'CheckCalibrationSession'):
req = await request.json()
pipette = SpecificPipette(**req)
await session.trigger_transition(
CalibrationCheckTrigger.confirm_tip_attached,
pipette.pipetteId)
CalibrationCheckTrigger.confirm_tip_attached)
return web.json_response(status=200)


# TODO: cover confirm last step for pipette which should
# result in return tip under the hood
# async def confirm_step(request: web.Request,
# session: 'CheckCalibrationSession'):
# req = await request.json()
# pipette = SpecificPipette(**req)
# await session.confirm_step(pipette.pipetteId)
# return web.json_response(status=200)
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import typing
import logging
from aiohttp import web
from aiohttp.web_urldispatcher import UrlDispatcher
from .session import CheckCalibrationSession, CalibrationCheckTrigger, \
Expand All @@ -7,6 +8,7 @@
from .constants import ALLOWED_SESSIONS
from .util import StateMachineError

MODULE_LOG = logging.getLogger(__name__)

TRIGGER_TO_PATH = {
CalibrationCheckTrigger.load_labware: "loadLabware",
Expand All @@ -15,7 +17,8 @@
CalibrationCheckTrigger.pick_up_tip: "pickUpTip",
CalibrationCheckTrigger.confirm_tip_attached: "confirmTip",
CalibrationCheckTrigger.invalidate_tip: "invalidateTip",
CalibrationCheckTrigger.confirm_step: "confirmStep",
CalibrationCheckTrigger.compare_point: "comparePoint",
CalibrationCheckTrigger.go_to_next_check: "confirmStep",
CalibrationCheckTrigger.exit: "sessionExit",
# CalibrationCheckTrigger.reject_calibration: "reject_calibration",
# CalibrationCheckTrigger.no_pipettes: "no_pipettes",
Expand Down Expand Up @@ -53,11 +56,13 @@ def status_response(
links = _format_links(session, potential_triggers, request.app.router)

lw_status = session.labware_status.values()
comparisons_by_step = session.get_comparisons_by_step()

instruments = {
str(k): AttachedPipette(model=v.model,
name=v.name,
tip_length=v.tip_length,
mount=v.mount,
has_tip=v.has_tip,
tiprack_id=v.tiprack_id)
for k, v in session.pipette_status().items()
Expand All @@ -66,6 +71,7 @@ def status_response(
sess_status = CalibrationSessionStatus(
instruments=instruments,
currentStep=current_state,
comparisonsByStep=comparisons_by_step,
nextSteps=links,
labware=[LabwareStatus(alternatives=data.alternatives,
slot=data.slot,
Expand Down Expand Up @@ -95,6 +101,7 @@ async def misc_error_handling(
try:
response = await handler(request, session)
except (CalibrationException, StateMachineError) as e:
MODULE_LOG.exception("Calibration Check Exception")
router = request.app.router
potential_triggers = session.get_potential_triggers()
links = _format_links(session, potential_triggers, router)
Expand Down
34 changes: 23 additions & 11 deletions api/src/opentrons/server/endpoints/calibration/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Dict, Optional, List, Any
from functools import partial
from pydantic import BaseModel, Field
from opentrons.hardware_control.types import Axis
from opentrons.types import Mount


Point = List[float]
Expand All @@ -28,7 +28,7 @@ class SpecificPipette(BaseModel):
pipetteId: Optional[UUID] = Field(None)


class JogPosition(SpecificPipette):
class JogPosition(BaseModel):
vector: Point = PointField()


Expand All @@ -44,10 +44,8 @@ class AttachedPipette(BaseModel):
"generation version")
tip_length: Optional[float] =\
Field(None, description="The default tip length for this pipette")
mount_axis: Optional[Axis] =\
Field(None, description="The axis that moves this pipette up and down")
plunger_axis: Optional[Axis] =\
Field(None, description="The axis that moves plunger of this pipette")
mount: Optional[Mount] =\
Field(None, description="The mount this pipette attached to")
has_tip: Optional[bool] =\
Field(None, description="Whether a tip is attached.")
tiprack_id: Optional[UUID] =\
Expand All @@ -65,10 +63,20 @@ class LabwareStatus(BaseModel):
version: str


class ComparisonStatus(BaseModel):
"""
A model describing the comparison of a checked point to calibrated value
"""
differenceVector: Point = PointField()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we put the threshold in here too?

thresholdVector: Point = PointField()
exceedsThreshold: bool


class CalibrationSessionStatus(BaseModel):
"""The current status of a given session."""
instruments: Dict[str, AttachedPipette]
currentStep: str = Field(..., description="Current step of session")
comparisonsByStep: Dict[str, ComparisonStatus]
nextSteps: Optional[Dict[str, Dict[str, Dict[str, Any]]]] =\
Field(None, description="Next Available Step in Session")
labware: List[LabwareStatus]
Expand All @@ -82,20 +90,24 @@ class Config:
"model": "p300_single_v1.5",
"name": "p300_single",
"tip_length": 51.7,
"mount_axis": "z",
"plunger_axis": "b",
"mount": "left",
"id": "P3HS12123041"
},
"fakeUUID2": {
"model": None,
"name": None,
"tip_length": None,
"mount_axis": "a",
"plunger_axis": "c",
"mount": "right",
"id": None
}
},
"currentStep": "sessionStart",
"currentStep": "sessionStarted",
"comparisonsByStep": {
"comparingFirstPipetteHeight": {
"differenceVector": [1, 0, 0],
"exceedsThreshold": False
}
},
"nextSteps": {
"links": {
"loadLabware": {"url": "", "params": {}}
Expand Down
Loading