slmsuite.misc.files

Utilities for interfacing with files. This includes helper functions for naming directories without conflicts, and convenience wrappers for file writing. slmsuite uses the HDF5 filetype (.h5) by default, as it is fast, compact, and widely supported by programming languages for scientific computing. This uses the h5py module.

Functions

generate_path

Generate a file path like path/name_id.extension or a directory path like path/name_id where id is a unique numeric identifier.

latest_path

Obtains the path for the file or directory in path like path/name_id where id is the greatest identifier in path for the given name.

read_h5

Read data from an h5 file into a dictionary.

write_h5

Write data in a dictionary to an h5 file.