RCAIDE.load

load#

load(filename, pickle_format=False)[source]#

Imports a Pickle or JSON file into a RCAIDE data structure.

Parameters:
  • filename (str) – Path to the file to be loaded, without extension for pickle files

  • pickle_format (bool, optional) – Flag indicating whether to load a pickle file (True) or JSON file (False) Default is False (JSON format)

Returns:

data – RCAIDE data structure containing the loaded information

Return type:

RCAIDE.Framework.Core.Data

Notes

This function supports two file formats:

  1. JSON format (default): Loads a JSON file and converts it to a RCAIDE data structure using the read_RCAIDE_json_dict function.

  2. Pickle format: Loads a binary pickle file directly into a Python object. 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.save

read_RCAIDE_json_dict(res_dict)[source]#

Builds a RCAIDE data structure based on a dictionary from a JSON file. This is initial case.

Assumptions:

Dictionary was created based on a previously saved RCAIDE data structure.

Source:

None

Parameters:

res_dict – Dictionary based on the RCAIDE data structure [unitless]

Returns:

RCAIDE data structure [unitless]

Return type:

RCAIDE_data

build_data_r(v)[source]#

Builds a RCAIDE data structure based on a dictionary from a JSON file. This is recursive step.

Assumptions:

Dictionary was created based on a previously saved RCAIDE data structure.

Source:

None

Parameters:

v – generic value [unitless]

Returns:

value converted to needed format [unitless]

Return type:

ret