Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Store objects from symengine environment with dill #336

Closed
karan-an-1996 opened this issue Feb 16, 2021 · 3 comments
Closed

Store objects from symengine environment with dill #336

karan-an-1996 opened this issue Feb 16, 2021 · 3 comments

Comments

@karan-an-1996
Copy link

Hi everyone,

I am trying to save an Add expression of the symengine.lib.symengine_wrapper module with dill, however, I get the following error 'TypeError: self.thisptr cannot be converted to a Python object for pickling'.

Is there a way to store the object without converting it to the sympy environment?

Regards, Karan

@rikardn
Copy link
Contributor

rikardn commented Mar 24, 2021

This is a good question! I encountered the same issue today myself and solved it by going via sympy, which is not optimal. Serialization on the C++ side is being worked on here symengine/symengine#1704. It could potentially be possible to support serialization directly in the python wrapper, but I don't know if it is worth it or if the C++ serializer could work also for pickling in python.

@isuruf
Copy link
Member

isuruf commented Apr 14, 2021

It could potentially be possible to support serialization directly in the python wrapper, but I don't know if it is worth it or if the C++ serializer could work also for pickling in python.

C++ serializer should definitely work also for pickling in python.

@isuruf
Copy link
Member

isuruf commented Dec 2, 2021

Fixed in #377

@isuruf isuruf closed this as completed Dec 2, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants