Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
rev: 0.9.1
hooks:
- id: nbstripout
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.14.5
rev: v0.15.14
hooks:
# Run the linter.
- id: ruff
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/ad-sdl/madsci:latest
FROM ghcr.io/ad-sdl/madsci:v0.8.0

LABEL org.opencontainers.image.source=https://github.com/AD-SDL/pf400_module
LABEL org.opencontainers.image.description="Drivers and REST API's for the PF400 plate handler robots"
Expand All @@ -15,8 +15,8 @@ COPY ./README.md pf400_module/README.md
COPY ./pyproject.toml pf400_module/pyproject.toml

RUN --mount=type=cache,target=/root/.cache \
pip install -e ./pf400_module
uv pip install --python ${MADSCI_VENV}/bin/python -e ./pf400_module

CMD ["python", "pf400_module/scripts/pf400_rest_node.py"]
CMD ["python", "pf400_module/src/pf400_rest_node.py"]

#########################################
111 changes: 100 additions & 11 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ authors = [
{name = "Tobias Ginsburg", email = "tginsburg@anl.gov"},
]
dependencies = [
"madsci-node-module~=0.5.0",
"madsci-node-module~=0.8.0",
"pynput>=1.8.1",
"madsci-client~=0.5.0",
"madsci-common~=0.5.0",
"madsci-client~=0.8.0",
"madsci-common~=0.8.0",
]
requires-python = ">=3.9.1,<3.13"
requires-python = ">=3.10,<3.13"
readme = "README.md"
license = {text = "MIT"}

Expand Down
13 changes: 9 additions & 4 deletions src/pf400_interface/pf400.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,9 +724,11 @@ def remove_lid(
source_plate_rotation: str = "",
target_plate_rotation: str = "",
grab_offset: Optional[float] = None,
approach_height_offset: Optional[float] = None,
source_approach_height_offset: Optional[float] = None,
target_approach_height_offset: Optional[float] = None,
) -> None:
"""Remove the lid from the plate"""

source.representation = copy.deepcopy(source.representation)
source.representation[0] += lid_height

Expand All @@ -738,7 +740,8 @@ def remove_lid(
source_plate_rotation=source_plate_rotation,
target_plate_rotation=target_plate_rotation,
grab_offset=grab_offset,
approach_height_offset=approach_height_offset,
source_approach_height_offset=source_approach_height_offset,
target_approach_height_offset=target_approach_height_offset,
)

def replace_lid(
Expand All @@ -751,7 +754,8 @@ def replace_lid(
source_plate_rotation: str = "",
target_plate_rotation: str = "",
grab_offset: Optional[float] = None,
approach_height_offset: Optional[float] = None,
source_approach_height_offset: Optional[float] = None,
target_approach_height_offset: Optional[float] = None,
) -> None:
"""Replace the lid on the plate"""
target.representation = copy.deepcopy(target.representation)
Expand All @@ -765,7 +769,8 @@ def replace_lid(
source_plate_rotation=source_plate_rotation,
target_plate_rotation=target_plate_rotation,
grab_offset=grab_offset,
approach_height_offset=approach_height_offset,
source_approach_height_offset=source_approach_height_offset,
target_approach_height_offset=target_approach_height_offset,
)

def rotate_plate_on_deck(
Expand Down
24 changes: 24 additions & 0 deletions src/pf400_interface/resource_helpers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Helpers for resource management in the PF400 REST node."""

from typing import Optional

from madsci.common.types.action_types import ActionFailed
from madsci.common.types.resource_types import Resource, Slot
from pydantic import BaseModel


class LidResult(BaseModel):
"""Pydantic model for defining the response from pf400 REST node _get_lid_from_slot function."""

lid: Optional[Resource] = None
conforms: bool
error: Optional[ActionFailed] = None


class LidSlotResult(BaseModel):
"""Pydantic model for defining the response from pf400 REST node _get_lid_slot_from_target function."""

lid_slot: Optional[Resource] = None
target_resource: Optional[Slot] = None
conforms: bool
error: Optional[ActionFailed] = None
Loading
Loading