Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error probing transform on connection #667

Closed
drasmuss opened this issue Feb 26, 2015 · 3 comments
Closed

Error probing transform on connection #667

drasmuss opened this issue Feb 26, 2015 · 3 comments
Labels
Milestone

Comments

@drasmuss
Copy link
Member

To replicate:

import nengo

with nengo.Network() as net:
    input = nengo.Node([0])

    a = nengo.Ensemble(10, 1)
    conn = nengo.Connection(input, a)

    nengo.Probe(conn, "transform")

sim = nengo.Simulator(net)

gives error:

Traceback (most recent call last):
  File "D:\Documents\officesvn\code\test.py", line 11, in <module>
    sim = nengo.Simulator(net)
  File "D:\Documents\nengogit\nengo\nengo\simulator.py", line 111, in __init__
    self.model.build(network)
  File "D:\Documents\nengogit\nengo\nengo\builder\builder.py", line 34, in build
    return Builder.build(self, *objs)
  File "D:\Documents\nengogit\nengo\nengo\builder\builder.py", line 74, in build
    cls.builders[obj_cls](model, obj, *args, **kwargs)
  File "D:\Documents\nengogit\nengo\nengo\builder\network.py", line 76, in build_network
    model.build(probe)
  File "D:\Documents\nengogit\nengo\nengo\builder\builder.py", line 34, in build
    return Builder.build(self, *objs)
  File "D:\Documents\nengogit\nengo\nengo\builder\builder.py", line 74, in build
    cls.builders[obj_cls](model, obj, *args, **kwargs)
  File "D:\Documents\nengogit\nengo\nengo\builder\probe.py", line 76, in build_probe
    synapse_probe(model, key, probe)
  File "D:\Documents\nengogit\nengo\nengo\builder\probe.py", line 37, in synapse_probe
    sig = sig[probe.slice]
  File "D:\Documents\nengogit\nengo\nengo\builder\signal.py", line 178, in __getitem__
    return self.__getitem__((item,))
  File "D:\Documents\nengogit\nengo\nengo\builder\signal.py", line 151, in __getitem__
    start, stop, stride = idx.indices(shape[ii])
IndexError: list index out of range

The problem is that the default transform is a zero dimensional array, so it breaks if you try to slice it (even if it's the default null slice).

@drasmuss drasmuss added the bug label Feb 26, 2015
@hunse
Copy link
Collaborator

hunse commented Feb 26, 2015

Zero-dimensional arrays are the bane of my existence :rage1: :rage2: :rage3: :rage4:

@hunse
Copy link
Collaborator

hunse commented Feb 26, 2015

We could probably just give transforms an ndmin of 1 or 2 in the parameter. This might actually simplify the code in some places.

@tbekolay
Copy link
Member

tbekolay commented Mar 4, 2015

Fixed in #671.

@tbekolay tbekolay closed this as completed Mar 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants