JGCRI / cassandra

Human-earth system multi-scale model coupling framework
Other
6 stars 3 forks source link

Add configuration option to squelch one or more of a component's capabilities #62

Open rplzzz opened 4 years ago

rplzzz commented 4 years ago

The idea behind capabilities is that for a component that provides a particular capability, we should be able to substitute a different component that provides the same capability, and the system will still run. This gets a little complicated for components that provide multiple capabilities. What if you want to replace one capability but keep the rest?

To make this possible, we need a configuration option to direct a component not to export some of its capabilities. We want to make this happen entirely within the framework functions, so that nothing in any of the component's code has to do anything special to honor the request.

Off the top of my head, I think the best way to do this is to have the ComponentBase.__init__ method store the list of capabilities to be squelched, and then ComponentBase.addCapability could check the list before adding the capability. We would probably also need to modify ComponentBase.addResults to be aware of the possibility that a capability had been squelched.