-
Notifications
You must be signed in to change notification settings - Fork 368
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
Make controller_wrapper functions functors #945
Conversation
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.
Can you add a test case for the pickle/deepcopy of the backend classes? Something like: https://github.com/Qiskit/retworkx/blob/master/tests/test_deepcopy.py (which is what I added when I had to fix a deepcopy/pickle issue in Qiskit/rustworkx#15)
I didn't know copy.deepcopy used the functionality I think we're going for .. but it kind of makes sense, cool. I might've gone a bit overboard but lmk what you think. |
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!
Summary
This adjusts the controller_execute functions to be functors rather than free-functions. This allows pickling of these objects - specifically it allows them to be used in multiprocessing.map(...) calls.
Details and comments
See pybind/pybind11#1261