dingo-gw / dingo

Dingo: Deep inference for gravitational-wave observations
MIT License
55 stars 18 forks source link

Saving of metadata for `DingoDataset` #109

Open stephengreen opened 2 years ago

stephengreen commented 2 years ago

When settings / metadata are saved to HDF5 in a DingoDataset, the dictionary is converted to a string. When loading, the string is converted back to a dictionary using ast.literal_eval(). This method was used to ensure that we could handle any data types that might appear in the settings dictionary.

It would be good to instead treat settings / metadata as any other DingoDataset saved attribute (specified by data_keys). In other words, the dictionary would be saved in HDF5 as a set of nested groups and datasets / attributes. It will be important to thoroughly check this to be sure all the values can be properly saved and loaded, and a conversion script should be written to convert the old file format to the new one.