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

Improve error when providing a Connector type instead of an instance in mock.Projection #692

Closed
muffgaga opened this issue Nov 25, 2020 · 0 comments · Fixed by #738
Closed
Milestone

Comments

@muffgaga
Copy link
Contributor

master HEAD in the mock backend throws an error in …/pyNN/mock/projections.py line 43.
(We used the test introduced in PR #691.)

Traceback (most recent call last):
  File "test/system/test_speed_mock.py", line 201, in test_scaling                                                                                                                   
    self.do_scaling_test(N)                          
  File "test/system/test_speed_mock.py", line 179, in do_scaling_test 
    proj = sim.Projection(        
  File "…/pyNN/mock/projections.py", line 43, in __init__
    connector.connect(self)
TypeError: connect() missing 1 required positional argument: 'projection'

when providing a Connector type instead of an instance when creating a Projection:

proj = sim.Projection(pre, post, sim.OneToOneConnector, synapse_type=sim.StaticSynapse(weight=1.0))

The error itself is probably correct, but the error message could be improved to better explain the user error.

@muffgaga muffgaga changed the title User-friendly error when providing a type instead of an instance of an Connector in Projection Improve error when providing a Connector type instead of an instance in mock.Projection Nov 25, 2020
@apdavison apdavison added this to the 0.10.0 milestone Dec 22, 2020
apdavison added a commit to apdavison/PyNN that referenced this issue Nov 9, 2021
… user-friendly error message.

Also change the AssertionError when checking the synapse_type argument to a TypeError

Closes NeuralEnsemble#692
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants