nengo-1.4 icon indicating copy to clipboard operation
nengo-1.4 copied to clipboard

If we give the name of an existing termination in net.connect it should use the existing termination

Open naruyan opened this issue 12 years ago • 3 comments

Right now if you give the name of an existing termination, it'll create a new termination rather than using the existing one. The only way to use an existing termination is to pass the termination itself.

Right now its required for scriptgen for terminations onto templates to work. It can be changed so scriptgen will try and keep track of existing terminations from templates but it'll be messy and I think it should be handled in the connect function as its much easier.

naruyan avatar Nov 08 '12 02:11 naruyan

Excellent idea. I think the main question would be what the syntax for this would be. Here's some options that come to mind for the general case of connecting an existing origin to an existing termination:

net.connect('A','B',origin='X',termination='input') # explicit labels net.connect('A:X','B:input') # using ':' as a separator for origins/terminations net.connect('A.X','B.input') # using '.' as a separator (even though it's already used for subnetworks) net.connect(('A','X'),('B','input')) # yuck

Any other ideas?

tcstewar avatar Nov 09 '12 00:11 tcstewar

I kind of like the ':' notation myself.

celiasmith avatar Nov 12 '12 21:11 celiasmith

I'll take a stab at supporting both of the first two approaches.

tcstewar avatar Nov 12 '12 21:11 tcstewar