Open ischoegl opened 1 year ago
In general having things be pickleable is nice, especially for some parallelization and workflow tools that rely on it
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.
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 PythonSolutionArray.__getstate__/__getstate__
.