Source code for pycif.utils.classes.fluxes

from types import MethodType

from .baseclass import Plugin


[docs] class Flux(Plugin): """Plugin type for surface flux data streams. A DataStream sub-type for reading and writing surface flux fields (e.g. CO₂ or CH₄ emissions). Concrete implementations live in ``pycif/plugins/datastreams/fluxes/``. """
[docs] @classmethod def register_plugin(cls, name, version, module, subtype="", **kwargs): """Register a module for a plugin and version with possibly options Args: name (str): name of the plugin version (str): version of the plugin module (types.ModuleType): module defining the interface between pyCIF and the plugin plugin_type (str): type of plugin **kwargs (dictionary): default options for module """ super(Flux, cls).register_plugin( name, version, module, plugin_type="flux", subtype=subtype )
[docs] def initiate_template(self): """Initialise the Flux plugin template. Loads the registered flux module and attaches ``write`` and ``read`` as bound methods, and ``fetch`` as a static function on this instance. """ super(Flux, self).initiate_template( plg_type="flux", default_functions={"write": True, "read": True, "fetch": False} )