brian-team/brian2modelfitting

Refactor `Inferencer`/`Fitter`

Opened this issue · 0 comments

Both classes have a lot in common (everything related to the Brian simulation), and should inherit from a common superclass to share the code. Another possible approach would be to put all the shared code in a separate class that neither Fitter nor Inferencer inherits from, and delegate to an object of that class (e.g. everything related to the simulation could be in a BrianSimulator class, and both Fitter and Inferencer would do something like self.brian_simulator = BrianSimulator(...) in their __init__ and then call self.brian_simulator... for all simulation-related tasks.) Actually, there is already a Simulator class (with implementations for runtime and standalone) – maybe some more code could simply move into this class.