Create checkpoint file in pychrono
So I guess this is not possible, since there is no way to use ChStreamOutAsciiFile etc. . Are I'm correct?
now i found SerializeToJSON but what is the opposite?
Hi @TheCrazyT, the short answer is that is not currently possible, except for the only method that you already found.
As you may have seen from the CHANGELOG there have been significant changes to the API. One of this, is obsoleting the ChStreamOutAsciiFile class and replace it with pure STL streams (of which the ChStream[In|Out]AsciiFile were basically slightly more than simple wrappers) that we didn't expose through SWIG yet.
However, this is not the reason for which the serialization/checkpointing is not fully implemented for the PyChrono version. What is truly missing are all the classes in the chrono/serialization folder! These classes leverage some complex C++ feature, together with an heavy use of templates, thus being quite difficult to wrap in SWIG.
That's why the only thing that we exposed in Python and C# is SerializeToJSON that allows us (especially for the Chrono::SolidWorks add-in) to:
- only export
- only the entire system
- only to JSON
We may add some additional methods to expand the flexibility of the serialization also for the wrapped languages, but we do not have strict plans for that!
Could you please clarify: are you interested in serializing a Chrono system or in checkpointing? The two are not the same thing.
Was interested in checkpointing. But I aleady noticed that this feature is not even complete if you use a c++ program.
As a workaround I am currently using dmtcp for now. Although I only use it with simple graph creation and without visualisation of the simulation. Not shure if it would work for that, too.