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

Make SolutionArray picklable #162

Open
ischoegl opened this issue Mar 20, 2023 · 2 comments
Open

Make SolutionArray picklable #162

ischoegl opened this issue Mar 20, 2023 · 2 comments
Labels
feature-request New feature request help wanted Extra attention is needed Python

Comments

@ischoegl
Copy link
Member

Abstract

After refactoring of SolutionArray in Cantera/cantera#1426 (and Cantera/cantera#1458), there is still the option of making the object picklable in Python (similar to Cantera/cantera#692). An implementation is deferred, as it is unclear how common use cases would be.

The implementation itself would be straight-forward: modify C++ SolutionArray::save/restore to allow for YAML string output/input, and implement Python SolutionArray.__getstate__/__getstate__.

@ischoegl ischoegl added feature-request New feature request Python help wanted Extra attention is needed labels Mar 20, 2023
@rwest
Copy link
Member

rwest commented Apr 11, 2023

In general having things be pickleable is nice, especially for some parallelization and workflow tools that rely on it

@ischoegl
Copy link
Member Author

In general having things be pickleable is nice, especially for some parallelization and workflow tools that rely on it

Thanks for the comment. I generally agree, and have implemented Cantera/cantera#692 for that reason. Pickled SolutionArray objects may be a good way to pass back results from multiprocessing pools. I don’t have an urgent need for this at the moment myself, but if anyone else wants to take this on I’d be more than happy to assist with a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature request help wanted Extra attention is needed Python
Projects
None yet
Development

No branches or pull requests

2 participants