Skip to content

Commit

Permalink
docs(api,robot-server): Document errors list as having no more than 1…
Browse files Browse the repository at this point in the history
… element (#13191)
  • Loading branch information
SyntaxColoring authored Jul 31, 2023
1 parent 67fe75d commit 8a947dd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
5 changes: 4 additions & 1 deletion api/src/opentrons/cli/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ class PythonConfig(BaseModel):


class AnalyzeResults(BaseModel):
"""Results of a protocol analysis."""
"""Results of a protocol analysis.
See robot-server's analysis models for field documentation.
"""

createdAt: datetime
files: List[ProtocolFile]
Expand Down
2 changes: 2 additions & 0 deletions api/src/opentrons/protocol_engine/state/state_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class StateSummary(BaseModel):
"""Data from a protocol run."""

status: EngineStatus
# errors is a list for historical reasons. (This model needs to stay compatible with
# robot-server's database.) It shouldn't have more than 1 element.
errors: List[ErrorOccurrence]
labware: List[LoadedLabware]
pipettes: List[LoadedPipette]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ class MaintenanceRun(ResourceModel):
)
errors: List[ErrorOccurrence] = Field(
...,
description="Any errors that have occurred during the run.",
description=(
"The run's fatal error, if there was one."
" For historical reasons, this is an array,"
" but it won't have more than one element."
),
)
pipettes: List[LoadedPipette] = Field(
...,
Expand Down
6 changes: 5 additions & 1 deletion robot-server/robot_server/protocols/analysis_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ class CompletedAnalysis(BaseModel):
)
errors: List[ErrorOccurrence] = Field(
...,
description="Any errors the protocol run produced",
description=(
"The protocol's fatal error, if there was one."
" For historical reasons, this is an array,"
" but it won't have more than one element."
),
)
liquids: List[Liquid] = Field(
default_factory=list,
Expand Down
6 changes: 5 additions & 1 deletion robot-server/robot_server/runs/run_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ class Run(ResourceModel):
)
errors: List[ErrorOccurrence] = Field(
...,
description="Any errors that have occurred during the run.",
description=(
"The run's fatal error, if there was one."
" For historical reasons, this is an array,"
" but it won't have more than one element."
),
)
pipettes: List[LoadedPipette] = Field(
...,
Expand Down

0 comments on commit 8a947dd

Please sign in to comment.