rfho/save_and_load.py
def generate_setting_dict(local_variables, excluded=None):
    """
    Generates a dictionary of (name, values) of local variables (typically obtained by vars()) that
    can be saved at the beginning of the experiment. Furthermore, if an object obj in local_variables implements the
    function setting(), it saves the result of obj.setting() as value in the dictionary.

    :param local_variables:
    :param excluded: (optional, default []) variable or list of variables to be excluded.
    :return: A dictionary
    """
    excluded = as_list(excluded) or []
    setting_dict = {k: v.setting() if hasattr(v, 'setting') else v
                    for k, v in local_variables.items() if v not in excluded}
    import datetime
    setting_dict['datetime'] = str(datetime.datetime.now())
    return setting_dict

    Generates a dictionary of (name, values) of local variables (typically obtained by vars()) that
    can be saved at the beginning of the experiment. Furthermore, if an object obj in local_variables implements the
    function setting(), it saves the result of obj.setting() as value in the dictionary.

    :param local_variables:
    :param excluded: (optional, default []) variable or list of variables to be excluded.
    :return: A dictionary
    
Generates a dictionary of (name, values) of local variables (typically obtained by vars()) that
can be saved at the beginning of the experiment. Furthermore, if an object obj in local_variables implements the
function setting(), it saves the result of obj.setting() as value in the dictionary.
Generates a dictionary of ( name values ) of local variables ( typically obtained by vars () ) that can be saved at the beginning of the experiment . Furthermore if an object obj in local_variables implements the function setting () it saves the result of obj . setting () as value in the dictionary .
def generate_setting_dict(local_variables, excluded=None):
    excluded = as_list(excluded) or []
    setting_dict = {k: v.setting() if hasattr(v, 'setting') else v
                    for k, v in local_variables.items() if v not in excluded}
    import datetime
    setting_dict['datetime'] = str(datetime.datetime.now())
    return setting_dict
def generate_setting_dict ( local_variables , excluded = None ) : excluded = as_list ( excluded ) or [ ] setting_dict = { k : v . setting ( ) if hasattr ( v , 'setting' ) else v for k , v in local_variables . items ( ) if v not in excluded } import datetime setting_dict [ 'datetime' ] = str ( datetime . datetime . now ( ) ) return setting_dict
Generates a dictionary of (name, values) of local variables (typically obtained by vars()) that
can be saved at the beginning of the experiment.
Generates a dictionary of ( name values ) of local variables ( typically obtained by vars () ) that can be saved at the beginning of the experiment .
"""
    Generates a dictionary of (name, values) of local variables (typically obtained by vars()) that
    can be saved at the beginning of the experiment. Furthermore, if an object obj in local_variables implements the
    function setting(), it saves the result of obj.setting() as value in the dictionary.

    :param local_variables:
    :param excluded: (optional, default []) variable or list of variables to be excluded.
    :return: A dictionary
    """
None
local_variables
None
excluded
(optional, default []) variable or list of variables to be excluded.
( optional default [] ) variable or list of variables to be excluded .