Skip to content

Commit

Permalink
Add parentheses to the line where conn_spec == one_to_one is checked
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aserenko committed Oct 17, 2024
1 parent c4e2433 commit 3869b56
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pynest/nest/lib/hl_api_connection_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3869b56

Please sign in to comment.