NeuralEnsemble / PyNN

A Python package for simulator-independent specification of neuronal network models.
Other
276 stars 126 forks source link

Provide an abstract class hierarchy for the common interface #689

Open ystradmann opened 3 years ago

ystradmann commented 3 years ago

Hi,

for clarification of the types and methods a backend has to implement, it would be nice if pyNN's interface would be defined by python's Abstract Base Classes. The corresponding PEP 3119 constitutes the usage of ABCs (among others) as

In addition, the ABCs define a minimal set of methods that establish the characteristic behavior of the type. Code that discriminates objects based on their ABC type can trust that those methods will always be present.

– which describes the requirement of all pyNN backends to behave similarly very well.

I see several advantages from such an architecture:

I am aware that implementing this concept might require refactoring of substantial parts of the codebase. This issue should therefore be understood as a suggestion for a potential enhancement of pyNN; it's in no way to be seen as a bug report.

Best, Yannik

apdavison commented 3 years ago

Many thanks for creating this issue, @ystradmann. This is indeed one of the tasks we have planned before releasing PyNN 1.0, it is good to have an issue for it.

ystradmann commented 3 years ago

That's awesome, thanks a lot for your great work!