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
630 stars 368 forks source link

implement type checks and better error messages when creating `CNMFParams` #1039

Open kushalkolar opened 1 year ago

kushalkolar commented 1 year ago

Just got this idea from an issue that a user told me about, they tried to set gSig_filt as an int instead of Tuple[int, int].

EricThomson commented 1 year ago

There is a check_consistency() method in Params object that is used when change_params() is called, but not when parameters are initially set (maybe b/c parameters not explicitly defined on initialization go to defaults, but I'm not sure -- and even if so that shouldn't stop us from checking).

It might be useful to use check_consistency() as a model for how to do this. It is kind of a mish-mash of things that is not super well documented. This is the kind of thing that would be easier if the parameters object were defined independently for each main algorithm type.