Closed dopplershift closed 9 years ago
I like the inheritance approach, but think the simple function tack may be more versatile in the end. It's hard to predict how people will want to use/abuse this. I'll do this now.
Inheritance would be a clear for many languages; one of the things about Python is that, given the way it handles functions, you can make just as clean a design using functions.
Looks good so far. I see one part of the design that I would change. Right now, all of the different models are implemented in the main class:
I would change this in one of two ways. First way, use inheritance to implement new models:
In general, this would let you later add more methods to encapsulate other parts of the models (maybe calculation of
dmu_dt
). On the other hand, for just encapsulating models ofdtheta_dt
, you could just use functions, since it looks like all of them only need a few variables:Besides being lightweight, this could also let you mix and match different functions for
dtheta_dt
anddmu_dt
.