HWRF  trunk@4391
Functions | Variables
hwrf.rocoto Namespace Reference

This module contains utilities for plugging HWRF into the Rocoto workflow manager. More...

Detailed Description

This module contains utilities for plugging HWRF into the Rocoto workflow manager.

Functions

def entity_quote (string)
 Returns a copy of the string with & " < % and > replaced with their respective XML entities &#38; &#34; &#60; &#37; and &#62;. More...
 
def sanity_check_failed (logger, ex)
 Logs information about a failure of a sanity check routine. More...
 
def cycles_as_entity (cycleset)
 Returns a set of Rocoto XML <cycledef> tags to add to an XML file. More...
 

Variables

list __all__ = ['cycles_as_entity']
 List of symbols exported by "from hwrf.rocoto import *".
 
tuple epsilon = to_timedelta(5)
 An epsilon value for time equality comparisons.
 
tuple six_hours = to_timedelta(6*3600)
 A datetime.timedelta that represents +6 hours.
 
tuple sanity_quotes
 A list of quotes to print (one at random) when a sanity check fails. More...
 

Function Documentation

def hwrf.rocoto.cycles_as_entity (   cycleset)

Returns a set of Rocoto XML <cycledef> tags to add to an XML file.

The tags will define the list of cycles specified in the cycleset argument. That argument must be a set of datetime objects.

Parameters
cyclesetan iterable of cycles to convert. These can be anything accepted by hwrf.numerics.to_datetime()

Definition at line 162 of file rocoto.py.

def hwrf.rocoto.entity_quote (   string)

Returns a copy of the string with & " < % and > replaced with their respective XML entities &#38; &#34; &#60; &#37; and &#62;.

Parameters
stringthe string to parse.
Returns
a new string with proper replacements

Definition at line 139 of file rocoto.py.

def hwrf.rocoto.sanity_check_failed (   logger,
  ex 
)

Logs information about a failure of a sanity check routine.

The failure is in exception ex, and the "logger" argument must be a logging.Logger.

Parameters
exthe failure information
loggera logging.Logger for log messages

Definition at line 150 of file rocoto.py.

Variable Documentation

hwrf.rocoto.sanity_quotes

A list of quotes to print (one at random) when a sanity check fails.

The purpose of this is to assure the user that he/she/it is not alone in lacking sanity; and that sanity, perhaps, is not something that one should strive for anyway.

Definition at line 27 of file rocoto.py.