The vortex module#
Versatile Objects Rounded-up in a Toolbox for Environmental eXperiments
VORTEX is a set of objects for basic resources handling in the context of numerical weather prediction. Objects should be versatile enough to be used either in an operational or research environment.
The user is provided with a standard interface for the description of miscellaneaous resources (constants, climatological files, executable models, etc.) with could be used as standalone objects or gathered inside a logical layout defining the workflow of the experiment (configurations, bunches, tasks, etc.).
Using the vortex modules implies the setting of a default session, as delivered
by the vortex.sessions. The current session could be changed and simultaneous
sessions could coexist.
Advanced users could access to specific classes of objects, but the use
of the very high level interface defined in the vortex.toolbox module is
strongly advised.
- vortex.diff(*args, **kw)[source]#
Perform a diff with a resource with the same local name.
The kw dictionary may contain keys that influence this function behaviour (such attributes are popped from kw before going further):
fatal: If True, a
ValueErrorexception will be raised whenever the “diff” detects differences.loglevel: The logging facility verbosity level that will be used during the
Sectioncreation process. If None, nothing is done (i.e. the current verbosity level is preserved). (default: None).verbose: If True, print some informations on the standard output (The default is given by
active_verbose).
The remaining kw items are passed directly to the
rload()function in order to create the resource’sHandlerobjects for the reference files.The reference files resource’s
Handlerobjects are altered so that the reference files are stored in temporary Containers.The reference files are fetched.
The diff between the containers described in the resource’s description and the reference files is computed.
- Returns:
A list of diff results.
- vortex.executable(*args, **kw)[source]#
Declare one or more executable resources.
This function takes an abitrary of keyword arguments forming the executable resource description.
- Returns:
A list of
Handlerobjects.
Example:
The following call to
inputreturns a list of oneHandlerobject:rhandlers = vortex.executable( kind="mfmodel", local="ARPEGE", remote="/path/to/binaries/ARPEGE.EX", )
- vortex.input(*args, **kw)[source]#
Declare one or more input resources.
This function takes an abitrary of keyword arguments forming the resource description.
- Returns:
A list of
Handlerobjects.
Example:
The following call to
inputreturns a list of 6Handlerobjects, one for each date and member:rhandlers = vortex.input( kind='gridpoint', term=1, geometry='eurw1s40', nativefmt='grib', model='arome', cutoff='production', date=['2024060121', '2024060122'], origin='historic', vapp='arome', vconf='pefrance', member=[1,2,5], experiment='myexp', block='forecast', local='gribfile_[member].grib', format='grib', )
- vortex.loaded_plugins() Set[str][source]#
Return the set of names for loaded plugins
Example:
>>> import vortex >>> vortex.loaded_plugins() {"gco", "cen"}
- vortex.output(*args, **kw)[source]#
Declare one or more output resources.
This function takes an abitrary of keyword arguments forming the resource description.
- Returns:
A list of
Handlerobjects.
Example:
The following call to
outputreturns a list of 6Handlerobjects, one for each date and member:rhandlers = vortex.output( kind='gridpoint', term=1, geometry='eurw1s40', nativefmt='grib', model='arome', cutoff='production', date=['2024060121', '2024060122'], origin='historic', vapp='arome', vconf='pefrance', member=[1,2,5], experiment='myexp', block='forecast', local='gribfile_[member].grib', format='grib', )
- vortex.promise(*args, **kw)[source]#
Log promises before execution.
Relies on the
add_section()function (see its documentation), with:It’s
sectionattribute is automatically set to ‘output’;The
kw’s promised item is set to True;The
kw’s force item is set to True;The
kw’s now item is set toactive_promise.
- Returns:
A list of
vortex.data.handlers.Handlerobjects (associated with the newly created class:~vortex.layout.dataflow.Section objects).
- vortex.task(*args, **kw)#
Load an algo component and display its description (if verbose).
The kw dictionary may contain keys that influence this function behaviour (such attributes are popped from kw before going further):
loglevel: The logging facility verbosity level that will be used during the
Sectioncreation process. If None, nothing is done (i.e. the current verbosity level is preserved). (default: None).verbose: If True, print some informations on the standard output (The default is given by
active_verbose).
- The remaining kw items are passed directly to the “algo” footprint’s
proxy in order to create the AlgoComponent object.
- Returns:
an object that is a subtype of
vortex.algo.components.AlgoComponent