K-Dense-AI/scientific-agent-skills / skills/pylabrobot
pylabrobot
VerifiedDevelops and reviews PyLabRobot lab-automation resources, liquid-handling plans, offline simulations, and supported-device integrations. Supports PyLabRobot protocols and API questions; keep physical execution behind an explicit operator safety gate.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.6 KB |
| assets/protocol-manifest.schema.json | config | 7.9 KB |
| references/analytical-equipment.md | markdown | 7.3 KB |
| references/hardware-backends.md | markdown | 7.5 KB |
| references/liquid-handling.md | markdown | 8.7 KB |
| references/material-handling.md | markdown | 8.4 KB |
| references/resources.md | markdown | 9.1 KB |
| references/review.md | markdown | 6.3 KB |
| references/visualization.md | markdown | 6.5 KB |
| scripts/__init__.py | script | 72 B |
| scripts/_common.py | script | 27.1 KB |
| scripts/check_deck_geometry.py | script | 1.3 KB |
| scripts/generate_simulation_plan.py | script | 4.7 KB |
| scripts/inspect_backends.py | script | 7.3 KB |
| scripts/plan_transfers.py | script | 1.5 KB |
| scripts/validate_manifest.py | script | 1.4 KB |
scripts/inspect_backends.py
View on GitHub#!/usr/bin/env python3
"""Inspect a pinned PyLabRobot API surface without constructing a backend."""
from __future__ import annotations
import argparse
import inspect
import re
from importlib.metadata import PackageNotFoundError, metadata, version
from typing import Any, Sequence
if __package__:
from ._common import PYLABROBOT_VERSION, ValidationError, emit_error, emit_json
else:
from _common import PYLABROBOT_VERSION, ValidationError, emit_error, emit_json
VERSION_RE = re.compile(r"^[0-9]+(?:\.[0-9]+){2}$")
def build_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(
description=(
"Inspect installed PyLabRobot version, known backend symbols, frontend "
"methods, and release availability. Imports are lazy; no backend is "
"instantiated and no setup, serial, USB, or network operation is performed."
)
)
parser.add_argument(
"--expected-version",
default=PYLABROBOT_VERSION,
help=f"Expected exact stable version (default: {PYLABROBOT_VERSION})",
)
parser.add_argument(
"--strict",
action="store_true",
help="Exit nonzero when PyLabRobot is absent, mismatched, or symbols fail to import",
)
return parser
def _class_record(
class_object: type[Any],
*,
support: str,
transport: str,
methods: Sequence[str],
) -> dict[str, Any]:
return {
"class": class_object.__name__,
"import_path": f"{class_object.__module__}.{class_object.__name__}",
"signature": str(inspect.signature(class_object)),
"support_note": support,
"transport": transport,
"declared_methods": {
method: hasattr(class_object, method)
for method in methods
},
}
def inspect_installation(expected_version: str) -> dict[str, Any]:
if VERSION_RE.fullmatch(expected_version) is None:
raise ValidationError("--expected-version must use X.Y.Z numeric form")
try:
installed_version = version("PyLabRobot")
package_metadata = metadata("PyLabRobot")
except PackageNotFoundError:
return {
"ok": False,
"installed": False,
"expected_version": expected_version,
"connection_attempted": False,
"serial_usb_network_access": False,
"message": "PyLabRobot is not installed; help and local planning CLIs remain available.",
}
import_errors: list[str] = []
backends: list[dict[str, Any]] = []
frontends: dict[str, dict[str, bool]] = {}
try:
from pylabrobot.liquid_handling import LiquidHandler
from pylabrobot.liquid_handling.backends import (
EVOBackend,
LiquidHandlerChatterboxBackend,
OpentronsOT2Backend,
STARBackend,
VantageBackend,
)
operation_methods = (
"setup",
"stop",
"pick_up_tips",
"drop_tips",
"aspirate",
"dispense",
)
backends = [
_class_record(
LiquidHandlerChatterboxBackend,
support="testing/offline",
transport="console only",
methods=operation_methods,
),
_class_record(
STARBackend,
support="released symbol; model capability requires review",
transport="vendor firmware over USB",
methods=operation_methods,
),
_class_record(
VantageBackend,
support="released symbol; model capability requires review",
transport="vendor firmware over USB",
methods=operation_methods,
),
_class_record(
EVOBackend,
support="released symbol; model capability requires review",
transport="vendor firmware over USB",
methods=operation_methods,
),
_class_record(
OpentronsOT2Backend,
support="released symbol; model capability requires review",
transport="HTTP to explicitly configured host",
methods=operation_methods,
),
]
frontends["LiquidHandler"] = {
method: hasattr(LiquidHandler, method)
for method in (
"setup",
"stop",
"pick_up_tips",
"drop_tips",
"return_tips",
"aspirate",
"dispense",
"transfer",
)
}
except (ImportError, AttributeError) as error:
import_errors.append(f"liquid_handling: {type(error).__name__}: {error}")
try:
from pylabrobot.centrifuge import Centrifuge
from pylabrobot.heating_shaking import HeaterShaker
from pylabrobot.plate_reading import PlateReader
from pylabrobot.pumps import Pump
from pylabrobot.scales import Scale
from pylabrobot.shaking import Shaker
from pylabrobot.temperature_controlling import TemperatureController
from pylabrobot.visualizer import Visualizer
method_map: dict[str, tuple[type[Any], tuple[str, ...]]] = {
"PlateReader": (
PlateReader,
("setup", "stop", "open", "close", "read_absorbance", "read_fluorescence"),
),
"Pump": (Pump, ("setup", "stop", "run_for_duration", "run_continuously", "pump_volume", "halt")),
"Scale": (Scale, ("setup", "stop", "read_weight", "tare", "zero")),
"HeaterShaker": (
HeaterShaker,
("setup", "stop", "set_temperature", "shake", "stop_shaking"),
),
"Shaker": (Shaker, ("setup", "stop", "shake", "stop_shaking")),
"TemperatureController": (
TemperatureController,
("setup", "stop", "set_temperature", "get_temperature", "deactivate"),
),
"Centrifuge": (
Centrifuge,
("setup", "stop", "open_door", "close_door", "lock_door", "spin"),
),
"Visualizer": (Visualizer, ("setup", "stop")),
}
for name, (class_object, methods) in method_map.items():
frontends[name] = {method: hasattr(class_object, method) for method in methods}
except (ImportError, AttributeError) as error:
import_errors.append(f"equipment: {type(error).__name__}: {error}")
missing_methods = [
f"{name}.{method}"
for name, methods in frontends.items()
for method, present in methods.items()
if not present
]
return {
"ok": not import_errors and not missing_methods and installed_version == expected_version,
"installed": True,
"installed_version": installed_version,
"expected_version": expected_version,
"version_match": installed_version == expected_version,
"requires_python": package_metadata.get("Requires-Python"),
"connection_attempted": False,
"serial_usb_network_access": False,
"backend_instances_created": 0,
"backends": backends,
"frontends": frontends,
"import_errors": import_errors,
"missing_methods": missing_methods,
"stable_status_note": (
"Exports inspected against PyLabRobot 0.2.2; hosted support tables can describe development APIs. "
"availability and capabilities remain model/firmware/configuration specific."
),
}
def main(argv: Sequence[str] | None = None) -> int:
args = build_parser().parse_args(argv)
try:
report = inspect_installation(args.expected_version)
except ValidationError as error:
return emit_error(error)
emit_json(report)
if args.strict and not report.get("ok", False):
return 4
return 0
if __name__ == "__main__":
raise SystemExit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |