RHESSysWorkflows  1.33
Static Public Member Functions | Static Public Attributes | List of all members
rhessysworkflows.metadata.RHESSysMetadata Class Reference

Handles metadata persistance for RHESSys workflows. More...

Inheritance diagram for rhessysworkflows.metadata.RHESSysMetadata:

Static Public Member Functions

def checkWorkflowVersion (projectDir)
 Check if metadata store is compatible with current version of RHESSysWorkflows. More...
 
def writeRHESSysEntry (context, key, value)
 Write a RHESSys entry to the metadata store for a given project. More...
 
def deleteRHESSysEntry (context, key)
 Delete a RHESSys entry from the metadata store for a given project. More...
 
def readRHESSysEntries (context)
 Read all RHESSys entries from the metadata store for a given project. More...
 
def checkWorkflowVersion (projectDir)
 Check if metadata store is compatible with current version of RHESSysWorkflows. More...
 
def writeRHESSysEntry (context, key, value)
 Write a RHESSys entry to the metadata store for a given project. More...
 
def deleteRHESSysEntry (context, key)
 Delete a RHESSys entry from the metadata store for a given project. More...
 
def readRHESSysEntries (context)
 Read all RHESSys entries from the metadata store for a given project. More...
 

Static Public Attributes

string VERSION_KEY = 'rhessysworkflows_version'
 
string MODEL_NAME = 'rhessys'
 
 RHESSYS_SECTION = MODEL_NAME
 
string RULES_DIR = 'rules'
 
 KNOWN_LC_TYPES = ecohydrolib.command.landcover.KNOWN_LC_TYPES
 
string LC_RULE_ROAD = 'road.rule'
 
string LC_RULE_IMPERVIOUS = 'impervious.rule'
 
string LC_RULE_LANDUSE = 'landuse.rule'
 
string LC_RULE_STRATUM = 'stratum.rule'
 
string LC_RULE_LAI_COMPAT = 'lai.rule'
 
string LC_RULE_LAI = 'lai-recode.rule'
 
list LC_RULES = [LC_RULE_ROAD, LC_RULE_IMPERVIOUS, LC_RULE_LANDUSE, LC_RULE_STRATUM, LC_RULE_LAI]
 
string SOILS_RULE = 'soils.rule'
 
list SOILS_RULES = [SOILS_RULE]
 

Detailed Description

Handles metadata persistance for RHESSys workflows.

Extends ecohydrolib.GenericMetadata class.

   @note All keys are stored in lower case.
   @note This object is stateless, all methods are static, writes to metadata store
   are written immediately.

Member Function Documentation

def rhessysworkflows.metadata.RHESSysMetadata.checkWorkflowVersion (   projectDir)
static

Check if metadata store is compatible with current version of RHESSysWorkflows.

Accepts project directory as this method is used in the constructor to the Context class.

Parameters
projectDir,thepath of the project whose metadata store is to be written to WorkflowVersionError if a version already exists in the metadata store and is different than RHESSysMetadata._workflowVersion
def rhessysworkflows.metadata.RHESSysMetadata.checkWorkflowVersion (   projectDir)
static

Check if metadata store is compatible with current version of RHESSysWorkflows.

Accepts project directory as this method is used in the constructor to the Context class.

Parameters
projectDir,thepath of the project whose metadata store is to be written to WorkflowVersionError if a version already exists in the metadata store and is different than RHESSysMetadata._workflowVersion
def rhessysworkflows.metadata.RHESSysMetadata.deleteRHESSysEntry (   context,
  key 
)
static

Delete a RHESSys entry from the metadata store for a given project.

Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be deleted from
keyThe key to be deleted from the RHESSys section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def rhessysworkflows.metadata.RHESSysMetadata.deleteRHESSysEntry (   context,
  key 
)
static

Delete a RHESSys entry from the metadata store for a given project.

Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be deleted from
keyThe key to be deleted from the RHESSys section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def rhessysworkflows.metadata.RHESSysMetadata.readRHESSysEntries (   context)
static

Read all RHESSys entries from the metadata store for a given project.

Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be read from
Exceptions
Adictionary of key/value pairs from the RHESSys section of the project metadata
def rhessysworkflows.metadata.RHESSysMetadata.readRHESSysEntries (   context)
static

Read all RHESSys entries from the metadata store for a given project.

Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be read from
Exceptions
Adictionary of key/value pairs from the RHESSys section of the project metadata
def rhessysworkflows.metadata.RHESSysMetadata.writeRHESSysEntry (   context,
  key,
  value 
)
static

Write a RHESSys entry to the metadata store for a given project.

Note
Will overwrite the value for a key that already exists
Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be written to
keyThe key to be written to the RHESSys section of the project metadata
valueThe value to be written for key stored in the RHESSys section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def rhessysworkflows.metadata.RHESSysMetadata.writeRHESSysEntry (   context,
  key,
  value 
)
static

Write a RHESSys entry to the metadata store for a given project.

Note
Will overwrite the value for a key that already exists
Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be written to
keyThe key to be written to the RHESSys section of the project metadata
valueThe value to be written for key stored in the RHESSys section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable

Member Data Documentation

rhessysworkflows.metadata.RHESSysMetadata.KNOWN_LC_TYPES = ecohydrolib.command.landcover.KNOWN_LC_TYPES
static
string rhessysworkflows.metadata.RHESSysMetadata.LC_RULE_IMPERVIOUS = 'impervious.rule'
static
string rhessysworkflows.metadata.RHESSysMetadata.LC_RULE_LAI = 'lai-recode.rule'
static
string rhessysworkflows.metadata.RHESSysMetadata.LC_RULE_LAI_COMPAT = 'lai.rule'
static
string rhessysworkflows.metadata.RHESSysMetadata.LC_RULE_LANDUSE = 'landuse.rule'
static
string rhessysworkflows.metadata.RHESSysMetadata.LC_RULE_ROAD = 'road.rule'
static
string rhessysworkflows.metadata.RHESSysMetadata.LC_RULE_STRATUM = 'stratum.rule'
static
list rhessysworkflows.metadata.RHESSysMetadata.LC_RULES = [LC_RULE_ROAD, LC_RULE_IMPERVIOUS, LC_RULE_LANDUSE, LC_RULE_STRATUM, LC_RULE_LAI]
static
string rhessysworkflows.metadata.RHESSysMetadata.MODEL_NAME = 'rhessys'
static
rhessysworkflows.metadata.RHESSysMetadata.RHESSYS_SECTION = MODEL_NAME
static
string rhessysworkflows.metadata.RHESSysMetadata.RULES_DIR = 'rules'
static
string rhessysworkflows.metadata.RHESSysMetadata.SOILS_RULE = 'soils.rule'
static
list rhessysworkflows.metadata.RHESSysMetadata.SOILS_RULES = [SOILS_RULE]
static
string rhessysworkflows.metadata.RHESSysMetadata.VERSION_KEY = 'rhessysworkflows_version'
static

The documentation for this class was generated from the following file: