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
A better high-level API for building models from components #65
Comments
As of brian-rose@74c9cd5 it is now possible to The new API is used test_cam3rad.py. There is not much in the way of "smart" coupling just yet, but it's a start. To make this work in a sensible way, I have added an optional But now if every |
Some sensible behavior when the user invokes
|
On further reflection, I'm not sure about my first point above. It implies that A more conservative version would be to just declare as |
The original vision for climlab was an environment in which the user is free to build complete models from components simply and easily.
I think that as the complexity of the components available in climlab has grown, we have actually moved farther away from that goal. Consider the currently supported way to construct a single-column radiative-convective model with interactive water vapor (e.g. as found in the documentation for the Emanuel convection scheme):
This is ridiculously verbose, and requires the user to think carefully about exactly which subset of the state variable dictionary is needed for each component. We also had to explicitly create a parent Process called
model
whose only job is to be a container for the other components.I'm envisioning a new API that would automate a lot of the coupling of components into subprocesses of a new parent process. It would be great to be able to explicitly
__add__
subprocesses like this:where the
model
that is returned is:specific_humidity
input field forrad
is set appropriately.The text was updated successfully, but these errors were encountered: