input_output

Collection of routines for input and output related tasks.

Contains functions needed for reading in parameters from yaml files and functions for saving and loading dictionaries or whole models to h5 files.

HDF5 Wrapper

save_h5(file, d, *args, **kwargs) Saves dictionary to h5 file.
load_h5(file, *args, **kwargs) Loads dictionary from h5 file.

Conversions

val_unit_to_quantities(dict_of_val_unit_dicts) Recursively convert a dict of value-unit pairs to a dict of quantities.
quantities_to_val_unit(dict_of_quantities) Recursively convert a dict of quantities to a dict of val-unit pairs.
convert_arrays_in_dict_to_lists(adict) Recursively searches through a dict and replaces all numpy arrays by lists.

Saving

save_quantity_dict_to_yaml(file, qdict) Convert and save dictionary of quantities to yaml file.
save_quantity_dict_to_h5(file, qdict) Convert and save dict of quantities to h5 file.
save_network(file, network) Save network to h5 file.

Loading

load_val_unit_dict_from_yaml(file) Load and convert val unit dictionary from yaml file.
load_val_unit_dict_from_h5(file) Load and convert val unit dict from h5 file to dict of quantities.
load_network(file) Load network from h5 file.
load_unit_yaml(file) Loads the standard unit yaml file.

Others

create_hash(params, param_keys) Create unique hash from values of parameters specified in param_keys.