From 58d01dd45c83f9b1f8efff6b720a8b4263146bdd Mon Sep 17 00:00:00 2001 From: Ethan Blackwood Date: Fri, 9 Aug 2024 03:17:31 -0400 Subject: [PATCH] Fix corr image not validating if it contains nans --- caiman/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caiman/utils/utils.py b/caiman/utils/utils.py index 54f028e3d..06d1490d5 100644 --- a/caiman/utils/utils.py +++ b/caiman/utils/utils.py @@ -516,7 +516,7 @@ def recursively_save_dict_contents_to_group(h5file:h5py.File, path:str, dic:dict except: item = np.array(item).astype('|S32') h5file[path + key] = item - if not np.array_equal(h5file[path + key][()], item): + if not np.array_equal(h5file[path + key][()], item, equal_nan=item.dtype == 'f'): # just using True gives "ufunc 'isnan' not supported for the input types" raise ValueError(f'Error while saving ndarray {key} of dtype {item.dtype}') # save dictionaries elif isinstance(item, dict):