<filename>tools/analysis_tool_timeseries/lib_utils_io.py
"""
Library Features:

Name:          lib_utils_io
Author(s):     <NAME> (<EMAIL>)
Date:          '20210408'
Version:       '1.0.0'
"""

# -------------------------------------------------------------------------------------
# Libraries
import os
import pickle

# Debug
# import matplotlib.pylab as plt
# -------------------------------------------------------------------------------------


# -------------------------------------------------------------------------------------
# Method to read data obj
def read_obj(file_name):
    if os.path.exists(file_name):
        data = pickle.load(open(file_name, "rb"))
    else:
        data = None
    return data
# -------------------------------------------------------------------------------------


# -------------------------------------------------------------------------------------
# Method to write data obj
def write_obj(file_name, data):
    if os.path.exists(file_name):
        os.remove(file_name)
    with open(file_name, 'wb') as handle:
        pickle.dump(data, handle, protocol=pickle.HIGHEST_PROTOCOL)
# -------------------------------------------------------------------------------------

<filename>tools/analysis_tool_timeseries/lib_utils_io.py
"""
Library Features:

Name:          lib_utils_io
Author(s):     <NAME> (<EMAIL>)
Date:          '20210408'
Version:       '1.0.0'
"""

# -------------------------------------------------------------------------------------
# Libraries
import os
import pickle

# Debug
# import matplotlib.pylab as plt
# -------------------------------------------------------------------------------------


# -------------------------------------------------------------------------------------
# Method to read data obj
def read_obj(file_name):
    if os.path.exists(file_name):
        data = pickle.load(open(file_name, "rb"))
    else:
        data = None
    return data
# -------------------------------------------------------------------------------------


# -------------------------------------------------------------------------------------
# Method to write data obj
def write_obj(file_name, data):
    if os.path.exists(file_name):
        os.remove(file_name)
    with open(file_name, 'wb') as handle:
        pickle.dump(data, handle, protocol=pickle.HIGHEST_PROTOCOL)
# -------------------------------------------------------------------------------------

Library Features:  Name:          lib_utils_io Author(s):     <NAME> (<EMAIL>) Date:          '20210408' Version:       '1.0.0' # ------------------------------------------------------------------------------------- # Libraries # Debug # import matplotlib.pylab as plt # ------------------------------------------------------------------------------------- # ------------------------------------------------------------------------------------- # Method to read data obj # ------------------------------------------------------------------------------------- # ------------------------------------------------------------------------------------- # Method to write data obj # -------------------------------------------------------------------------------------