check_file_format#
- caput.memdata.fileformats.check_file_format(filename, file_format, data)[source]#
Attempt to detect the format of a file.
- Parameters:
- filename
str File name.
- file_format
FileFormat|None Expected file format. If not
None, an exception is raised if the detected file type is not this value. IfNone, no check is done against the detected format.- dataAny
If this is an
h5py.Grouporzarr.Group, it will be used to guess or confirm the file format.
- filename
- Returns:
- file_format
FileFormat The detected
FileFormat.
- file_format