I’m currently hoping to run opentrons_simulate to validate protocol .py files without having to use the Opentrons App so that my workflow is faster. Also, because currently the protocol analysis in the app is giving me an OutOfTipsError (but before I add my CSV, which only specifies a very small amount of work, such that it should definitely not run out of tips).
However, I’m not sure how to run simulations with protocols that need a CSV or custom labware! Has anyone dealt with this issue before?
Install the opentrons python package and run opentrons_simulate my_protocol.py . Keep in mind you probably can’t load the csv at runtime since the actually script runs from the micro-controller in the Opentrons. (unless the csv is actually there).
Also, I have a branch in https://galago.bio/ that implements simulation fully from Galago’s code editor gui (a vscode web clone). Let me know if you want to try it out and I can try and push it to main soon. The benefit of it is that you can inject runtime variables from Galago, these get evaluated and injected into the final python script sent to the opentrons api.
I don’t know about CSVs, but I do simulate with custom labware
I use a linux virtual desktop (WSL) for this and a conda environment.
Make sure the opentrons package is installed in the conda environment
Then in your python robot script I put it like this:
import json
simulate = True
if simulate:
with open(path/custom_labwaredef.json) as labware_file:
labware = json.load(labware_file)
labware_variable = protocol.load_labware_from_definition(labware, deck position, name)
else:
labware_variable = protocol.load_labware(labware, deck position, name)
Then in WSL
opentrons_simulate -L path/to/labwaredefinitions path/to/protocol.py
I think for custom labware the WSL was essential, because windows did not want to work with µL signs, which are in the json files