From 7c2135cfbe0923a5c227a680fbd657c496943f6f Mon Sep 17 00:00:00 2001 From: Mayo Faulkner Date: Thu, 27 Jun 2024 11:11:21 +0100 Subject: [PATCH 1/2] fix to check for incorrect namespace when sync is nidq --- ibllib/pipes/dynamic_pipeline.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ibllib/pipes/dynamic_pipeline.py b/ibllib/pipes/dynamic_pipeline.py index 9abce0a46..17c0b2bc4 100644 --- a/ibllib/pipes/dynamic_pipeline.py +++ b/ibllib/pipes/dynamic_pipeline.py @@ -162,9 +162,8 @@ def _sync_label(sync, acquisition_software=None, **_): str The sync label for determining the extractor tasks. """ - if sync == 'nidq' and acquisition_software == 'timeline': - return 'timeline' - return sync + + return acquisition_software if (sync == 'nidq' and acquisition_software != 'spikeglx') else sync def make_pipeline(session_path, **pkwargs): @@ -279,7 +278,10 @@ def make_pipeline(session_path, **pkwargs): # - choice_world_habituation if 'passiveChoiceWorld' in protocol: registration_class = btasks.PassiveRegisterRaw - behaviour_class = getattr(btasks, 'PassiveTask' + sync_label.capitalize()) + try: + behaviour_class = getattr(btasks, 'PassiveTask' + sync_label.capitalize()) + except AttributeError: + raise NotImplementedError(f'No passive task available for sync namespace "{sync_label}"') compute_status = False elif 'habituation' in protocol: registration_class = btasks.HabituationRegisterRaw @@ -287,7 +289,10 @@ def make_pipeline(session_path, **pkwargs): compute_status = False else: registration_class = btasks.TrialRegisterRaw - behaviour_class = getattr(btasks, 'ChoiceWorldTrials' + sync_label.capitalize()) + try: + behaviour_class = getattr(btasks, 'ChoiceWorldTrials' + sync_label.capitalize()) + except AttributeError: + raise NotImplementedError(f'No trials task available for sync namespace "{sync_label}"') compute_status = True tasks[f'RegisterRaw_{protocol}_{i:02}'] = type(f'RegisterRaw_{protocol}_{i:02}', (registration_class,), {})( **kwargs, **task_kwargs) From 780126b6880f2965d711af295165efedd44e459f Mon Sep 17 00:00:00 2001 From: Mayo Faulkner Date: Thu, 27 Jun 2024 11:43:17 +0100 Subject: [PATCH 2/2] account for no acquisition software --- ibllib/pipes/dynamic_pipeline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibllib/pipes/dynamic_pipeline.py b/ibllib/pipes/dynamic_pipeline.py index 17c0b2bc4..a4f2d5735 100644 --- a/ibllib/pipes/dynamic_pipeline.py +++ b/ibllib/pipes/dynamic_pipeline.py @@ -163,7 +163,7 @@ def _sync_label(sync, acquisition_software=None, **_): The sync label for determining the extractor tasks. """ - return acquisition_software if (sync == 'nidq' and acquisition_software != 'spikeglx') else sync + return acquisition_software if (sync == 'nidq' and acquisition_software not in ('spikeglx', None)) else sync def make_pipeline(session_path, **pkwargs):