Edit in the latest software, just set enable_dodging_od
to true
under `[stirring.config]’ and save - don’t use the steps below!
Hi @stefdon, you can program this, yea. There’s a few ways to accomplish, but I think the method below is the least complex. I suggest demoing this on a Pioreactor, to see if you like the results.
- SSH into the Pioreactor you want to demonstrate on. We’re going to create a simple plugin, so we create a python file with:
nano ~/.pioreactor/plugins/stop_stirring_before_reading.py
- In the text editor, copy and paste the following:
from pioreactor.background_jobs.od_reading import start_od_reading, ODReader
from time import sleep
__plugin_name__ = "stop stirring before reading plugin"
__plugin_author__= "Cam Davidson-Pilon"
__plugin_summary__ = "This stops the stirring before OD reading. Probably only useful when time between OD reading is long."
def pause_stirring(cls):
cls.publish(f"pioreactor/{cls.unit}/{cls.experiment}/stirring/$state/set", "sleeping")
sleep(1.75) # sleep to let stirring job process request and slow down mixing
def unpause_stirring(cls, *args):
cls.publish(f"pioreactor/{cls.unit}/{cls.experiment}/stirring/$state/set", "ready")
ODReader.add_pre_read_callback(pause_stirring)
ODReader.add_post_read_callback(unpause_stirring)
Use crtl-x
to exit.
- Try it out: on the edited Pioreactor, start stirring, and then start OD reading.
- If you’re happy with that, you can copy this plugin to the other Pioreactors.
Let me know if you encounter any problems, or would like to change the behaviour somewhere.
If this feature is requested often enough, we’d be happy to implement it natively so it’s just a config change (instead of writing and editing Python).