From 4308f6d79debd7cdd8483ef89556ef1c38c998a8 Mon Sep 17 00:00:00 2001 From: Miles Wells Date: Thu, 17 Oct 2024 16:14:14 +0300 Subject: [PATCH] Handle empty tasks key --- ibllib/io/session_params.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibllib/io/session_params.py b/ibllib/io/session_params.py index 6e4848a40..e9127e9ae 100644 --- a/ibllib/io/session_params.py +++ b/ibllib/io/session_params.py @@ -175,7 +175,7 @@ def merge_params(a, b, copy=False): if k == 'tasks': # For tasks, keep order and skip duplicates # Assert tasks is a list of single value dicts - assert set(map(len, prev)) == {1} and set(map(len, b[k])) == {1} + assert (not prev or set(map(len, prev)) == {1}) and set(map(len, b[k])) == {1} # Convert protocol -> dict map to hashable tuple of protocol + sorted key value pairs to_hashable = lambda itm: (itm[0], *chain.from_iterable(sorted(itm[1].items()))) # noqa # Get the set of previous tasks