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

docs(api,robot-server): Document errors list as having no more than 1 element #13191

Merged
merged 4 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
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 protocol's fatal error, if there was one."
SyntaxColoring marked this conversation as resolved.
Show resolved Hide resolved
" 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