sidpy.hdf.hdf_utils.write_simple_attrs

sidpy.hdf.hdf_utils.write_simple_attrs(h5_obj, attrs, force_to_str=True, verbose=False)[source]

Writes attributes to a h5py object

Parameters:
  • h5_obj (h5py.File, h5py.Group, or h5py.Dataset object) – h5py object to which the attributes will be written to

  • attrs (dict) – Dictionary containing the attributes as key-value pairs

  • force_to_str (bool, optional. Default = True) – Whether or not to cast keys or values to string when they do not have the correct types

  • verbose (bool, optional. Default=False) – Whether or not to print debugging statements