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

Obscure Error message when connecting to ExternalPopulation #1

Open
nicain opened this issue Sep 10, 2015 · 1 comment
Open

Obscure Error message when connecting to ExternalPopulation #1

nicain opened this issue Sep 10, 2015 · 1 comment
Assignees

Comments

@nicain
Copy link
Contributor

nicain commented Sep 10, 2015

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 nicain self-assigned this Sep 10, 2015
@nicain
Copy link
Contributor Author

nicain commented Sep 10, 2015

_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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant