EcohydroWorkflowLib  0.973
 All Classes Namespaces Files Functions Variables Pages
Static Public Member Functions | Static Public Attributes | List of all members
ecohydroworkflowlib.metadata.GenericMetadata Class Reference

Handles metadata persistance. More...

Static Public Member Functions

def writeManifestEntry
 Write a manifest entry to the metadata store for a given project.
 
def writeStudyAreaEntry
 Write a study area entry to the metadata store for a given project.
 
def writeClimatePointEntry
 Write a point climate entry to the metadata store for a given project.
 
def writeClimateGridEntry
 Write a grid climate entry to the metadata store for a given project.
 
def readManifestEntries
 Read all manifest entries from the metadata store for a given project.
 
def readStudyAreaEntries
 Read all study area entries from the metadata store for a given project.
 
def readClimatePointEntries
 Read all point climate entries from the metadata store for a given project.
 
def readClimatePointStations
 Read all climate point stations from metadata and store in ClimatePointStation instances.
 
def readClimateGridEntries
 Read all grid climate entries from the metadata store for a given project.
 
def writeEntryToSection
 Write an entry in the given section to the metadata store for a given project.
 
def getCommandLine
 Return string representing original command line, as close as possible, used to run the command.
 
def writeManifestEntry
 Write a manifest entry to the metadata store for a given project.
 
def writeStudyAreaEntry
 Write a study area entry to the metadata store for a given project.
 
def writeClimatePointEntry
 Write a point climate entry to the metadata store for a given project.
 
def writeClimatePointEntries
 Write a point climate entries to the metadata store for a given project.
 
def writeClimateGridEntry
 Write a grid climate entry to the metadata store for a given project.
 
def writeClimateGridEntries
 Write grid climate entries to the metadata store for a given project.
 
def writeProvenanceEntry
 Write a provenance entry to the metadata store for a given project.
 
def writeProvenanceEntries
 Write provenance entries to the metadata store for a given project.
 
def readManifestEntries
 Read all manifest entries from the metadata store for a given project.
 
def readStudyAreaEntries
 Read all study area entries from the metadata store for a given project.
 
def readClimatePointEntries
 Read all point climate entries from the metadata store for a given project.
 
def readClimatePointStations
 Read all climate point stations from metadata and store in ClimatePointStation instances.
 
def readClimateGridEntries
 Read all grid climate entries from the metadata store for a given project.
 
def readProvenanceEntries
 Read all provenance entries from the metadata store for a given project.
 
def readAssetProvenanceObjects
 Read all asset provenance objects from metadata and store in AssetProvenance instances.
 
def getProcessingHistoryList
 
def appendProcessingHistoryItem
 

Static Public Attributes

string VALUE_DELIM ','
 
string KEY_SEP '_'
 
string METADATA_FILENAME 'metadata.txt'
 
string METADATA_LOCKFILE 'metadata.txt.lock'
 
string MANIFEST_SECTION 'manifest'
 
string PROVENANCE_SECTION 'provenance'
 
string HISTORY_SECTION 'history'
 
string STUDY_AREA_SECTION 'study_area'
 
string CLIMATE_POINT_SECTION 'climate_point'
 
string CLIMATE_GRID_SECTION 'climate_grid'
 
string COMPOUND_KEY_SEP '/'
 
list SECTIONS
 
string HISTORY_PROTO "processing%sstep%s"
 

Detailed Description

Handles metadata persistance.

Note
All keys are stored in lower case.
This object is stateless, all methods are static, writes to metadata store are written immediately.
Todo:
Implement lock file semantics as decorators
Note
All keys are stored in lower case.
This object is stateless, all methods are static, writes to metadata store are written immediately.
Todo:
Implement lock file semantics as decorators

Member Function Documentation

def ecohydroworkflowlib.metadata.GenericMetadata.appendProcessingHistoryItem (   projectDir,
  item 
)
static
def ecohydroworkflowlib.metadata.GenericMetadata.getCommandLine ( )
static

Return string representing original command line, as close as possible, used to run the command.

Will convert all paths in the command line to absolute path, if a non-path element has spaces in it, they will be quoted.

Returns
String with each element of sys.argv separated by a space
def ecohydroworkflowlib.metadata.GenericMetadata.getProcessingHistoryList (   projectDir)
static
def ecohydroworkflowlib.metadata.GenericMetadata.readAssetProvenanceObjects (   projectDir)
static

Read all asset provenance objects from metadata and store in AssetProvenance instances.

Parameters
projectDirAbsolute path of the project whose metadata are to be read
Returns
A list of AssetProvenance objects
def ecohydroworkflowlib.metadata.GenericMetadata.readClimateGridEntries (   projectDir)
static

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

Parameters
projectDirAbsolute path of the project whose metadata are to be read
Returns
A dictionary of key/value pairs from the grid climate section of the project metadata
def ecohydroworkflowlib.metadata.GenericMetadata.readClimateGridEntries (   projectDir)
static

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

Parameters
projectDirAbsolute path of the project whose metadata are to be read
Returns
A dictionary of key/value pairs from the grid climate section of the project metadata
def ecohydroworkflowlib.metadata.GenericMetadata.readClimatePointEntries (   projectDir)
static

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

Parameters
projectDirAbsolute path of the project whose metadata are to be read
Returns
A dictionary of key/value pairs from the point climate section of the project metadata
def ecohydroworkflowlib.metadata.GenericMetadata.readClimatePointEntries (   projectDir)
static

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

Parameters
projectDirAbsolute path of the project whose metadata are to be read
Returns
A dictionary of key/value pairs from the point climate section of the project metadata
def ecohydroworkflowlib.metadata.GenericMetadata.readClimatePointStations (   projectDir)
static

Read all climate point stations from metadata and store in ClimatePointStation instances.

Parameters
projectDirAbsolute path of the project whose metadata are to be read
Returns
A list of ClimatePointStation objects
def ecohydroworkflowlib.metadata.GenericMetadata.readClimatePointStations (   projectDir)
static

Read all climate point stations from metadata and store in ClimatePointStation instances.

Parameters
projectDirAbsolute path of the project whose metadata are to be read
Returns
A list of ClimatePointStation objects
def ecohydroworkflowlib.metadata.GenericMetadata.readManifestEntries (   projectDir)
static

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

Parameters
projectDirAbsolute path of the project whose metadata are to be read
Returns
A dictionary of key/value pairs from the manifest section of the project metadata
def ecohydroworkflowlib.metadata.GenericMetadata.readManifestEntries (   projectDir)
static

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

Parameters
projectDirAbsolute path of the project whose metadata are to be read
Returns
A dictionary of key/value pairs from the manifest section of the project metadata
def ecohydroworkflowlib.metadata.GenericMetadata.readProvenanceEntries (   projectDir)
static

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

Parameters
projectDirAbsolute path of the project whose metadata are to be read
Returns
A dictionary of key/value pairs from the provenance section of the project metadata
def ecohydroworkflowlib.metadata.GenericMetadata.readStudyAreaEntries (   projectDir)
static

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

Parameters
projectDirAbsolute path of the project whose metadata are to be read
Returns
A dictionary of key/value pairs from the study area section of the project metadata
def ecohydroworkflowlib.metadata.GenericMetadata.readStudyAreaEntries (   projectDir)
static

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

Parameters
projectDirAbsolute path of the project whose metadata are to be read
Returns
A dictionary of key/value pairs from the study area section of the project metadata
def ecohydroworkflowlib.metadata.GenericMetadata.writeClimateGridEntries (   projectDir,
  keys,
  values 
)
static

Write grid climate entries to the metadata store for a given project.

Note
Will overwrite the value for keys that already exist
Parameters
projectDirPath of the project whose metadata store is to be written to
keyList of keys to be written to the grid climate section of the project metadata
valueList of values to be written for keys stored in the grid climate section of the project metadata
         @exception IOError(errno.EACCES) if the metadata store for the project is not writable
         @exception Exception if len(keys) != len(values)
def ecohydroworkflowlib.metadata.GenericMetadata.writeClimateGridEntry (   projectDir,
  key,
  value 
)
static

Write a grid climate entry to the metadata store for a given project.

Note
Will overwrite a the value for a key that already exists
Parameters
projectDirPath of the project whose metadata store is to be written to
keyThe key to be written to the grid climate section of the project metadata
valueThe value to be written for key stored in the grid climate section of the project metadata
         @exception IOError(errno.EACCES) if the metadata store for the project is not writable
def ecohydroworkflowlib.metadata.GenericMetadata.writeClimateGridEntry (   projectDir,
  key,
  value 
)
static

Write a grid climate entry to the metadata store for a given project.

Note
Will overwrite the value for a key that already exists
Parameters
projectDirPath of the project whose metadata store is to be written to
keyThe key to be written to the grid climate section of the project metadata
valueThe value to be written for key stored in the grid climate section of the project metadata
         @exception IOError(errno.EACCES) if the metadata store for the project is not writable
def ecohydroworkflowlib.metadata.GenericMetadata.writeClimatePointEntries (   projectDir,
  keys,
  values 
)
static

Write a point climate entries to the metadata store for a given project.

Note
Will overwrite the value for keys that already exist
Parameters
projectDirPath of the project whose metadata store is to be written to
keysList of keys to be written to the point climate section of the project metadata
valuesList of values to be written for keys stored in the point climate section of the project metadata
         @exception IOError(errno.EACCES) if the metadata store for the project is not writable
         @exception Exception if len(keys) != len(values)
def ecohydroworkflowlib.metadata.GenericMetadata.writeClimatePointEntry (   projectDir,
  key,
  value 
)
static

Write a point climate entry to the metadata store for a given project.

Note
Will overwrite a the value for a key that already exists
Parameters
projectDirPath of the project whose metadata store is to be written to
keyThe key to be written to the point climate section of the project metadata
valueThe value to be written for key stored in the point climate section of the project metadata
         @exception IOError(errno.EACCES) if the metadata store for the project is not writable
def ecohydroworkflowlib.metadata.GenericMetadata.writeClimatePointEntry (   projectDir,
  key,
  value 
)
static

Write a point climate entry to the metadata store for a given project.

Note
Will overwrite the value for a key that already exists
Parameters
projectDirPath of the project whose metadata store is to be written to
keyThe key to be written to the point climate section of the project metadata
valueThe value to be written for key stored in the point climate section of the project metadata
         @exception IOError(errno.EACCES) if the metadata store for the project is not writable
def ecohydroworkflowlib.metadata.GenericMetadata.writeEntryToSection (   projectDir,
  section,
  key,
  value 
)
static

Write an entry in the given section to the metadata store for a given project.

Note
Will overwrite the value for a key that already exists
Parameters
projectDirPath of the project whose metadata store is to be written to
sectionThe section the key is to be written to
keyThe key to be written to the given section of the project metadata
valueThe value to be written for key stored in the given section of the project metadata
         @exception IOError(errno.EACCES) if the metadata store for the project is not writable
         @exception Exception if section is not a valid GenericMetadata section
def ecohydroworkflowlib.metadata.GenericMetadata.writeManifestEntry (   projectDir,
  key,
  value 
)
static

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

Note
Will overwrite a the value for a key that already exists
Parameters
projectDirPath of the project whose metadata store is to be written to
keyThe key to be written to the manifest section of the project metadata
valueThe value to be written for key stored in the manifest section of the project metadata
         @exception IOError(errno.EACCES) if the metadata store for the project is not writable
def ecohydroworkflowlib.metadata.GenericMetadata.writeManifestEntry (   projectDir,
  key,
  value 
)
static

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

Note
Will overwrite the value for a key that already exists
Parameters
projectDirPath of the project whose metadata store is to be written to
keyThe key to be written to the manifest section of the project metadata
valueThe value to be written for key stored in the manifest section of the project metadata
         @exception IOError(errno.EACCES) if the metadata store for the project is not writable
def ecohydroworkflowlib.metadata.GenericMetadata.writeProvenanceEntries (   projectDir,
  keys,
  values 
)
static

Write provenance entries to the metadata store for a given project.

Note
Will overwrite the values of keys that already exist
Parameters
projectDirPath of the project whose metadata store is to be written to
keysThe keys to be written to the provenance section of the project metadata
valuesThe values to be written for keys stored in the provenance section of the project metadata
         @exception IOError(errno.EACCES) if the metadata store for the project is not writable
         @exception Exception if len(keys) != len(values)
def ecohydroworkflowlib.metadata.GenericMetadata.writeProvenanceEntry (   projectDir,
  key,
  value 
)
static

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

Note
Will overwrite a the value for a key that already exists
Parameters
projectDirPath of the project whose metadata store is to be written to
keyThe key to be written to the provenance section of the project metadata
valueThe value to be written for key stored in the provenance section of the project metadata
         @exception IOError(errno.EACCES) if the metadata store for the project is not writable
def ecohydroworkflowlib.metadata.GenericMetadata.writeStudyAreaEntry (   projectDir,
  key,
  value 
)
static

Write a study area entry to the metadata store for a given project.

Note
Will overwrite a the value for a key that already exists
Parameters
projectDirPath of the project whose metadata store is to be written to
keyThe key to be written to the study area section of the project metadata
valueThe value to be written for key stored in the study area section of the project metadata
         @exception IOError(errno.EACCES) if the metadata store for the project is not writable
def ecohydroworkflowlib.metadata.GenericMetadata.writeStudyAreaEntry (   projectDir,
  key,
  value 
)
static

Write a study area entry to the metadata store for a given project.

Note
Will overwrite the value for a key that already exists
Parameters
projectDirPath of the project whose metadata store is to be written to
keyThe key to be written to the study area section of the project metadata
valueThe value to be written for key stored in the study area section of the project metadata
         @exception IOError(errno.EACCES) if the metadata store for the project is not writable

Member Data Documentation

string ecohydroworkflowlib.metadata.GenericMetadata.CLIMATE_GRID_SECTION 'climate_grid'
static
string ecohydroworkflowlib.metadata.GenericMetadata.CLIMATE_POINT_SECTION 'climate_point'
static
string ecohydroworkflowlib.metadata.GenericMetadata.COMPOUND_KEY_SEP '/'
static
string ecohydroworkflowlib.metadata.GenericMetadata.HISTORY_PROTO "processing%sstep%s"
static
string ecohydroworkflowlib.metadata.GenericMetadata.HISTORY_SECTION 'history'
static
string ecohydroworkflowlib.metadata.GenericMetadata.KEY_SEP '_'
static
string ecohydroworkflowlib.metadata.GenericMetadata.MANIFEST_SECTION 'manifest'
static
string ecohydroworkflowlib.metadata.GenericMetadata.METADATA_FILENAME 'metadata.txt'
static
string ecohydroworkflowlib.metadata.GenericMetadata.METADATA_LOCKFILE 'metadata.txt.lock'
static
string ecohydroworkflowlib.metadata.GenericMetadata.PROVENANCE_SECTION 'provenance'
static
list ecohydroworkflowlib.metadata.GenericMetadata.SECTIONS
static
Initial value:
1 [MANIFEST_SECTION, PROVENANCE_SECTION, HISTORY_SECTION,\
2  STUDY_AREA_SECTION, CLIMATE_POINT_SECTION, CLIMATE_GRID_SECTION]
string ecohydroworkflowlib.metadata.GenericMetadata.STUDY_AREA_SECTION 'study_area'
static
string ecohydroworkflowlib.metadata.GenericMetadata.VALUE_DELIM ','
static

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