check_length_dict

despasito.utils.general_toolbox.check_length_dict

check_length_dict(dictionary, keys, lx=None)[source]

This function compared the entries, keys, in the provided dictionary to ensure they’re the same length.

All entries in the list keys, will be made into numpy arrays (if present). If a float or array of length one is provided, it will be expanded to the length of other arrays.

Parameters:
  • dictionary (dict) – Dictionary containing all or some of the keywords, keys, of what should be arrays of identical size.

  • keys (list) – Possible keywords representing array entries

  • lx (int, Optional, default=None) – The size that arrays should conform to

Returns:

new_dictionary – Dictionary of arrays of identical size.

Return type:

dict