Thanks all for the clarifications. I'm still not clear on the relationship
between the number of parameters to the function you provide and the
input-dimensionality of a Node.

To push this design a bit, how would you specify a node that should e.g.
log some spikes to a file if some decoded value is > 0, and we're more than
5 seconds into a simulation? Is that something a Node can do?


On Wed, Dec 11, 2013 at 8:58 AM, Trevor Bekolay <notifications@github.com>wrote:

> In nengo/nonlinearities.py:
>
> > @@ -31,6 +40,22 @@ def __deepcopy__(self, memo):
> >                      rval.__dict__[k] = copy.deepcopy(v, memo)
> >              return rval
> >
> > +    @property
> > +    def n_args(self):
> > +        if isinstance(self.fn, np.ufunc) and self.fn.nin == 1:
> > +            return 1
> > +
> > +        argspec = inspect.getargspec(self.fn)
>
> Ah, interesting, didn't know that about builtins. Perhaps there should be
> a method to manually specify this? To avoid the situation where calling the
> function has undesirable side-effects. Or is it enough to just assume
> n_args is 1 for builtins?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/ctn-waterloo/nengo/pull/224/files#r8266673>
> .
>