get_file#

caput.memdata.get_file(f, file_format=None, **kwargs)[source]#

Checks if input is a zarr/h5py.File or filename and returns the former.

Parameters:
fFileOrGroupLike

File to check.

file_formatFileFormat | None

File format to use. File format will be guessed if not supplied. Default None.

**kwargsAny

Passed to h5py.File constructor or zarr.open_group(). If f is already an open file, silently ignores all keywords.

Returns:
fileFileOrGroupLike

Opened file object and Wboolean whether the a file was opened or not (i.e. was already open).