diff --git a/lisainstrument/instrument.py b/lisainstrument/instrument.py index 8b1ec633b812f7267e9fdfca6570886d249bbb15..a7ab46f601e7a4f31178df912e93df19a2b8c459 100755 --- a/lisainstrument/instrument.py +++ b/lisainstrument/instrument.py @@ -1629,7 +1629,11 @@ class Instrument: names* (str): attribute names """ for name in names: - hdf5.attrs[name] = self.__getattribute__(name) + value = self.__getattribute__(name) + # Take string representation for non-native types + if not isinstance(value, (int, float, np.ndarray)): + value = str(value) + hdf5.attrs[name] = value def _write_metadata(self, hdf5): """Write relevant object's attributes as metadata on ``hdf5``.