-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(api): Replace obsolete machine
args with robot_type
#13737
feat(api): Replace obsolete machine
args with robot_type
#13737
Conversation
Replace `machine` arg of `simulate.get_protocol_api()` with `robot_type`. Remove `machine` arg of `simulate.simulate()`. Remove MachineType type.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## chore_release-7.0.1 #13737 +/- ##
=======================================================
- Coverage 71.30% 71.25% -0.05%
=======================================================
Files 1588 2429 +841
Lines 52809 68421 +15612
Branches 3448 8043 +4595
=======================================================
+ Hits 37653 48754 +11101
- Misses 14621 17769 +3148
- Partials 535 1898 +1363
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just have one comment but other than that good to merge 🤖
raise RuntimeError( | ||
f'This robot is of type "{current_robot_type}",' | ||
f' so it can\'t simulate protocols for robot type "{robot_type}"' | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than expose that in this error message, until we fix this it might be better if we just say something along the lines of "robotType defined in protocol cannot be simulated on this machine."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeahhhhhhh, maybe.
I'm going to leave it as-is for now, to try to stay closer to robot-server, which provides these details and does it properly. Ideally, the logic to generate the human-readable error would be shared between them.
* Fix bugs in Jupyter override test cases. * Move find_jupyter_labware() to entrypoint_utils. * Remove obsolete `machine` args. Replace `machine` arg of `simulate.get_protocol_api()` with `robot_type`. Remove `machine` arg of `simulate.simulate()`. Remove MachineType type. * Various minor refactors.
Overview
Closes RSS-266 and RSS-267.
Test Plan
I will:
Changelog
Main items, RSS-266 and RSS-267:
machine
argument of theopentrons.simulate.simulate()
function andopentrons_simulate
CLI. Instead, we automatically infer it from the contents of the protocol.machine
argument ofopentrons.simulate.get_protocol_api()
. Replace it withrobot_type
, and make its values match therobotType
key in therequirements
dict of Python protocols.Other stuff:
execute.py
'sfind_jupyter_labware()
helper to somewhere it can be shared betweensimulate.py
andexecute.py
.Review requests
None in particular.
Risk assessment
The removal of the
machine
arguments is technically a breaking change for any OT-2 user who's gone out of their way to discover and use them. I'm betting nobody has done this, and even if they have, the fix is trivial. But if anybody disagrees, we can add some kind of backwards compatibility shim.