write_file#
- pypillometry.write_file(obj, fname, compress=True)[source]#
Store any Python object in a file using
pickle(or HDF5).By default, the file is compressed with zstd (about 13 times smaller for eyedata objects).
read_file()detects the compression automatically.If fname ends with
.h5or.hdf5, the object is stored in an HDF5 file instead (seepypillometry.hdf5); this works for eyedata and segmented objects only.- Parameters:
- Raises:
TypeError – if fname is an HDF5 file and obj is not an eyedata or segmented object