Skip to content

docs: name methods by prefix in the device driver guide - #1035

Open
BioCam wants to merge 15 commits into
PyLabRobot:mainfrom
BioCam:docs-command-prefix-conventions
Open

BioCam wants to merge 15 commits into
PyLabRobot:mainfrom
BioCam:docs-command-prefix-conventions

Conversation

@BioCam

@BioCam BioCam commented May 13, 2026 •

Copy link
Copy Markdown
Collaborator

The Problem

The only full statement of PyLabRobot's method prefixes is P10 in pylabrobot/hamilton/star/design.md, a STAR-only file that authors of other devices have no reason to read.
The contributor guides, which AGENTS.md names as the source of truth, do not mention the prefixes at all, so each new driver picks its own get_ / read_ / request_ / query_.

PR Content

  • Add a "Name methods by prefix" section to the device driver guide, under "Structure the driver": the prefix table from forum post different plate types on cytation5 #403 and design.md P10 with v1 examples, probe_ and start_ / stop_, the drive-name-first rule, unprefixed lifecycle methods, and the synonyms not to use.
  • Turn design.md P10 into a pointer to that section, keeping only the STAR rule on argument order.
  • Update design.md notes 5 and 6, which referred to P10's table: probe_ is now in the table, and note 6 keeps only why the force reading is request_.

🤖 Generated with Claude Code

@BioCam
BioCam requested a review from rickwierenga May 13, 2026 05:28
@rickwierenga
rickwierenga requested a review from a team as a code owner September 27, 2026 19:02
@BioCam
BioCam force-pushed the docs-command-prefix-conventions branch 3 times, most recently from b977e82 to 52e1ab1 Compare October 26, 2026 08:06
@BioCam BioCam changed the title docs: add command prefix conventions contributor guide docs: name methods by prefix in the device driver guide Oct 26, 2026
@BioCam
BioCam force-pushed the docs-command-prefix-conventions branch 7 times, most recently from ea69aa6 to c459a13 Compare October 27, 2026 10:55
The command prefixes were only stated in full in the STAR design.md. Add them
as a "Name methods by prefix" section of the device driver guide and point
design.md P10 to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BioCam
BioCam force-pushed the docs-command-prefix-conventions branch from c459a13 to 932d18c Compare October 27, 2026 12:42
Comment on lines +27 to +45
### Name methods by prefix

A method's prefix says what it touches and what it does, following the [PLR command prefix proposal](https://discuss.pylabrobot.org/t/standardised-plr-command-prefix-proposal/403).

| prefix | meaning | examples |
|---|---|---|
| `move_`, `aspirate_`, `dispense_`, `pickup_`, `shake_` | the device does work | `move_to_y_position`, `move_to_safe_z` |
| `start_`, `stop_` | start or stop a process left running on the device | `start_temperature_control`, `start_shaking` |
| `measure_`, `sense_`, `read_`, `capture_` | a sensor reading taken at the moment of asking | `measure_weight`, `sense_tip_presence`, `sense_drawer_open`, `read_absorbance` |
| `probe_` | a measurement taken by moving | `probe_z_max`, `gripper_probe_for_object` |
| `request_` | read device memory: a value the device answers from its registers | `request_y_positions`, `request_parameters` |
| `set_` | write device memory, nothing else | `set_drive_parameter`, `set_loading_indicators` |
| `get_` | read the resource model, computed with no I/O | `elbow_drive_get_angle` |
| `update_`, `assign_`, `unassign_` | write the resource model | `elbow_drive_update_angle`, `assign_child_resource` |

- A process left running is a `start_` / `stop_` pair, never `set_`: `start_temperature_control` / `stop_temperature_control`.
- On a feature with several drives, the drive's name comes first: `gripper_request_width`, `elbow_drive_get_angle`.
- Lifecycle methods take no prefix: `discover`, `initialize`, `park`.
- Don't use synonyms of these prefixes: `query_`, `fetch_`, `retrieve_`, `obtain_`, `poll_` (use `request_` or `get_`), `write_`, `put_` (use `set_`). Propose a missing prefix on the forum before adding one.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think get/set for local and read/write for machine/remote operations is the best

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants