RCAIDE.save

save#

Converts a RCAIDE data structure to a JSON or Pickle file for storage.

param data:

RCAIDE data structure to be saved

type data:

RCAIDE.Framework.Core.Data

param filename:

Path where the file will be saved, without extension for pickle files

type filename:

str

param pickle_format:

Flag indicating whether to save as a pickle file (True) or JSON file (False) Default is False (JSON format)

type pickle_format:

bool, optional

rtype:

None

Notes

This function supports two file formats:

  1. JSON format (default): Converts the RCAIDE data structure to a JSON string using the build_dict_base and build_dict_r helper functions, then writes it to a file.

  2. Pickle format: Serializes the Python object directly to a binary file. The .pkl extension is automatically added to the filename.

JSON format is human-readable and more portable across different Python versions, while pickle format is more efficient for large data structures but less portable.

See also

RCAIDE.load, RCAIDE.build_dict_base, RCAIDE.build_dict_r

__init__(*args, **kwargs)#

Initialize self. See help(type(self)) for accurate signature.