From 1430026c361bbf69e88529cdf615749d551f01fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darik=20A=20O=E2=80=99Neil?= Date: Tue, 3 Dec 2024 15:57:33 -0500 Subject: [PATCH] Update movies.py Update README.md Fixed "get_file_size" functions inability to handle '.npy' files. Update README.md --- caiman/base/movies.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/caiman/base/movies.py b/caiman/base/movies.py index a4652ff8f..0e0805dc1 100644 --- a/caiman/base/movies.py +++ b/caiman/base/movies.py @@ -2025,6 +2025,10 @@ def get_file_size(file_name, var_name_hdf5:str='mov') -> tuple[tuple, Union[int, logger.error(f'The file does not contain a variable named {var_name_hdf5}') raise Exception('Variable not found. Use one of the above') T, dims = siz[0], siz[1:] + elif extension in ('.npy', ): + shape = np.load(file_name, allow_pickle=False).shape + T = shape[0] + dims = shape[1:] elif extension in ('.sbx'): shape = caiman.utils.sbx_utils.sbx_shape(file_name[:-4]) T = shape[-1]