Skip to content
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

Allow pickling of TransferTrajectory #162

Open
Pocket-titan opened this issue Aug 21, 2024 · 1 comment
Open

Allow pickling of TransferTrajectory #162

Pocket-titan opened this issue Aug 21, 2024 · 1 comment

Comments

@Pocket-titan
Copy link

Hi!

I noticed that a lot of the examples using pygmo for optimization have to rely on some "hacks" (re-initializing the object for every thread: can be expensive and clunky) (one, two) to make the object pickle-able so the optimization can be parallelized. The fundamental issue as I understand it is the TransferTrajectory class: cloudpickle can't pickle this, and for me the lambda trick also doesn't circumvent this.

However, pybind11 offers pickling support if you define the appropriate methods on the C++ side. Is this something that's maybe desirable?

@DominicDirkx
Copy link
Member

This would definitely be good to have, we just have not yet gotten around to it yet :) Can you explain why the lambda trick does not circumvent the issue in this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants