We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For separation of RE and callbacks (e.g. using zmq) data from a read needs to be picklable. Currently if I do:
read
import pickle from enum import Enum import bluesky.plan_stubs as bps from bluesky.run_engine import RunEngine from ophyd_async.core import DeviceCollector, StandardReadable from ophyd_async.epics.signal import epics_signal_r class SynchrotronMode(str, Enum): SHUTDOWN = "Shutdown" INJECTION = "Injection" NOBEAM = "No Beam" DEV = "Mach. Dev." USER = "User" SPECIAL = "Special" STARTUP = "BL Startup" UNKNOWN = "Unknown" class Device(StandardReadable): def __init__( self, ): self.mode = epics_signal_r(SynchrotronMode, "CS-CS-MSTAT-01:MODE") RE = RunEngine() with DeviceCollector(): my_device = Device() def my_plan(): test = yield from bps.rd(my_device.mode) pickled_string = pickle.dumps(test) print(test, pickled_string) RE(my_plan())
I get:
Traceback (most recent call last): File "/scratch/ffv81422/hyperion/dodal/scratch.py", line 40, in <module> RE(my_plan()) File "/scratch/ffv81422/hyperion/dodal/.venv/lib/python3.10/site-packages/bluesky/run_engine.py", line 918, in __call__ plan_return = self._resume_task(init_func=_build_task) File "/scratch/ffv81422/hyperion/dodal/.venv/lib/python3.10/site-packages/bluesky/run_engine.py", line 1057, in _resume_task raise exc File "/scratch/ffv81422/hyperion/dodal/.venv/lib/python3.10/site-packages/bluesky/run_engine.py", line 1687, in _run raise err File "/scratch/ffv81422/hyperion/dodal/.venv/lib/python3.10/site-packages/bluesky/run_engine.py", line 1547, in _run msg = self._plan_stack[-1].send(resp) File "/scratch/ffv81422/hyperion/dodal/scratch.py", line 36, in my_plan pickled_string = pickle.dumps(test) _pickle.PicklingError: Can't pickle <enum 'GeneratedChoices'>: attribute lookup GeneratedChoices on ophyd_async.epics._backend.common failed
The text was updated successfully, but these errors were encountered:
Fixed by #237
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
For separation of RE and callbacks (e.g. using zmq) data from a
read
needs to be picklable. Currently if I do:I get:
Acceptance Criteria
The text was updated successfully, but these errors were encountered: