Skip to content

Commit

Permalink
Add required docstrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed Nov 17, 2023
1 parent bb3157f commit 94ffd09
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
22 changes: 13 additions & 9 deletions robot-server/robot_server/deck_configuration/defaults.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
"""Default deck configurations.
"""Default deck configurations."""

When a user has not yet said which fixtures (standard slots, expansion slots, etc.) are on
a robot, the robot will fall back to these.

Protocol analysis should *not* use these. It's supposed to determine the protocol's deck
configuration requirements, instead of assuming some default deck configuration.
"""


from opentrons_shared_data.robot.dev_types import RobotTypeEnum
from . import models


Expand Down Expand Up @@ -97,6 +89,18 @@


def for_deck_definition(deck_definition_name: str) -> models.DeckConfigurationRequest:
"""Return a default configuration for the given deck definition.
When a user has not yet configured which fixtures are on a robot, the robot should fall back to
this for the purposes of running protocols.
Protocol analysis should *not* use this default. Analysis is supposed to *determine* the
protocol's deck configuration requirements, instead of assuming some default.
Params:
deck_definition_name: The name of a deck definition loadable through
`opentrons_shared_data.deck`.
"""
try:
return {
"ot2_standard": _for_ot2,
Expand Down
4 changes: 4 additions & 0 deletions robot-server/tests/deck_configuration/test_defaults.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""Unit tests for robot_server.deck_configuration.defaults."""


from typing_extensions import Final

import pytest
Expand All @@ -16,6 +19,7 @@
"deck_definition_name", deck.list_names(DECK_DEFINITION_VERSION)
)
def test_defaults(deck_definition_name: str) -> None:
"""Make sure there's a valid default for every possible deck definition."""
deck_definition = deck.load(deck_definition_name, DECK_DEFINITION_VERSION)
result = subject.for_deck_definition(deck_definition_name)
assert (
Expand Down

0 comments on commit 94ffd09

Please sign in to comment.