Source code for pycif.plugins.datastreams.fluxes.flux_plugin_template.write
from .....utils.check.errclass import CifError
[docs]
def write(self, name, flx_file, flx, mode="a", **kwargs):
"""Not implemented in this template: writing template fluxes.
``write`` is optional: implement it only if your new plugin needs to
dump fluxes back to disk (e.g. for a forward run producing outputs in
the plugin's native format). Leaving it raising
:class:`~pycif.utils.check.errclass.CifError` like here is a valid
choice for a read-only plugin.
Args:
self: the fluxes Plugin.
name (str): name of the component.
flx_file (str): the file where to write fluxes.
flx (xarray.DataArray): flux data to write.
mode (str): ``"w"`` to overwrite, ``"a"`` to append.
**kwargs: unused, kept for interface compatibility.
Raises:
CifError: always, in this template implementation.
"""
raise CifError("Can't write template fluxes so far")