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:
- f
FileOrGroupLike File to check.
- file_format
FileFormat|None File format to use. File format will be guessed if not supplied. Default None.
- **kwargsAny
Passed to
h5py.Fileconstructor orzarr.open_group(). If f is already an open file, silently ignores all keywords.
- f
- Returns:
- file
FileOrGroupLike Opened file object and Wboolean whether the a file was opened or not (i.e. was already open).
- file