Repository navigation
XPeel: fix status parsing and the adhere-time code in peel() - #1473
Merged
rickwierenga merged 2 commits intoOct 8, 2026
Merged
Conversation
… as a code `send_command` returns each `*ready:` line with its error description appended (`*ready:00,00,00 [No error]`), and `request_status` (legacy: `get_status`) parsed the last field as `"00 [No error]"`, raising ValueError on every reply. The codes are now read from the first token after the colon. `peel` formatted `adhere_time` in seconds into the command (`*xpeel:42.5`), which the peeler rejects as error 05 "Illegal command". The peeler takes the adhere time as a code, 1-4 for 2.5, 5.0, 7.5 and 10.0 s (`*xpeel:41`). Both fixes apply to `pylabrobot.azenta.XPeel` and the legacy `XPeelBackend`, with tests for each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
AI-found and AI-written: please review manually. An AI coding agent (Claude) found these bugs while driving a real XPeel and wrote this fix and its tests. A person asked for the PR, but no human has reviewed the code line by line yet. Please review it accordingly.
Problem
Two bugs in the XPeel driver, present in both
pylabrobot.azenta.XPeeland the legacypylabrobot.legacy.peeling.XPeelBackend:request_status()/get_status()raise on every reply.send_commandappends the error description to each*ready:line it returns (*ready:00,00,00 [No error]). The status parser then splits the line on,and callsint("00 [No error]"):peel()sends the adhere time in seconds.f"*xpeel:{parameter_set}{adhere_time}"produces*xpeel:42.5, which the peeler rejects with error 05 Illegal command. The peeler expects the adhere time as a code, so 2.5 s is*xpeel:41.Fix
(int, int, int)tuple, which drops the# type: ignore.send_command's return value is unchanged.peel()mapsadhere_timeto the code 1–4 (2.5 / 5.0 / 7.5 / 10.0 s) and sends that. The accepted values and theValueErrorfor anything else are unchanged.xpeel_tests.py(v1) andxpeel_backend_tests.py(legacy) mock the serial port. They cover the status parsing and the commandpeel()writes for each adhere time. They fail onmainand pass with this change.CHANGELOG.mdentry under Unreleased → Fixed.Verification
*statanswers*ready:00,00,00, and the unpatched parser fails on it as shown above.*xpeel:42.5gives05 Illegal command.*xpeel:41peels a sealed plate and ends*ready:00,00,00.pytest: the full suite passes (4855 passed, 66 skipped), including the new tests.ruff==0.15.4,ruff format --check,ruff checkandruff check --select Ipass.mypy==1.18.2 pylabrobotreports the same 9 errors as onmain(missing optional dependencies in my environment). None are in the touched files.🤖 Generated with Claude Code