You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Exporting rocketpy classes to a json file is something that the user currently cannot do so easily.
The get_instance_attributes (see below) function already made an important advance to export all the attributes of an instance to a dictionary, but that doesn't mean we can always save these dictionaries to json files.
Exporting objects as json files might be the easiest way of saving a rocketpy simulation without having to plot tons of data and plots.
Add to_json, to_serializableor__json__ methods to the important classes of RocketPy, allowing the
Alternatively, the jsonpickle package can be used to perform a quick encode/decode with any of the rocketpy classes, as already done in the EnvironmentAnalysis class.
Is your feature request related to a problem? Please describe.
Exporting rocketpy classes to a json file is something that the user currently cannot do so easily.
The
get_instance_attributes
(see below) function already made an important advance to export all the attributes of an instance to a dictionary, but that doesn't mean we can always save these dictionaries to json files.Exporting objects as json files might be the easiest way of saving a rocketpy simulation without having to plot tons of data and plots.
RocketPy/rocketpy/utilities.py
Line 642 in 14dd0f6
Describe the solution you'd like
to_json
,to_serializable
or__json__
methods to the important classes of RocketPy, allowing thejsonpickle
package can be used to perform a quick encode/decode with any of the rocketpy classes, as already done in the EnvironmentAnalysis class.RocketPy/rocketpy/environment/environment_analysis.py
Line 2899 in 14dd0f6
Additional context
As far as I know there's no convention on Python regarding the name of the method
The text was updated successfully, but these errors were encountered: