finesse.utilities.storage.to_generic_hdf

finesse.utilities.storage.to_generic_hdf(obj, grp)[source]

Used to convert a generic Python class into a HDF group.

Scalar values (as determined by np.isscalar) are added as HDF group attributes. This includes class attributes that are int, float, strings, etc. Attributes that are representable with a numpy array are written as datasets within the group. Any attribute that does not fit in the above will be pickled and added as a byte stream dataset.