EcohydroLib  1.29
Static Public Member Functions | Static Public Attributes | List of all members
ecohydrolib.metadata.GenericMetadata Class Reference

Handles metadata persistance. More...

Inheritance diagram for ecohydrolib.metadata.GenericMetadata:

Static Public Member Functions

def getCommandLine ()
 Return string representing original command line, as close as possible, used to run the command. More...
 
def checkMetadataVersion (projectDir)
 Check if metadata store is compatible with current version of ecohydrolib. More...
 
def deleteEntryFromSection
 Delete an entry from the given section of the metadata store for a given project. More...
 
def writeEntryToSection
 Write an entry in the given section to the metadata store for a given project. More...
 
def writeManifestEntry (context, key, value)
 Write a manifest entry to the metadata store for a given project. More...
 
def writeStudyAreaEntry (context, key, value)
 Write a study area entry to the metadata store for a given project. More...
 
def writeGRASSEntry (context, key, value)
 Write a GRASS entry to the metadata store for a given project. More...
 
def writeClimatePointEntry (context, key, value)
 Write a point climate entry to the metadata store for a given project. More...
 
def writeClimatePointEntries (context, keys, values)
 Write a point climate entries to the metadata store for a given project. More...
 
def writeClimateGridEntry (context, key, value)
 Write a grid climate entry to the metadata store for a given project. More...
 
def writeHydroShareEntry (context, key, value)
 Write a HydroShare entry to the metadata store for a given project. More...
 
def deleteManifestEntry (context, key)
 Delete an entry from the manifest section of the metadata store for a given project. More...
 
def deleteStudyAreaEntry (context, key)
 Delete an entry from the study area section of the metadata store for a given project. More...
 
def deleteGRASSEntry (context, key)
 Delete an entry from the GRASS section of the metadata store for a given project. More...
 
def deleteClimatePointEntry (context, key)
 Delete an entry from the point climate section of the metadata store for a given project. More...
 
def deleteClimateGridEntry (context, key)
 Delete an entry from the grid climate section of the metadata store for a given project. More...
 
def deleteHydroShareEntry (context, key)
 Delete an entry from the HydroShare section of the metadata store for a given project. More...
 
def writeClimateGridEntries (context, keys, values)
 Write grid climate entries to the metadata store for a given project. More...
 
def writeProvenanceEntry (context, key, value)
 Write a provenance entry to the metadata store for a given project. More...
 
def writeModelRunEntries (context, keys, values)
 Write model run entries to the metadata store for a given project. More...
 
def writeProvenanceEntries (context, keys, values)
 Write provenance entries to the metadata store for a given project. More...
 
def readManifestEntries (context)
 Read all manifest entries from the metadata store for a given project. More...
 
def readStudyAreaEntries (context)
 Read all study area entries from the metadata store for a given project. More...
 
def readGRASSEntries (context)
 Read all GRASS entries from the metadata store for a given project. More...
 
def readModelRunEntries (context)
 Read all point model run entries from the metadata store for a given project. More...
 
def readModelRuns (context)
 Read all model runs from metadata and store in ModelRun instances. More...
 
def readClimatePointEntries (context)
 Read all point climate entries from the metadata store for a given project. More...
 
def readClimatePointStations (context)
 Read all climate point stations from metadata and store in ClimatePointStation instances. More...
 
def readClimateGridEntries (context)
 Read all grid climate entries from the metadata store for a given project. More...
 
def readHydroShareEntries (context)
 Read all HydroShare entries from the metadata store for a given project. More...
 
def readProvenanceEntries (context)
 Read all provenance entries from the metadata store for a given project. More...
 
def readAssetProvenanceObjects (context)
 Read all asset provenance objects from metadata and store in AssetProvenance instances. More...
 
def getProcessingHistoryList (context)
 Get processing history stored in the project metadata. More...
 
def appendProcessingHistoryItem (context, item)
 Write an item to the processing history stored in the project metadata. More...
 
def getCommandLine ()
 Return string representing original command line, as close as possible, used to run the command. More...
 
def checkMetadataVersion (projectDir)
 Check if metadata store is compatible with current version of ecohydrolib. More...
 
def deleteEntryFromSection
 Delete an entry from the given section of the metadata store for a given project. More...
 
def writeEntryToSection
 Write an entry in the given section to the metadata store for a given project. More...
 
def writeManifestEntry (context, key, value)
 Write a manifest entry to the metadata store for a given project. More...
 
def writeStudyAreaEntry (context, key, value)
 Write a study area entry to the metadata store for a given project. More...
 
def writeGRASSEntry (context, key, value)
 Write a GRASS entry to the metadata store for a given project. More...
 
def writeClimatePointEntry (context, key, value)
 Write a point climate entry to the metadata store for a given project. More...
 
def writeClimatePointEntries (context, keys, values)
 Write a point climate entries to the metadata store for a given project. More...
 
def writeClimateGridEntry (context, key, value)
 Write a grid climate entry to the metadata store for a given project. More...
 
def writeHydroShareEntry (context, key, value)
 Write a HydroShare entry to the metadata store for a given project. More...
 
def deleteManifestEntry (context, key)
 Delete an entry from the manifest section of the metadata store for a given project. More...
 
def deleteStudyAreaEntry (context, key)
 Delete an entry from the study area section of the metadata store for a given project. More...
 
def deleteGRASSEntry (context, key)
 Delete an entry from the GRASS section of the metadata store for a given project. More...
 
def deleteClimatePointEntry (context, key)
 Delete an entry from the point climate section of the metadata store for a given project. More...
 
def deleteClimateGridEntry (context, key)
 Delete an entry from the grid climate section of the metadata store for a given project. More...
 
def deleteHydroShareEntry (context, key)
 Delete an entry from the HydroShare section of the metadata store for a given project. More...
 
def writeClimateGridEntries (context, keys, values)
 Write grid climate entries to the metadata store for a given project. More...
 
def writeProvenanceEntry (context, key, value)
 Write a provenance entry to the metadata store for a given project. More...
 
def writeModelRunEntries (context, keys, values)
 Write model run entries to the metadata store for a given project. More...
 
def writeProvenanceEntries (context, keys, values)
 Write provenance entries to the metadata store for a given project. More...
 
def readManifestEntries (context)
 Read all manifest entries from the metadata store for a given project. More...
 
def readStudyAreaEntries (context)
 Read all study area entries from the metadata store for a given project. More...
 
def readGRASSEntries (context)
 Read all GRASS entries from the metadata store for a given project. More...
 
def readModelRunEntries (context)
 Read all point model run entries from the metadata store for a given project. More...
 
def readModelRuns (context)
 Read all model runs from metadata and store in ModelRun instances. More...
 
def readClimatePointEntries (context)
 Read all point climate entries from the metadata store for a given project. More...
 
def readClimatePointStations (context)
 Read all climate point stations from metadata and store in ClimatePointStation instances. More...
 
def readClimateGridEntries (context)
 Read all grid climate entries from the metadata store for a given project. More...
 
def readHydroShareEntries (context)
 Read all HydroShare entries from the metadata store for a given project. More...
 
def readProvenanceEntries (context)
 Read all provenance entries from the metadata store for a given project. More...
 
def readAssetProvenanceObjects (context)
 Read all asset provenance objects from metadata and store in AssetProvenance instances. More...
 
def getProcessingHistoryList (context)
 Get processing history stored in the project metadata. More...
 
def appendProcessingHistoryItem (context, item)
 Write an item to the processing history stored in the project metadata. More...
 

Static Public Attributes

string VALUE_DELIM = ','
 
string KEY_SEP = '_'
 
string COMPOUND_KEY_SEP = '/'
 
string METADATA_FILENAME = 'metadata.txt'
 
string METADATA_LOCKFILE = 'metadata.txt.lock'
 
string VERSION_KEY = 'ecohydrolib_version'
 
string ECOHYDROLIB_SECION = 'ecohydrolib'
 
string MANIFEST_SECTION = 'manifest'
 
string PROVENANCE_SECTION = 'provenance'
 
string HISTORY_SECTION = 'history'
 
string STUDY_AREA_SECTION = 'study_area'
 
string GRASS_SECTION = 'grass'
 
string CLIMATE_POINT_SECTION = 'climate_point'
 
string CLIMATE_GRID_SECTION = 'climate_grid'
 
string MODEL_RUN_SECTION = 'model_run'
 
string HYDROSHARE_SECTION = 'hydroshare'
 
list SECTIONS
 
string HISTORY_PROTO = "processing%sstep%s"
 
string RASTER_TYPE_LC = 'landcover'
 
string RASTER_TYPE_ROOF = 'roof_connectivity'
 
string RASTER_TYPE_SOIL = 'soil'
 
string RASTER_TYPE_LAI = 'lai'
 
string RASTER_TYPE_PATCH = 'patch'
 
string RASTER_TYPE_ZONE = 'zone'
 
string RASTER_TYPE_ISOHYET = 'isohyet'
 
string RASTER_TYPE_LEAFC = 'leafc'
 
string RASTER_TYPE_ROOTDEPTH = 'rootdepth'
 
string RASTER_TYPE_ROAD = 'roads'
 
string RASTER_TYPE_STREAM_BURNED_DEM = 'stream_burned_dem'
 
list RASTER_TYPES
 
list MODEL_TYPES = []
 

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 ecohydrolib.metadata.GenericMetadata.appendProcessingHistoryItem (   context,
  item 
)
static

Write an item to the processing history stored in the project metadata.

Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be written to
itemString representing item to be written to processing history
def ecohydrolib.metadata.GenericMetadata.appendProcessingHistoryItem (   context,
  item 
)
static

Write an item to the processing history stored in the project metadata.

Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be written to
itemString representing item to be written to processing history
def ecohydrolib.metadata.GenericMetadata.checkMetadataVersion (   projectDir)
static

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

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 MetadataVersionError if a version already exists in the metadata store and is different than GenericMetadata._ecohydrolibVersion
def ecohydrolib.metadata.GenericMetadata.checkMetadataVersion (   projectDir)
static

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

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 MetadataVersionError if a version already exists in the metadata store and is different than GenericMetadata._ecohydrolibVersion
def ecohydrolib.metadata.GenericMetadata.deleteClimateGridEntry (   context,
  key 
)
static

Delete an entry from the grid climate section of 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 given section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.deleteClimateGridEntry (   context,
  key 
)
static

Delete an entry from the grid climate section of 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 given section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.deleteClimatePointEntry (   context,
  key 
)
static

Delete an entry from the point climate section of 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 given section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.deleteClimatePointEntry (   context,
  key 
)
static

Delete an entry from the point climate section of 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 given section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.deleteEntryFromSection (   context,
  section,
  key,
  callback = None 
)
static

Delete an entry from the given section of 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
sectionThe section the key is to be deleted from
keyThe key to be deleted from the given section of the project metadata
callbackA function that should be called before deleting the entry. The function takes as input the config object.

IOError(errno.EACCES) if the metadata store for the project is not writable Exception if section is not a valid GenericMetadata section MetadataVersionError if existing version information in metadata store does not match version of currently running EcohydroLib.

def ecohydrolib.metadata.GenericMetadata.deleteEntryFromSection (   context,
  section,
  key,
  callback = None 
)
static

Delete an entry from the given section of 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
sectionThe section the key is to be deleted from
keyThe key to be deleted from the given section of the project metadata
callbackA function that should be called before deleting the entry. The function takes as input the config object.

IOError(errno.EACCES) if the metadata store for the project is not writable Exception if section is not a valid GenericMetadata section MetadataVersionError if existing version information in metadata store does not match version of currently running EcohydroLib.

def ecohydrolib.metadata.GenericMetadata.deleteGRASSEntry (   context,
  key 
)
static

Delete an entry from the GRASS section of 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 given section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.deleteGRASSEntry (   context,
  key 
)
static

Delete an entry from the GRASS section of 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 given section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.deleteHydroShareEntry (   context,
  key 
)
static

Delete an entry from the HydroShare section of 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 given section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.deleteHydroShareEntry (   context,
  key 
)
static

Delete an entry from the HydroShare section of 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 given section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.deleteManifestEntry (   context,
  key 
)
static

Delete an entry from the manifest section of 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 given section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.deleteManifestEntry (   context,
  key 
)
static

Delete an entry from the manifest section of 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 given section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.deleteStudyAreaEntry (   context,
  key 
)
static

Delete an entry from the study area section of 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 given section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.deleteStudyAreaEntry (   context,
  key 
)
static

Delete an entry from the study area section of 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 given section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.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 ecohydrolib.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 ecohydrolib.metadata.GenericMetadata.getProcessingHistoryList (   context)
static

Get processing history stored in the project metadata.

Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be written to
Returns
List containing strings representing history items
def ecohydrolib.metadata.GenericMetadata.getProcessingHistoryList (   context)
static

Get processing history stored in the project metadata.

Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be written to
Returns
List containing strings representing history items
def ecohydrolib.metadata.GenericMetadata.readAssetProvenanceObjects (   context)
static

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

Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be read from
Returns
A list of AssetProvenance objects
def ecohydrolib.metadata.GenericMetadata.readAssetProvenanceObjects (   context)
static

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

Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be read from
Returns
A list of AssetProvenance objects
def ecohydrolib.metadata.GenericMetadata.readClimateGridEntries (   context)
static

Read all grid climate 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
Returns
A dictionary of key/value pairs from the grid climate section of the project metadata
def ecohydrolib.metadata.GenericMetadata.readClimateGridEntries (   context)
static

Read all grid climate 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
Returns
A dictionary of key/value pairs from the grid climate section of the project metadata
def ecohydrolib.metadata.GenericMetadata.readClimatePointEntries (   context)
static

Read all point climate 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
Returns
A dictionary of key/value pairs from the point climate section of the project metadata
def ecohydrolib.metadata.GenericMetadata.readClimatePointEntries (   context)
static

Read all point climate 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
Returns
A dictionary of key/value pairs from the point climate section of the project metadata
def ecohydrolib.metadata.GenericMetadata.readClimatePointStations (   context)
static

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

Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be read from
Returns
A list of ClimatePointStation objects
def ecohydrolib.metadata.GenericMetadata.readClimatePointStations (   context)
static

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

Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be read from
Returns
A list of ClimatePointStation objects
def ecohydrolib.metadata.GenericMetadata.readGRASSEntries (   context)
static

Read all GRASS 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
Returns
A dictionary of key/value pairs from the GRASS section of the project metadata
def ecohydrolib.metadata.GenericMetadata.readGRASSEntries (   context)
static

Read all GRASS 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
Returns
A dictionary of key/value pairs from the GRASS section of the project metadata
def ecohydrolib.metadata.GenericMetadata.readHydroShareEntries (   context)
static

Read all HydroShare 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
Returns
A dictionary of key/value pairs from the study area section of the project metadata
def ecohydrolib.metadata.GenericMetadata.readHydroShareEntries (   context)
static

Read all HydroShare 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
Returns
A dictionary of key/value pairs from the study area section of the project metadata
def ecohydrolib.metadata.GenericMetadata.readManifestEntries (   context)
static

Read all manifest 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
Returns
A dictionary of key/value pairs from the manifest section of the project metadata
def ecohydrolib.metadata.GenericMetadata.readManifestEntries (   context)
static

Read all manifest 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
Returns
A dictionary of key/value pairs from the manifest section of the project metadata
def ecohydrolib.metadata.GenericMetadata.readModelRunEntries (   context)
static

Read all point model run 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
Returns
A dictionary of key/value pairs from the model run section of the project metadata
def ecohydrolib.metadata.GenericMetadata.readModelRunEntries (   context)
static

Read all point model run 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
Returns
A dictionary of key/value pairs from the model run section of the project metadata
def ecohydrolib.metadata.GenericMetadata.readModelRuns (   context)
static

Read all model runs from metadata and store in ModelRun instances.

Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be read from
Returns
A list of ModelRun objects
def ecohydrolib.metadata.GenericMetadata.readModelRuns (   context)
static

Read all model runs from metadata and store in ModelRun instances.

Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be read from
Returns
A list of ModelRun objects
def ecohydrolib.metadata.GenericMetadata.readProvenanceEntries (   context)
static

Read all provenance 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
Returns
A dictionary of key/value pairs from the provenance section of the project metadata
def ecohydrolib.metadata.GenericMetadata.readProvenanceEntries (   context)
static

Read all provenance 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
Returns
A dictionary of key/value pairs from the provenance section of the project metadata
def ecohydrolib.metadata.GenericMetadata.readStudyAreaEntries (   context)
static

Read all study area 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
Returns
A dictionary of key/value pairs from the study area section of the project metadata
def ecohydrolib.metadata.GenericMetadata.readStudyAreaEntries (   context)
static

Read all study area 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
Returns
A dictionary of key/value pairs from the study area section of the project metadata
def ecohydrolib.metadata.GenericMetadata.writeClimateGridEntries (   context,
  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
contextContext object containing projectDir, the path of the project whose metadata store is to be read from
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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
Exceptionif len(keys) != len(values)
def ecohydrolib.metadata.GenericMetadata.writeClimateGridEntries (   context,
  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
contextContext object containing projectDir, the path of the project whose metadata store is to be read from
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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
Exceptionif len(keys) != len(values)
def ecohydrolib.metadata.GenericMetadata.writeClimateGridEntry (   context,
  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
contextContext object containing projectDir, the path of the project whose metadata store is to be read from
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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.writeClimateGridEntry (   context,
  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
contextContext object containing projectDir, the path of the project whose metadata store is to be read from
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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.writeClimatePointEntries (   context,
  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
contextContext object containing projectDir, the path 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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
Exceptionif len(keys) != len(values)
def ecohydrolib.metadata.GenericMetadata.writeClimatePointEntries (   context,
  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
contextContext object containing projectDir, the path 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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
Exceptionif len(keys) != len(values)
def ecohydrolib.metadata.GenericMetadata.writeClimatePointEntry (   context,
  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
contextContext object containing projectDir, the path 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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.writeClimatePointEntry (   context,
  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
contextContext object containing projectDir, the path 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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.writeEntryToSection (   context,
  section,
  key,
  value,
  callback = None 
)
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
contextContext object containing projectDir, the path 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
callbackA function that should be called before writing the entry. The function takes as input the config object.

IOError(errno.EACCES) if the metadata store for the project is not writable Exception if section is not a valid GenericMetadata section MetadataVersionError if existing version information in metadata store does not match version of currently running EcohydroLib.

def ecohydrolib.metadata.GenericMetadata.writeEntryToSection (   context,
  section,
  key,
  value,
  callback = None 
)
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
contextContext object containing projectDir, the path 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
callbackA function that should be called before writing the entry. The function takes as input the config object.

IOError(errno.EACCES) if the metadata store for the project is not writable Exception if section is not a valid GenericMetadata section MetadataVersionError if existing version information in metadata store does not match version of currently running EcohydroLib.

def ecohydrolib.metadata.GenericMetadata.writeGRASSEntry (   context,
  key,
  value 
)
static

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

Typically used to record the location within a project directory of a GRASS location and mapset, as well as to note the existence of particular datasets stored in the mapset

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 GRASS section of the project metadata
valueThe value to be written for key stored in the GRASS section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.writeGRASSEntry (   context,
  key,
  value 
)
static

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

Typically used to record the location within a project directory of a GRASS location and mapset, as well as to note the existence of particular datasets stored in the mapset

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 GRASS section of the project metadata
valueThe value to be written for key stored in the GRASS section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.writeHydroShareEntry (   context,
  key,
  value 
)
static

Write a HydroShare 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 study area section of the project metadata
valueThe value to be written for key stored in the HydroShare section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.writeHydroShareEntry (   context,
  key,
  value 
)
static

Write a HydroShare 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 study area section of the project metadata
valueThe value to be written for key stored in the HydroShare section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.writeManifestEntry (   context,
  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
contextContext object containing projectDir, the path 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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.writeManifestEntry (   context,
  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
contextContext object containing projectDir, the path 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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.writeModelRunEntries (   context,
  keys,
  values 
)
static

Write model run entries to the metadata store for a given project.

Note
Will overwrite the values of keys that already exist
Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be written to
keysThe keys to be written to the model run section of the project metadata
valuesThe values to be written for keys stored in the model run section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
Exceptionif len(keys) != len(values)
def ecohydrolib.metadata.GenericMetadata.writeModelRunEntries (   context,
  keys,
  values 
)
static

Write model run entries to the metadata store for a given project.

Note
Will overwrite the values of keys that already exist
Parameters
contextContext object containing projectDir, the path of the project whose metadata store is to be written to
keysThe keys to be written to the model run section of the project metadata
valuesThe values to be written for keys stored in the model run section of the project metadata
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
Exceptionif len(keys) != len(values)
def ecohydrolib.metadata.GenericMetadata.writeProvenanceEntries (   context,
  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
contextContext object containing projectDir, the path 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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
Exceptionif len(keys) != len(values)
def ecohydrolib.metadata.GenericMetadata.writeProvenanceEntries (   context,
  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
contextContext object containing projectDir, the path 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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
Exceptionif len(keys) != len(values)
def ecohydrolib.metadata.GenericMetadata.writeProvenanceEntry (   context,
  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
contextContext object containing projectDir, the path 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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.writeProvenanceEntry (   context,
  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
contextContext object containing projectDir, the path 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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.writeStudyAreaEntry (   context,
  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
contextContext object containing projectDir, the path 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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable
def ecohydrolib.metadata.GenericMetadata.writeStudyAreaEntry (   context,
  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
contextContext object containing projectDir, the path 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
Exceptions
IOError(errno.EACCES)if the metadata store for the project is not writable

Member Data Documentation

string ecohydrolib.metadata.GenericMetadata.CLIMATE_GRID_SECTION = 'climate_grid'
static
string ecohydrolib.metadata.GenericMetadata.CLIMATE_POINT_SECTION = 'climate_point'
static
string ecohydrolib.metadata.GenericMetadata.COMPOUND_KEY_SEP = '/'
static
string ecohydrolib.metadata.GenericMetadata.ECOHYDROLIB_SECION = 'ecohydrolib'
static
string ecohydrolib.metadata.GenericMetadata.GRASS_SECTION = 'grass'
static
string ecohydrolib.metadata.GenericMetadata.HISTORY_PROTO = "processing%sstep%s"
static
string ecohydrolib.metadata.GenericMetadata.HISTORY_SECTION = 'history'
static
string ecohydrolib.metadata.GenericMetadata.HYDROSHARE_SECTION = 'hydroshare'
static
string ecohydrolib.metadata.GenericMetadata.KEY_SEP = '_'
static
string ecohydrolib.metadata.GenericMetadata.MANIFEST_SECTION = 'manifest'
static
string ecohydrolib.metadata.GenericMetadata.METADATA_FILENAME = 'metadata.txt'
static
string ecohydrolib.metadata.GenericMetadata.METADATA_LOCKFILE = 'metadata.txt.lock'
static
string ecohydrolib.metadata.GenericMetadata.MODEL_RUN_SECTION = 'model_run'
static
list ecohydrolib.metadata.GenericMetadata.MODEL_TYPES = []
static
string ecohydrolib.metadata.GenericMetadata.PROVENANCE_SECTION = 'provenance'
static
string ecohydrolib.metadata.GenericMetadata.RASTER_TYPE_ISOHYET = 'isohyet'
static
string ecohydrolib.metadata.GenericMetadata.RASTER_TYPE_LAI = 'lai'
static
string ecohydrolib.metadata.GenericMetadata.RASTER_TYPE_LC = 'landcover'
static
string ecohydrolib.metadata.GenericMetadata.RASTER_TYPE_LEAFC = 'leafc'
static
string ecohydrolib.metadata.GenericMetadata.RASTER_TYPE_PATCH = 'patch'
static
string ecohydrolib.metadata.GenericMetadata.RASTER_TYPE_ROAD = 'roads'
static
string ecohydrolib.metadata.GenericMetadata.RASTER_TYPE_ROOF = 'roof_connectivity'
static
string ecohydrolib.metadata.GenericMetadata.RASTER_TYPE_ROOTDEPTH = 'rootdepth'
static
string ecohydrolib.metadata.GenericMetadata.RASTER_TYPE_SOIL = 'soil'
static
string ecohydrolib.metadata.GenericMetadata.RASTER_TYPE_STREAM_BURNED_DEM = 'stream_burned_dem'
static
string ecohydrolib.metadata.GenericMetadata.RASTER_TYPE_ZONE = 'zone'
static
list ecohydrolib.metadata.GenericMetadata.RASTER_TYPES
static
Initial value:
1 = [RASTER_TYPE_LC, RASTER_TYPE_ROOF, RASTER_TYPE_SOIL, RASTER_TYPE_LAI,
2  RASTER_TYPE_PATCH, RASTER_TYPE_ZONE, RASTER_TYPE_ISOHYET,
3  RASTER_TYPE_LEAFC, RASTER_TYPE_ROOTDEPTH, RASTER_TYPE_ROAD,
4  RASTER_TYPE_STREAM_BURNED_DEM]
list ecohydrolib.metadata.GenericMetadata.SECTIONS
static
Initial value:
1 = [ECOHYDROLIB_SECION, MANIFEST_SECTION, PROVENANCE_SECTION, HISTORY_SECTION,
2  STUDY_AREA_SECTION, GRASS_SECTION, CLIMATE_POINT_SECTION, CLIMATE_GRID_SECTION,
3  MODEL_RUN_SECTION, HYDROSHARE_SECTION]
string ecohydrolib.metadata.GenericMetadata.STUDY_AREA_SECTION = 'study_area'
static
string ecohydrolib.metadata.GenericMetadata.VALUE_DELIM = ','
static
string ecohydrolib.metadata.GenericMetadata.VERSION_KEY = 'ecohydrolib_version'
static

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