Description
Currently the document Using Python for Protocols has this to say about simulating code in Jupyter:
In your Jupyter notebook, you can use the Python Protocol API simulator by doing
from opentrons import simulate protocol = simulate.get_protocol_api('|apiLevel|') p300 = protocol.load_instrument('p300_single', 'right') # ...
The
protocol
object, which is an instance of.ProtocolContext
, is the same thing that gets passed to your protocol'srun
function, but set to simulate rather than control an OT-2. You can call all your protocol's functions on that object.
It then says:
If you have a full protocol, wrapped inside a
run
function, defined in a Jupyter cell you can also useopentrons.simulate.simulate
as described above to simulate the protocol.
However this last part seems not to be true. The opentrons.simulate.simulate
function requires a python protocol as a text file, not a run() function. I cannot find a way to pass my protocol's run() function to the simulation and get the runlog. Is this possible, or are the docs mistaken?