Description
Your setup:
- Operating System (Linux, MacOS, Windows): Linux
- Hardware type (x86, ARM..) and RAM: x86, 128 GB
- Python Version (e.g. 3.9): 3.11
- Caiman version (e.g. 1.9.12): 1.11.3
- Which demo exhibits the problem (if applicable): N/A
- How you installed Caiman (pure conda, conda + compile, colab, ..): conda + compile
- Details:
I encountered the "No file saved" warning when trying to do motion correction on just an ndarray (for a test). There is code to save an ndarray or movie to a temporary .hdf5 file first, but it doesn't set the file_name
attribute on the movie if it's not already a movie that has one. As a result, saving file_name
fails:
CaImAn/caiman/base/timeseries.py
Lines 297 to 300 in bb55800
...because file_name
is [None]
and (None).encode('utf8')
doesn't work. In practice, I realized since it's just a warning the code will continue and work as expected, but may as well fix it to avoid any doubt.
Suggested fix: change to dset.attrs["file_name"] = [a.encode('utf8') for a in self.file_name if a is not None]
Optional additional fix: in motion_correction.py line 177, set file_name when creating the movie: caiman.movie(fname, file_name=mc_tempfile).save(mc_tempfile)
(however this will not overwrite file_name
if fname
is already a movie)