From c45b9aa5f91081f245883258fac72aa955fb1bd8 Mon Sep 17 00:00:00 2001 From: Pat Gunn Date: Fri, 26 Apr 2024 14:28:07 -0400 Subject: [PATCH] Fix goof in last hotfix to CNMFParams --- caiman/source_extraction/cnmf/params.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/caiman/source_extraction/cnmf/params.py b/caiman/source_extraction/cnmf/params.py index bc468d88c..398fc754b 100644 --- a/caiman/source_extraction/cnmf/params.py +++ b/caiman/source_extraction/cnmf/params.py @@ -1124,8 +1124,8 @@ def change_params(self, params_dict, allow_legacy:bool=True, warn_unused:bool=Tr consumed = {} # Keep track of what parameters in params_dict were used to set something in params (just for legacy API) nagged_once = False # So we don't nag people multiple times in the same call - for paramkey in params_dict and isinstance(params_dict[paramkey], dict): # Latter half is because of scoped keys with the same name as categories, because we apparently have those. ring_CNN is an example. - if paramkey in list(self.__dict__.keys()): # Proper pathed part + for paramkey in params_dict: + if paramkey in list(self.__dict__.keys()) and isinstance(params_dict[paramkey], dict): # Handle proper pathed part. Latter half of the conditional is because of scoped keys with the same name as categories, because we apparently have those. ring_CNN is an example. cat_handle = getattr(self, paramkey) for k, v in params_dict[paramkey].items(): if k == 'nb' and paramkey != 'init':