nengo / nengo-loihi

Run Nengo models on Intel's Loihi chip
https://www.nengo.ai/nengo-loihi/
Other
35 stars 12 forks source link

Refactor block.py #270

Open tbekolay opened 4 years ago

tbekolay commented 4 years ago

In #261 I had some questions about why a spike is None condition was necessary. In investigating that, I started refactoring Axon to reduce the number of ways you could misuse it, as currently it requires you to construct it, then set the target outside of the Axon constructor, and then call set_compartment_axon_map, and if you don't do one of those steps it will either fail or give you undocumented behavior.

While I was able to alleviate those concerns, when I tired to remove the possibility of returning None instead of a spike it became obvious that several classes inside block.py have similar assumptions, and so several unit tests were failing (despite many integration tests passing). This made me think that there are likely several more issues in how the classes in block.py are designed versus how they are actually used in Nengo Loihi, and that seemed outside of the scope of the original issue, so I stopped there. We can pick up this refactoring later if we want.