Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(app, step-generation): visualize the step timeline and deck state of a protocol #15491

Merged
merged 73 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
5e6d034
construct invariant context from runtime commands
b-cooper Jun 9, 2022
66bb15b
start creating timeline from run commands
b-cooper Jun 9, 2022
5cb0f21
organize module state constants
b-cooper Jun 10, 2022
809add2
POC for static deck setup in protocol timeline scrubber component
b-cooper Jun 10, 2022
46a29f3
add slider
b-cooper Jun 10, 2022
758f290
proof of concept with liquid and tip tracking
b-cooper Jun 14, 2022
d9bbfab
add display color and liquid entities
b-cooper Jun 14, 2022
9f2096e
get tip liquid state down to tip side view
b-cooper Jun 19, 2022
61117e7
add longer liquidless protocol example
b-cooper Jun 19, 2022
de26876
alignment and empty state for pipette viz
b-cooper Jun 20, 2022
99f78e2
multi channel support
b-cooper Jun 20, 2022
c474a52
jump to command
b-cooper Jun 20, 2022
930f121
add to new timeline route
b-cooper Jun 20, 2022
40333fa
Merge branch 'edge' into step-generation_get-timeline-from-commands
b-cooper Jul 21, 2022
f628f8e
add support for all commands in step generation as pass through
b-cooper Jul 21, 2022
5088edf
map initial aspirate and dispense commands
b-cooper Jul 21, 2022
2d1bd0a
window timeline scrubber and fix air in tips rendering
b-cooper Jul 21, 2022
26efb76
Merge branch 'edge' into step-generation_get-timeline-from-commands
b-cooper Jul 12, 2023
796abb5
make changes to things that were moved around
b-cooper Jul 12, 2023
e5b9576
begin modernizing scrubber
b-cooper Jul 12, 2023
098f5f0
modernize constants in scrubber
b-cooper Jul 19, 2023
98bcf17
visual adjustment
b-cooper Sep 8, 2023
9b5053c
Merge branch 'chore_release-7.0.0' into step-generation_get-timeline-…
b-cooper Sep 8, 2023
7a50537
update to current values
b-cooper Sep 8, 2023
dd845a8
feat(shared-data): json protocol schema 8
sfoster1 Oct 25, 2023
f248da7
add enum to annotations and structure types for commands etc
b-cooper Oct 25, 2023
d2c84e4
Merge branch 'edge' into step-generation_get-timeline-from-commands
b-cooper Oct 25, 2023
279363c
account for robot type
b-cooper Oct 26, 2023
fecc2ba
fix up ts config for protocol types
b-cooper Oct 26, 2023
2c96e76
Hackishly expose commandAnnotations in protocol analysis output.
SyntaxColoring Oct 17, 2023
57dd41d
command list from annotations
b-cooper Oct 19, 2023
c5b1ae5
prelim collapsible grouping
b-cooper Oct 20, 2023
2de8fc2
positioning of annotated group
b-cooper Oct 23, 2023
60edcc3
fix up type export
b-cooper Oct 26, 2023
644694b
Merge branch 'skunk_v8-command-annotations-in-analysis-output' into s…
b-cooper Oct 26, 2023
f05c50a
annotated steps
b-cooper Oct 26, 2023
cecefec
current parent node treatment
b-cooper Oct 27, 2023
a73f7aa
proof of concept new window
b-cooper Oct 27, 2023
c2e2078
Merge branch 'edge' into skunk_grouped-steps-timeline-scrubber-pd-window
b-cooper Nov 9, 2023
fa84d3d
Merge branch 'edge' into skunk_grouped-steps-timeline-scrubber-pd-window
b-cooper May 2, 2024
d09864e
remote global to pd
b-cooper May 6, 2024
71e0364
add temporary open file action to remove
b-cooper May 7, 2024
cca0b72
remove temporary changes
b-cooper May 7, 2024
288673d
cleanup grouping in annotated steps
b-cooper May 8, 2024
fe792e1
other viz commented out
b-cooper Jun 14, 2024
06d2fc3
Merge branch 'edge' into skunk_grouped-steps-timeline-scrubber-pd-window
b-cooper Jun 21, 2024
bdf5f95
fix up command text in scrubber
b-cooper Jun 21, 2024
363c5cc
remove merge cruft command text utils
b-cooper Jun 21, 2024
3d3da25
remove unnecessary changes
b-cooper Jun 21, 2024
3c6fa17
remove log statements
b-cooper Jun 21, 2024
41cbf02
revert spurious yarn change
b-cooper Jun 21, 2024
ca98807
split out annotation api changes
b-cooper Jun 21, 2024
610b1f9
split out app shell pd changes
b-cooper Jun 21, 2024
5b21330
remove unnecessary lint warning fix
b-cooper Jun 21, 2024
f9a2d48
remove pd changes
b-cooper Jun 21, 2024
0344070
remove last of unrelated code
b-cooper Jun 21, 2024
0604088
feat(app): visualize the step timeline and deck state of a protocol
b-cooper Jun 21, 2024
6eb6e96
Merge branch 'edge' into skunk_grouped-steps-timeline-scrubber-pd-window
jerader Jun 24, 2024
9876f87
begin to fix check errors and clean up
jerader Jun 24, 2024
fdb87c4
delete unused fixtures
jerader Jun 24, 2024
454f109
clean up step-generation tests
jerader Jun 25, 2024
1df838a
Merge branch 'edge' into skunk_grouped-steps-timeline-scrubber-pd-window
jerader Jun 26, 2024
8b35d5c
clean up more
jerader Jun 26, 2024
c353cac
remove some more unnecessary file changes
jerader Jun 26, 2024
a05004d
fix labware on adapter and add play button
jerader Jun 26, 2024
29a62f4
clean up lint
jerader Jun 26, 2024
956ec61
support for updating liquidState
jerader Jun 26, 2024
599a996
add comment support
jerader Jul 1, 2024
3af2e44
address feedbacl
jerader Jul 1, 2024
2c84516
add test to desktopApp
jerader Jul 1, 2024
68fa459
change size of deck map
jerader Jul 1, 2024
de5610c
address more feedback and fix the error in console
jerader Jul 1, 2024
13127bd
fix lint
jerader Jul 1, 2024
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
Prev Previous commit
Next Next commit
Hackishly expose commandAnnotations in protocol analysis output.
  • Loading branch information
SyntaxColoring authored and b-cooper committed Oct 26, 2023
commit 2c96e76edfab58d8ac53507852a74c1faa04cba8
2 changes: 2 additions & 0 deletions api/src/opentrons/cli/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ async def _analyze(
pipettes=analysis.state_summary.pipettes,
modules=analysis.state_summary.modules,
liquids=analysis.state_summary.liquids,
commandAnnotations=protocol_source.command_annotations,
)

await json_output.write_text(
Expand Down Expand Up @@ -156,3 +157,4 @@ class AnalyzeResults(BaseModel):
modules: List[LoadedModule]
liquids: List[Liquid]
errors: List[ErrorOccurrence]
commandAnnotations: List[Any]
12 changes: 11 additions & 1 deletion api/src/opentrons/protocol_reader/file_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import json
from dataclasses import dataclass
from typing import Any, Dict, Sequence, Union
from typing import Any, Dict, List, Sequence, Union

import anyio

Expand Down Expand Up @@ -44,6 +44,8 @@ class IdentifiedJsonMain:
metadata: Metadata
"""The protocol metadata extracted from this file."""

command_annotations: List[Any]


@dataclass(frozen=True)
class IdentifiedPythonMain:
Expand All @@ -61,6 +63,8 @@ class IdentifiedPythonMain:
metadata: Metadata
"""The protocol metadata extracted from this file."""

command_annotations: List[Any]


@dataclass(frozen=True)
class IdentifiedLabwareDefinition:
Expand Down Expand Up @@ -181,6 +185,7 @@ def _analyze_json_protocol(
metadata = json_contents["metadata"]
schema_version = json_contents["schemaVersion"]
robot_type = json_contents["robot"]["model"]
command_annotations = json_contents.get("commandAnnotations", [])
except KeyError as e:
raise FileIdentificationError(error_message) from e

Expand All @@ -190,6 +195,9 @@ def _analyze_json_protocol(
if not isinstance(metadata, dict):
raise FileIdentificationError(error_message)

if not isinstance(command_annotations, list):
raise FileIdentificationError(error_message)

if not isinstance(schema_version, int):
raise FileIdentificationError(error_message)

Expand All @@ -202,6 +210,7 @@ def _analyze_json_protocol(
schema_version=schema_version,
robot_type=robot_type,
metadata=metadata,
command_annotations=command_annotations,
)


Expand Down Expand Up @@ -235,4 +244,5 @@ def _analyze_python_protocol(
metadata=parsed.metadata or {},
robot_type=parsed.robot_type,
api_level=parsed.api_level,
command_annotations=[],
)
2 changes: 2 additions & 0 deletions api/src/opentrons/protocol_reader/protocol_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ async def save(
config=self._map_config(role_analysis),
robot_type=role_analysis.main_file.robot_type,
metadata=role_analysis.main_file.metadata,
command_annotations=role_analysis.main_file.command_annotations,
)

async def read_saved(
Expand Down Expand Up @@ -164,6 +165,7 @@ async def read_saved(
config=self._map_config(role_analysis),
robot_type=role_analysis.main_file.robot_type,
metadata=role_analysis.main_file.metadata,
command_annotations=role_analysis.main_file.command_annotations,
)

@staticmethod
Expand Down
1 change: 1 addition & 0 deletions api/src/opentrons/protocol_reader/protocol_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,4 @@ class ProtocolSource:
metadata: Metadata
robot_type: RobotType
config: ProtocolConfig
command_annotations: List[Any]
3 changes: 2 additions & 1 deletion robot-server/robot_server/protocols/analysis_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# TODO(mc, 2021-08-25): add modules to simulation result
from enum import Enum
from pydantic import BaseModel, Field
from typing import List, Union
from typing import Any, List, Union
from typing_extensions import Literal

from opentrons.protocol_engine import (
Expand Down Expand Up @@ -118,6 +118,7 @@ class CompletedAnalysis(BaseModel):
default_factory=list,
description="Liquids used by the protocol",
)
commandAnnotations: List[Any] = Field(default_factory=list)


ProtocolAnalysis = Union[PendingAnalysis, CompletedAnalysis]
4 changes: 3 additions & 1 deletion robot-server/robot_server/protocols/analysis_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


from logging import getLogger
from typing import Dict, List, Optional
from typing import Any, Dict, List, Optional
from typing_extensions import Final

import sqlalchemy
Expand Down Expand Up @@ -126,6 +126,7 @@ async def update(
pipettes: List[LoadedPipette],
errors: List[ErrorOccurrence],
liquids: List[Liquid],
command_annotations: List[Any],
) -> None:
"""Promote a pending analysis to completed, adding details of its results.

Expand Down Expand Up @@ -162,6 +163,7 @@ async def update(
pipettes=pipettes,
errors=errors,
liquids=liquids,
commandAnnotations=command_annotations,
)
completed_analysis_resource = CompletedAnalysisResource(
id=completed_analysis.id,
Expand Down
1 change: 1 addition & 0 deletions robot-server/robot_server/protocols/protocol_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ async def analyze(
pipettes=result.state_summary.pipettes,
errors=result.state_summary.errors,
liquids=result.state_summary.liquids,
command_annotations=protocol_resource.source.command_annotations,
)