Skip to content
This repository has been archived by the owner on Oct 31, 2020. It is now read-only.

Multiple functions with same name from same population become one #423

Open
arvoelke opened this issue Jan 23, 2014 · 0 comments
Open

Multiple functions with same name from same population become one #423

arvoelke opened this issue Jan 23, 2014 · 0 comments
Labels

Comments

@arvoelke
Copy link

For example,

net.connect('A', 'B', func=lambda x:2*x)
net.connect('A', 'C', func=lambda x:3*x)

This creates only a single origin with name 'lambda', which computes the first function. So the connections to population C are unexpectedly wrong.

This could be fixed in _parse_pre of nef_core.py by appending id(func) to the function name. We could also do something smarter like maintain a dict of name -> id(func), and then only make the names more verbose if a collision is detected (so here the two names would be 'lambda' and 'lambda 1').

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

1 participant