From 3869b56b4b7d5560b517f2226dcc6041b5593843 Mon Sep 17 00:00:00 2001 From: Alex Serenko Date: Thu, 17 Oct 2024 19:53:16 +0300 Subject: [PATCH] Add parentheses to the line where conn_spec == one_to_one is checked Previously, one_to_one_cspec was a boolean if isinstance(conn_spec, dict), and a string otherwise. This was obviously a mistake. Note that everywhere further in _process_input_nodes() one_to_one_cspec is always used within an if clause, thus expecting it to be boolean. --- pynest/nest/lib/hl_api_connection_helpers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pynest/nest/lib/hl_api_connection_helpers.py b/pynest/nest/lib/hl_api_connection_helpers.py index 3f1e68851f..ac95e7fdd5 100644 --- a/pynest/nest/lib/hl_api_connection_helpers.py +++ b/pynest/nest/lib/hl_api_connection_helpers.py @@ -291,7 +291,10 @@ def _process_input_nodes(pre, post, conn_spec): # check for 'one_to_one' conn_spec one_to_one_cspec = ( - conn_spec if not isinstance(conn_spec, dict) else conn_spec.get("rule", "all_to_all") == "one_to_one" + ( + conn_spec if not isinstance(conn_spec, dict) + else conn_spec.get("rule", "all_to_all") + ) == "one_to_one" ) # check and convert input types