arts_agenda
- pyarts.workspace.arts_agenda(func=None, *, ws=None, fix=False)[source]
Creates an agenda by parsing the supported expressions into Workspace Method calls.
Examples
These all produce the same Agenda, with minor modifications on how it is stored.
from pyarts.workspace import Workspace, arts_agenda, callback_operator @arts_agenda def propmat_clearsky_agenda(ws): ws.propmat_clearskyInit() ws.propmat_clearskyAddLines() ws.Ignore(ws.rtp_los) ws = Workspace() ws.propmat_clearsky_agenda = propmat_clearsky_agenda
from pyarts.workspace import Workspace, arts_agenda, callback_operator ws = Workspace() @arts_agenda(ws=ws) def propmat_clearsky_agenda(ws): ws.propmat_clearskyInit() ws.propmat_clearskyAddLines() ws.Ignore(ws.rtp_los)
from pyarts.workspace import Workspace, arts_agenda, callback_operator ws = Workspace() @arts_agenda(ws=ws, fix=True) def propmat_clearsky_agenda(ws): ws.propmat_clearskyInit() ws.propmat_clearskyAddLines()
from pyarts.workspace import Workspace, arts_agenda, callback_operator ws = Workspace() @arts_agenda(ws=ws, fix=True) def propmat_clearsky_agenda(ws): ws.propmat_clearskyInit() ws.propmat_clearskyAddLines(ws.propmat_clearsky, # By pos lines_sparse_df=0) # By name
Additional options
We support some additional functionality of python beyond just calling workspace methods.
from pyarts.workspace import Workspace, arts_agenda, callback_operator ws = Workspace() @arts_agenda(ws=ws, fix=True) def propmat_clearsky_agenda(ws): ws.propmat_clearsky = [] ws.x = ws.f_grid
from pyarts.workspace import Workspace, arts_agenda, callback_operator def fun(f_grid): x = f_grid return x ws = Workspace() @arts_agenda(ws=ws, fix=True) def propmat_clearsky_agenda(ws): fun() # This will set x to f_grid
- param func:
The function to be turned into an Agenda
- type func:
function
- param ws:
The workspace to put this onto after finalization, defaults to None
- type ws:
~pyarts.workspace.Workspace, optional
- param fix:
Whether to fix missing input/output in finalization, defaults to False
- type fix:
bool, optional