Skip to content

Commit

Permalink
Merge pull request #1385 from proektlab/save-nan-fix
Browse files Browse the repository at this point in the history
Fix error when saving array with NaNs (occurs with corr_img when use_corr_img is True)
  • Loading branch information
pgunn authored Aug 9, 2024
2 parents cd61a86 + 58d01dd commit 808b22f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion caiman/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 808b22f

Please sign in to comment.