-
Notifications
You must be signed in to change notification settings - Fork 191
Fix __eq__ functions for disparate types #1588
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
Conversation
|
Added tests, which revealed an odd case: ens = nengo.Ensemble(10, 1, neuron_type=nengo.LIF())
old_neurons = ens.neurons
ens.neuron_type = nengo.RectifiedLinear()
assert ens.neurons == old_neuronsThis assertion passes at the moment, but should we consider two |
EDIT: What you pointed out in 2 would actually happen in the case of EDIT2: I ran 1 on my machine, and I get them not equal. |
|
Yeah 1. was a mistake, I mixed up the cases I was testing. For 2, we could change the behaviour (if we wanted) by storing the |
|
I wouldn't want that connection to break because the If I could, I would change |
|
I remember us talking about removing the multiple-learning-rules-on-one-connection functionality (since it isn't really used), which would make that even easier. I'll just leave all the current behaviour as-is for now, and we can worry about it if/when the time comes. |
Co-authored-by: Daniel Rasmussen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added tests and changelog, looks good.
Motivation and context:
Bug in our
__eq__functions forNeuronsandLearningRulemeant that if you tried to compare it with another type, it would result in an error (because it wouldn't have the attributes we use to do the check). So just check the type first.How has this been tested?
Tested that this fixed the problem in the situation that it came up.
How long should this take to review?
Types of changes:
Checklist: