dipde icon indicating copy to clipboard operation
dipde copied to clipboard

Obscure Error message when connecting to ExternalPopulation

Open nicain opened this issue 10 years ago • 1 comments

When an ExternalPopulation is accidentally set as the target of a connection, the model construction fails with an obscure error message that is unhelpful for debugging. A check should be made when the connection is attempted, and a more helpful debugging exception should be thrown.

nicain avatar Sep 10 '15 18:09 nicain

_Error message:_

conn_dist = ConnectionDistribution(self.target.edges, self.weights, self.probs) AttributeError: 'ExternalPopulation' object has no attribute 'edges'

_Minimal code to reproduce the error:_

from dipde.internals.externalpopulation import ExternalPopulation
from dipde.internals.simulation import Simulation
from dipde.internals.connection import Connection as Connection

b1 = ExternalPopulation('100', record=True)
b2 = ExternalPopulation('100', record=True)
b1_b2 = Connection(b1, b2, 1, weights=[.005], probs=[1.], delay=0.0)
simulation = Simulation([b1, b2], [b1_b2])
simulation.run(dt=.001, tf=.1, t0=0)

nicain avatar Sep 10 '15 18:09 nicain