Source code for pycif.utils.classes.meteos

from types import MethodType

from .baseclass import Plugin, PluginError


[docs] class Meteo(Plugin):
[docs] def initiate_template(self): super(Meteo, self).initiate_template( plg_type="meteo", default_functions={"write": True, "read": True, "fetch": False} )
[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(Meteo, cls).register_plugin( name, version, module, plugin_type="meteo", subtype=subtype )
[docs] def read(self, name, metdir, metfile, dates): """Get meteo from pre-computed meteo and load them into a pyCIF variables Args: self: the model Plugin name: the name of the component tracdir, tracfile: flux directory and file format dates: list of dates to extract """ raise PluginError('The function read was not defined')