flatironinstitute / CaImAn

Computational toolbox for large scale Calcium Imaging Analysis, including movie handling, motion correction, source extraction, spike deconvolution and result visualization.
https://caiman.readthedocs.io
GNU General Public License v2.0
639 stars 370 forks source link

Demotest gives KeyError in cnmf/initialization.py #1310

Closed ethanbb closed 7 months ago

ethanbb commented 7 months ago

Your setup:

  1. Operating System (Linux, MacOS, Windows): Linux
  2. Hardware type (x86, ARM..) and RAM: x86, 128 GB
  3. Python Version (e.g. 3.9): 3.11.8
  4. Caiman version (e.g. 1.9.12): dev branch
  5. Which demo exhibits the problem (if applicable): demo_pipeline_cnmfE
  6. How you installed Caiman (pure conda, conda + compile, colab, ..): conda + compile (I think? conda and then editable install)
  7. Details:

The demo demo_pipeline_cnmfE produces the following error. This seems to be due to #1239, and I believe the fix is to just update the name of the key in greedyROI_corr to 'temporal'.

Traceback (most recent call last):
  File "/home/ethan/mambaforge/envs/caiman/lib/python3.11/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/home/ethan/mambaforge/envs/caiman/lib/python3.11/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
           ^^^^^^^^^^^^^^^^
  File "/synology/code/CalciumImaging/CaImAn/caiman/source_extraction/cnmf/map_reduce.py", line 113, in cnmf_patches
    cnm = cnm.fit(images)
          ^^^^^^^^^^^^^^^
  File "/synology/code/CalciumImaging/CaImAn/caiman/source_extraction/cnmf/cnmf.py", line 490, in fit
    self.initialize(Y)
  File "/synology/code/CalciumImaging/CaImAn/caiman/source_extraction/cnmf/cnmf.py", line 949, in initialize
    extra_1p = initialize_components(
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/synology/code/CalciumImaging/CaImAn/caiman/source_extraction/cnmf/initialization.py", line 333, in initialize_components
    Ain, Cin, _, b_in, f_in, extra_1p = greedyROI_corr(
                                        ^^^^^^^^^^^^^^^
  File "/synology/code/CalciumImaging/CaImAn/caiman/source_extraction/cnmf/initialization.py", line 1171, in greedyROI_corr
    o = options['temporal_params'].copy()
        ~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'temporal_params'
pgunn commented 7 months ago

This is already fixed in dev; I thought I had gotten it out there in the last (bugfix) release but I guess not. I'll cut another release to get it out there soon.

ethanbb commented 7 months ago

Ah my bad! I should have pulled from dev before testing.