@@ -522,13 +522,13 @@ def get_input_index(block: Block, edge: dict, block_to_input_index: dict) -> int
522522 if isinstance (block , Adder ):
523523 if block .operations :
524524 return int (edge ["targetHandle" ].replace ("target-" , "" ))
525- else :
526- # make sure that the target block has only one input port (ie. that targetHandle is None)
527- assert edge ["targetHandle" ] is None , (
528- f"Target block { block .id } has multiple input ports, "
529- "but connection method hasn't been implemented."
530- )
531- return block_to_input_index [block ]
525+
526+ # make sure that the target block has only one input port (ie. that targetHandle is None)
527+ assert edge ["targetHandle" ] is None , (
528+ f"Target block { block .id } has multiple input ports, "
529+ "but connection method hasn't been implemented."
530+ )
531+ return block_to_input_index [block ]
532532
533533
534534# TODO here we could only pass edge and not block
@@ -566,13 +566,13 @@ def get_output_index(block: Block, edge: dict) -> int:
566566 # Function and ODE outputs are always in order, so we can use the handle directly
567567 assert edge ["sourceHandle" ], edge
568568 return int (edge ["sourceHandle" ].replace ("source-" , "" ))
569- else :
570- # make sure that the source block has only one output port (ie. that sourceHandle is None)
571- assert edge ["sourceHandle" ] is None , (
572- f"Source block { block .id } has multiple output ports, "
573- "but connection method hasn't been implemented."
574- )
575- return 0
569+
570+ # make sure that the source block has only one output port (ie. that sourceHandle is None)
571+ assert edge ["sourceHandle" ] is None , (
572+ f"Source block { block .id } has multiple output ports, "
573+ "but connection method hasn't been implemented."
574+ )
575+ return 0
576576
577577
578578def make_connections (nodes , edges , blocks ) -> list [Connection ]:
0 commit comments