RHESSysCalibrator  2.1.0
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
rhessyscalibrator.model_runner_db2.ModelRunnerDB2 Class Reference

Class for setting up, and storing modeling session and run information in a sqlite-base DB. More...

Inheritance diagram for rhessyscalibrator.model_runner_db2.ModelRunnerDB2:

Public Member Functions

def migrateDbToCurrentVersion (cls, db_path)
 DO NOT CALL THIS FUNCTION UNLESS YOU KNOW WHAT YOU ARE DOING. More...
 
def getDbVersion (cls, db_path)
 
def __init__ (self, db_path)
 Initialize the DB. More...
 
def __del__ (self)
 
def close (self)
 
def getMostRecentSessionID (self)
 Returns the ID of the session most recently inserted by the given instance of ModelRunnerDB. More...
 
def insertSession (self, user, project, notes, iterations, processes, basedir, cmd_proto)
 Creates a new session with a starttime of the current time, and a status of 'submitted'. More...
 
def updateSessionEndtime (self, id, endtime, status)
 Updates the end time and the status of the given session. More...
 
def getMostRecentRunID (self, session_id)
 Returns the ID of the run most recently inserted by the given instance of ModelRunnerDB. More...
 
def insertRun (self, session_id, worldfile, param_s1, param_s2, param_s3, param_sv1, param_sv2, param_gw1, param_gw2, param_vgsen1, param_vgsen2, param_vgsen3, param_svalt1, param_svalt2, cmd_raw, output_path, job_id)
 Creates a new run with a starttime of the current time, and a status of 'PEND'. More...
 
def updateRunEndtime (self, id, endtime, status)
 Updates the end time and the status of the given run. More...
 
def getRunStatus (self, id)
 Gets the status of the given run. More...
 
def updateRunStatus
 Updates the status of the given run. More...
 
def updateRunJobId (self, id, job_id)
 Updates the job_id of the given run. More...
 
def insertPostProcess
 Creates post process entry for a particular session. More...
 
def insertRunFitnessResults
 Set fitness results of a model run for a particular post process entry. More...
 
def getRun (self, run_id)
 Get the run with the supplied ID. More...
 
def getRunsInSession
 Get all runs associated with a session. More...
 
def getRunInSession (self, session_id, job_id)
 Get all runs associated with a session. More...
 
def getSession (self, session_id)
 Get the session with the supplied ID. More...
 
def getSessions (self)
 Get all sessions in the DB. More...
 
def getPostProcessForSession (self, session_id)
 Get the post process entries associated with a session. More...
 
def getPostProcess (self, postprocess_id)
 Get the post process entries associated with a session. More...
 
def getRunFitnessForPostProcess (self, postprocess_id)
 Get the run fitness entries associated with a post process entry. More...
 
def getRunsInPostProcess
 Get all runs, and their runfitness data, associated with post process entry. More...
 
def exportRunsAndFitnessInPostProcess
 Write all runs, and their runfitness data, associated with post process entry to a file-like object in CSV format. More...
 
def migrateDbToCurrentVersion (cls, db_path)
 DO NOT CALL THIS FUNCTION UNLESS YOU KNOW WHAT YOU ARE DOING. More...
 
def getDbVersion (cls, db_path)
 
def __init__ (self, db_path)
 Initialize the DB. More...
 
def __del__ (self)
 
def close (self)
 
def getMostRecentSessionID (self)
 Returns the ID of the session most recently inserted by the given instance of ModelRunnerDB. More...
 
def insertSession (self, user, project, notes, iterations, processes, basedir, cmd_proto)
 Creates a new session with a starttime of the current time, and a status of 'submitted'. More...
 
def updateSessionEndtime (self, id, endtime, status)
 Updates the end time and the status of the given session. More...
 
def getMostRecentRunID (self, session_id)
 Returns the ID of the run most recently inserted by the given instance of ModelRunnerDB. More...
 
def insertRun (self, session_id, worldfile, param_s1, param_s2, param_s3, param_sv1, param_sv2, param_gw1, param_gw2, param_vgsen1, param_vgsen2, param_vgsen3, param_svalt1, param_svalt2, cmd_raw, output_path, job_id)
 Creates a new run with a starttime of the current time, and a status of 'PEND'. More...
 
def updateRunEndtime (self, id, endtime, status)
 Updates the end time and the status of the given run. More...
 
def getRunStatus (self, id)
 Gets the status of the given run. More...
 
def updateRunStatus
 Updates the status of the given run. More...
 
def updateRunJobId (self, id, job_id)
 Updates the job_id of the given run. More...
 
def insertPostProcess
 Creates post process entry for a particular session. More...
 
def insertRunFitnessResults
 Set fitness results of a model run for a particular post process entry. More...
 
def getRun (self, run_id)
 Get the run with the supplied ID. More...
 
def getRunsInSession
 Get all runs associated with a session. More...
 
def getRunInSession (self, session_id, job_id)
 Get all runs associated with a session. More...
 
def getSession (self, session_id)
 Get the session with the supplied ID. More...
 
def getSessions (self)
 Get all sessions in the DB. More...
 
def getPostProcessForSession (self, session_id)
 Get the post process entries associated with a session. More...
 
def getPostProcess (self, postprocess_id)
 Get the post process entries associated with a session. More...
 
def getRunFitnessForPostProcess (self, postprocess_id)
 Get the run fitness entries associated with a post process entry. More...
 
def getRunsInPostProcess
 Get all runs, and their runfitness data, associated with post process entry. More...
 
def exportRunsAndFitnessInPostProcess
 Write all runs, and their runfitness data, associated with post process entry to a file-like object in CSV format. More...
 
def migrateDbToCurrentVersion (cls, db_path)
 DO NOT CALL THIS FUNCTION UNLESS YOU KNOW WHAT YOU ARE DOING. More...
 
def getDbVersion (cls, db_path)
 
def __init__ (self, db_path)
 Initialize the DB. More...
 
def __del__ (self)
 
def close (self)
 
def getMostRecentSessionID (self)
 Returns the ID of the session most recently inserted by the given instance of ModelRunnerDB. More...
 
def insertSession (self, user, project, notes, iterations, processes, basedir, cmd_proto)
 Creates a new session with a starttime of the current time, and a status of 'submitted'. More...
 
def updateSessionEndtime (self, id, endtime, status)
 Updates the end time and the status of the given session. More...
 
def getMostRecentRunID (self, session_id)
 Returns the ID of the run most recently inserted by the given instance of ModelRunnerDB. More...
 
def insertRun (self, session_id, worldfile, param_s1, param_s2, param_s3, param_sv1, param_sv2, param_gw1, param_gw2, param_vgsen1, param_vgsen2, param_vgsen3, param_svalt1, param_svalt2, cmd_raw, output_path, job_id)
 Creates a new run with a starttime of the current time, and a status of 'PEND'. More...
 
def updateRunEndtime (self, id, endtime, status)
 Updates the end time and the status of the given run. More...
 
def getRunStatus (self, id)
 Gets the status of the given run. More...
 
def updateRunStatus
 Updates the status of the given run. More...
 
def updateRunJobId (self, id, job_id)
 Updates the job_id of the given run. More...
 
def insertPostProcess
 Creates post process entry for a particular session. More...
 
def insertRunFitnessResults
 Set fitness results of a model run for a particular post process entry. More...
 
def getRun (self, run_id)
 Get the run with the supplied ID. More...
 
def getRunsInSession
 Get all runs associated with a session. More...
 
def getRunInSession (self, session_id, job_id)
 Get all runs associated with a session. More...
 
def getSession (self, session_id)
 Get the session with the supplied ID. More...
 
def getSessions (self)
 Get all sessions in the DB. More...
 
def getPostProcessForSession (self, session_id)
 Get the post process entries associated with a session. More...
 
def getPostProcess (self, postprocess_id)
 Get the post process entries associated with a session. More...
 
def getRunFitnessForPostProcess (self, postprocess_id)
 Get the run fitness entries associated with a post process entry. More...
 
def getRunsInPostProcess
 Get all runs, and their runfitness data, associated with post process entry. More...
 
def exportRunsAndFitnessInPostProcess
 Write all runs, and their runfitness data, associated with post process entry to a file-like object in CSV format. More...
 

Public Attributes

 version
 

Static Public Attributes

float DB_VERSION = 2.0
 
string ELEM_SEP = '|'
 

Detailed Description

Class for setting up, and storing modeling session and run information in a sqlite-base DB.

A model runner DB stores information about modeling sessions. A session is composed of one or more modeling runs. There is a one-to-many relationship between sessions and runs (i.e. a session can be associated with many runs, but a run can only be associated with a single session). Details about calibration run post-processing are stored in the postprocess table.

Constructor & Destructor Documentation

def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.__init__ (   self,
  db_path 
)

Initialize the DB.

Will create a connection to the sqlite DB pointed to by db_path

Exception if database needs to be migrated to latest version.

def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.__del__ (   self)
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.__init__ (   self,
  db_path 
)

Initialize the DB.

Will create a connection to the sqlite DB pointed to by db_path

Exception if database needs to be migrated to latest version.

def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.__del__ (   self)
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.__init__ (   self,
  db_path 
)

Initialize the DB.

Will create a connection to the sqlite DB pointed to by db_path

Exception if database needs to be migrated to latest version.

def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.__del__ (   self)

Member Function Documentation

def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.close (   self)
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.close (   self)
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.close (   self)
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.exportRunsAndFitnessInPostProcess (   self,
  postprocess_id,
  outfile,
  sep = ',
  header = True 
)

Write all runs, and their runfitness data, associated with post process entry to a file-like object in CSV format.

Parameters
postprocess_idInteger representing the post process entry whose list of runs we want
outfileFile-like object to which CSV-formatted output should be written. Note, caller is responsible for closing outfile.

Exception if no runs for postprocess_id were found

def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.exportRunsAndFitnessInPostProcess (   self,
  postprocess_id,
  outfile,
  sep = ',
  header = True 
)

Write all runs, and their runfitness data, associated with post process entry to a file-like object in CSV format.

Parameters
postprocess_idInteger representing the post process entry whose list of runs we want
outfileFile-like object to which CSV-formatted output should be written. Note, caller is responsible for closing outfile.

Exception if no runs for postprocess_id were found

def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.exportRunsAndFitnessInPostProcess (   self,
  postprocess_id,
  outfile,
  sep = ',
  header = True 
)

Write all runs, and their runfitness data, associated with post process entry to a file-like object in CSV format.

Parameters
postprocess_idInteger representing the post process entry whose list of runs we want
outfileFile-like object to which CSV-formatted output should be written. Note, caller is responsible for closing outfile.

Exception if no runs for postprocess_id were found

def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getDbVersion (   cls,
  db_path 
)
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getDbVersion (   cls,
  db_path 
)
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getDbVersion (   cls,
  db_path 
)
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getMostRecentRunID (   self,
  session_id 
)

Returns the ID of the run most recently inserted by the given instance of ModelRunnerDB.

Note: if another process has active connections to the underlying sqlite database, the run ID returned will not be the same as the the run ID of the last run inserted by a given instance of ModelRunnerDB, as the other processes may have done in insert into the run table after the most recent insert done by a given instance of ModelRunnerDB.

Parameters
session_idInteger representing the session associated with this run
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getMostRecentRunID (   self,
  session_id 
)

Returns the ID of the run most recently inserted by the given instance of ModelRunnerDB.

Note: if another process has active connections to the underlying sqlite database, the run ID returned will not be the same as the the run ID of the last run inserted by a given instance of ModelRunnerDB, as the other processes may have done in insert into the run table after the most recent insert done by a given instance of ModelRunnerDB.

Parameters
session_idInteger representing the session associated with this run
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getMostRecentRunID (   self,
  session_id 
)

Returns the ID of the run most recently inserted by the given instance of ModelRunnerDB.

Note: if another process has active connections to the underlying sqlite database, the run ID returned will not be the same as the the run ID of the last run inserted by a given instance of ModelRunnerDB, as the other processes may have done in insert into the run table after the most recent insert done by a given instance of ModelRunnerDB.

Parameters
session_idInteger representing the session associated with this run
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getMostRecentSessionID (   self)

Returns the ID of the session most recently inserted by the given instance of ModelRunnerDB.

Note: if another process has active connections to the underlying sqlite database, the session ID returned will not be the same as the the session ID of the last session inserted by a given instance of ModelRunnerDB, as the other processes may have done in insert into the session table after the most recent insert done by a given instance of ModelRunnerDB.

def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getMostRecentSessionID (   self)

Returns the ID of the session most recently inserted by the given instance of ModelRunnerDB.

Note: if another process has active connections to the underlying sqlite database, the session ID returned will not be the same as the the session ID of the last session inserted by a given instance of ModelRunnerDB, as the other processes may have done in insert into the session table after the most recent insert done by a given instance of ModelRunnerDB.

def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getMostRecentSessionID (   self)

Returns the ID of the session most recently inserted by the given instance of ModelRunnerDB.

Note: if another process has active connections to the underlying sqlite database, the session ID returned will not be the same as the the session ID of the last session inserted by a given instance of ModelRunnerDB, as the other processes may have done in insert into the session table after the most recent insert done by a given instance of ModelRunnerDB.

def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getPostProcess (   self,
  postprocess_id 
)

Get the post process entries associated with a session.

Parameters
postprocess_idInteger representing The ID of the post process entry
Returns
Return PostProcess2 or None if the post process with id does not exist.
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getPostProcess (   self,
  postprocess_id 
)

Get the post process entries associated with a session.

Parameters
postprocess_idInteger representing The ID of the post process entry
Returns
Return PostProcess2 or None if the post process with id does not exist.
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getPostProcess (   self,
  postprocess_id 
)

Get the post process entries associated with a session.

Parameters
postprocess_idInteger representing The ID of the post process entry
Returns
Return PostProcess2 or None if the post process with id does not exist.
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getPostProcessForSession (   self,
  session_id 
)

Get the post process entries associated with a session.

Parameters
session_idInteger representing the ID of the session whose post process entries are to be fetch from the DB
Returns
Return a list of PostProcess2 objects; Return an empty list if the session_id does not exist.
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getPostProcessForSession (   self,
  session_id 
)

Get the post process entries associated with a session.

Parameters
session_idInteger representing the ID of the session whose post process entries are to be fetch from the DB
Returns
Return a list of PostProcess2 objects; Return an empty list if the session_id does not exist.
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getPostProcessForSession (   self,
  session_id 
)

Get the post process entries associated with a session.

Parameters
session_idInteger representing the ID of the session whose post process entries are to be fetch from the DB
Returns
Return a list of PostProcess2 objects; Return an empty list if the session_id does not exist.
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRun (   self,
  run_id 
)

Get the run with the supplied ID.

Parameters
run_idInteger representing ID of the run to fetch from the DB
Returns
ModelRun object. Returns None if the run_id does not exist
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRun (   self,
  run_id 
)

Get the run with the supplied ID.

Parameters
run_idInteger representing ID of the run to fetch from the DB
Returns
ModelRun object. Returns None if the run_id does not exist
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRun (   self,
  run_id 
)

Get the run with the supplied ID.

Parameters
run_idInteger representing ID of the run to fetch from the DB
Returns
ModelRun object. Returns None if the run_id does not exist
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRunFitnessForPostProcess (   self,
  postprocess_id 
)

Get the run fitness entries associated with a post process entry.

Parameters
postprocess_idInteger representing the ID of the post process entry whose run fitness entries are to be fetch from the DB
Returns
List of RunFitness2 objects. Returns empty list if the postprocess_id does not exist
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRunFitnessForPostProcess (   self,
  postprocess_id 
)

Get the run fitness entries associated with a post process entry.

Parameters
postprocess_idInteger representing the ID of the post process entry whose run fitness entries are to be fetch from the DB
Returns
List of RunFitness2 objects. Returns empty list if the postprocess_id does not exist
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRunFitnessForPostProcess (   self,
  postprocess_id 
)

Get the run fitness entries associated with a post process entry.

Parameters
postprocess_idInteger representing the ID of the post process entry whose run fitness entries are to be fetch from the DB
Returns
List of RunFitness2 objects. Returns empty list if the postprocess_id does not exist
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRunInSession (   self,
  session_id,
  job_id 
)

Get all runs associated with a session.

Parameters
session_idInteger representing the session whose list of runs we want
job_idString representing job ID of run to retrieve
Returns
ModelRun object
Todo:
Debug and write test case
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRunInSession (   self,
  session_id,
  job_id 
)

Get all runs associated with a session.

Parameters
session_idInteger representing the session whose list of runs we want
job_idString representing job ID of run to retrieve
Returns
ModelRun object
Todo:
Debug and write test case
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRunInSession (   self,
  session_id,
  job_id 
)

Get all runs associated with a session.

Parameters
session_idInteger representing the session whose list of runs we want
job_idString representing job ID of run to retrieve
Returns
ModelRun object
Todo:
Debug and write test case
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRunsInPostProcess (   self,
  postprocess_id,
  where_clause = None 
)

Get all runs, and their runfitness data, associated with post process entry.

Parameters
postprocess_idInteger representing the post process entry whose list of runs we want
where_clauseString representing SQLite3 where clause used to restrict runfitness records returned.
Note
This method does not scrub the where_clause of dangerous elements. Use at your own risk.
Returns
An array of ModelRun2 objects
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRunsInPostProcess (   self,
  postprocess_id,
  where_clause = None 
)

Get all runs, and their runfitness data, associated with post process entry.

Parameters
postprocess_idInteger representing the post process entry whose list of runs we want
where_clauseString representing SQLite3 where clause used to restrict runfitness records returned.
Note
This method does not scrub the where_clause of dangerous elements. Use at your own risk.
Returns
An array of ModelRun2 objects
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRunsInPostProcess (   self,
  postprocess_id,
  where_clause = None 
)

Get all runs, and their runfitness data, associated with post process entry.

Parameters
postprocess_idInteger representing the post process entry whose list of runs we want
where_clauseString representing SQLite3 where clause used to restrict runfitness records returned.
Note
This method does not scrub the where_clause of dangerous elements. Use at your own risk.
Returns
An array of ModelRun2 objects
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRunsInSession (   self,
  session_id,
  where_clause = None 
)

Get all runs associated with a session.

Parameters
session_idInteger representing the session whose list of runs we want
where_clauseString representing SQLite3 where clause used to restrict runs returned.
Note
This method does not scrub the where_clause of dangerous elements. Use at your own risk.
Returns
An array of ModelRun2 objects
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRunsInSession (   self,
  session_id,
  where_clause = None 
)

Get all runs associated with a session.

Parameters
session_idInteger representing the session whose list of runs we want
where_clauseString representing SQLite3 where clause used to restrict runs returned.
Note
This method does not scrub the where_clause of dangerous elements. Use at your own risk.
Returns
An array of ModelRun2 objects
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRunsInSession (   self,
  session_id,
  where_clause = None 
)

Get all runs associated with a session.

Parameters
session_idInteger representing the session whose list of runs we want
where_clauseString representing SQLite3 where clause used to restrict runs returned.
Note
This method does not scrub the where_clause of dangerous elements. Use at your own risk.
Returns
An array of ModelRun2 objects
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRunStatus (   self,
  id 
)

Gets the status of the given run.

Parameters
idInteger representing the ID of the run to update
Returns
String representing the the status of the run, One of: PEND, RUN, PUSP, USUSP, SSUSP, DONE, EXIT, UNKWN, WAIT, ZOMBI
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRunStatus (   self,
  id 
)

Gets the status of the given run.

Parameters
idInteger representing the ID of the run to update
Returns
String representing the the status of the run, One of: PEND, RUN, PUSP, USUSP, SSUSP, DONE, EXIT, UNKWN, WAIT, ZOMBI
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getRunStatus (   self,
  id 
)

Gets the status of the given run.

Parameters
idInteger representing the ID of the run to update
Returns
String representing the the status of the run, One of: PEND, RUN, PUSP, USUSP, SSUSP, DONE, EXIT, UNKWN, WAIT, ZOMBI
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getSession (   self,
  session_id 
)

Get the session with the supplied ID.

Parameters
session_idInteger representing the ID of the session to fetch from the DB
Returns
ModelSession object. Returns None if the session_id does not exist
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getSession (   self,
  session_id 
)

Get the session with the supplied ID.

Parameters
session_idInteger representing the ID of the session to fetch from the DB
Returns
ModelSession object. Returns None if the session_id does not exist
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getSession (   self,
  session_id 
)

Get the session with the supplied ID.

Parameters
session_idInteger representing the ID of the session to fetch from the DB
Returns
ModelSession object. Returns None if the session_id does not exist
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getSessions (   self)

Get all sessions in the DB.

Returns
An array of ModelSession objects
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getSessions (   self)

Get all sessions in the DB.

Returns
An array of ModelSession objects
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.getSessions (   self)

Get all sessions in the DB.

Returns
An array of ModelSession objects
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.insertPostProcess (   self,
  session_id,
  obs_filename,
  fitness_period,
  exclude_date_ranges = None,
  obs_runoff_ratio = None,
  options = None 
)

Creates post process entry for a particular session.

Parameters
session_idInteger representing the ID of the session for which to create a post process entry
obs_filenameString representing the name of the observation file used to calculate fitness statistics for model runs
fitness_periodString indicating time step over which all fitness results were calculated. One of: daily, monthly, yearly
exclude_date_rangesList of tuples of dates representing data to be exluded from fitness calculations
obs_runoff_ratioFloat representing runoff / precipitation for observed data
optionsDict<String, String> representing user-defined post process options
Returns
ID of post process entry created.
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.insertPostProcess (   self,
  session_id,
  obs_filename,
  fitness_period,
  exclude_date_ranges = None,
  obs_runoff_ratio = None,
  options = None 
)

Creates post process entry for a particular session.

Parameters
session_idInteger representing the ID of the session for which to create a post process entry
obs_filenameString representing the name of the observation file used to calculate fitness statistics for model runs
fitness_periodString indicating time step over which all fitness results were calculated. One of: daily, monthly, yearly
exclude_date_rangesList of tuples of dates representing data to be exluded from fitness calculations
obs_runoff_ratioFloat representing runoff / precipitation for observed data
optionsDict<String, String> representing user-defined post process options
Returns
ID of post process entry created.
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.insertPostProcess (   self,
  session_id,
  obs_filename,
  fitness_period,
  exclude_date_ranges = None,
  obs_runoff_ratio = None,
  options = None 
)

Creates post process entry for a particular session.

Parameters
session_idInteger representing the ID of the session for which to create a post process entry
obs_filenameString representing the name of the observation file used to calculate fitness statistics for model runs
fitness_periodString indicating time step over which all fitness results were calculated. One of: daily, monthly, yearly
exclude_date_rangesList of tuples of dates representing data to be exluded from fitness calculations
obs_runoff_ratioFloat representing runoff / precipitation for observed data
optionsDict<String, String> representing user-defined post process options
Returns
ID of post process entry created.
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.insertRun (   self,
  session_id,
  worldfile,
  param_s1,
  param_s2,
  param_s3,
  param_sv1,
  param_sv2,
  param_gw1,
  param_gw2,
  param_vgsen1,
  param_vgsen2,
  param_vgsen3,
  param_svalt1,
  param_svalt2,
  cmd_raw,
  output_path,
  job_id 
)

Creates a new run with a starttime of the current time, and a status of 'PEND'.

Note: you must specify as null (None) any of the param_* arguments that are no used in the run.

Arguments:

Parameters
session_idInteger representing session to associate this run with
worldfileString representing name of worldfile associated with this run
s1Double: decay of hydraulic conductivity with depth (m)
s2Double: surface hydraulic conductivity (K)
s3Double: soil depth (OPTIONAL; default=None)
sv1Double: m to vertical drainage
sv2Double: K to vertical drainage
gw1Double: hillslope sat_to_gw_coeff (amount of water moving from saturated to groundwater store)
gw2Double: hillslope gw_loss_coeff (amount of water moving from groundwater to the stream)
vgsen1Double: Multiplies specific leaf area (SLA – ratio of leaf area to dry weight)
vgsen2Double: Multiplies ratio of shaded to sunlit leaf area
vgsen3Double: changes allocation of net photosynthate based on current LAI (only appl. if using Dickenson C allocation if not using Dickenson, set to 1.0)
svalt1Double: Multiplies psi air entry pressure
svalt2Double: Multiplies pore size
cmd_rawString representing the raw command that invoked this run of RHESSys
output_pathString representing the dir where results for this run are stored
job_idString representing the job ID associated with this run
Returns
The ID of the run created
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.insertRun (   self,
  session_id,
  worldfile,
  param_s1,
  param_s2,
  param_s3,
  param_sv1,
  param_sv2,
  param_gw1,
  param_gw2,
  param_vgsen1,
  param_vgsen2,
  param_vgsen3,
  param_svalt1,
  param_svalt2,
  cmd_raw,
  output_path,
  job_id 
)

Creates a new run with a starttime of the current time, and a status of 'PEND'.

Note: you must specify as null (None) any of the param_* arguments that are no used in the run.

Arguments:

Parameters
session_idInteger representing session to associate this run with
worldfileString representing name of worldfile associated with this run
s1Double: decay of hydraulic conductivity with depth (m)
s2Double: surface hydraulic conductivity (K)
s3Double: soil depth (OPTIONAL; default=None)
sv1Double: m to vertical drainage
sv2Double: K to vertical drainage
gw1Double: hillslope sat_to_gw_coeff (amount of water moving from saturated to groundwater store)
gw2Double: hillslope gw_loss_coeff (amount of water moving from groundwater to the stream)
vgsen1Double: Multiplies specific leaf area (SLA – ratio of leaf area to dry weight)
vgsen2Double: Multiplies ratio of shaded to sunlit leaf area
vgsen3Double: changes allocation of net photosynthate based on current LAI (only appl. if using Dickenson C allocation if not using Dickenson, set to 1.0)
svalt1Double: Multiplies psi air entry pressure
svalt2Double: Multiplies pore size
cmd_rawString representing the raw command that invoked this run of RHESSys
output_pathString representing the dir where results for this run are stored
job_idString representing the job ID associated with this run
Returns
The ID of the run created
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.insertRun (   self,
  session_id,
  worldfile,
  param_s1,
  param_s2,
  param_s3,
  param_sv1,
  param_sv2,
  param_gw1,
  param_gw2,
  param_vgsen1,
  param_vgsen2,
  param_vgsen3,
  param_svalt1,
  param_svalt2,
  cmd_raw,
  output_path,
  job_id 
)

Creates a new run with a starttime of the current time, and a status of 'PEND'.

Note: you must specify as null (None) any of the param_* arguments that are no used in the run.

Arguments:

Parameters
session_idInteger representing session to associate this run with
worldfileString representing name of worldfile associated with this run
s1Double: decay of hydraulic conductivity with depth (m)
s2Double: surface hydraulic conductivity (K)
s3Double: soil depth (OPTIONAL; default=None)
sv1Double: m to vertical drainage
sv2Double: K to vertical drainage
gw1Double: hillslope sat_to_gw_coeff (amount of water moving from saturated to groundwater store)
gw2Double: hillslope gw_loss_coeff (amount of water moving from groundwater to the stream)
vgsen1Double: Multiplies specific leaf area (SLA – ratio of leaf area to dry weight)
vgsen2Double: Multiplies ratio of shaded to sunlit leaf area
vgsen3Double: changes allocation of net photosynthate based on current LAI (only appl. if using Dickenson C allocation if not using Dickenson, set to 1.0)
svalt1Double: Multiplies psi air entry pressure
svalt2Double: Multiplies pore size
cmd_rawString representing the raw command that invoked this run of RHESSys
output_pathString representing the dir where results for this run are stored
job_idString representing the job ID associated with this run
Returns
The ID of the run created
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.insertRunFitnessResults (   self,
  postprocess_id,
  run_id,
  nse = None,
  nse_log = None,
  pbias = None,
  rsr = None,
  runoff_ratio = None,
  userfitness = None 
)

Set fitness results of a model run for a particular post process entry.

Parameters
postprocess_idInteger representing The ID of the post process entry
run_idInteger representing The ID of the run whose fitness results are to be update
fitness_periodString indicating time step over which all fitness results were calculated. One of: daily, monthly, yearly
nseDouble: Nash-Sutcliffe efficiency of streamflow
nse_logDouble: Nash-Sutcliffe efficiency log(streamflow)
pbiasDouble: Percent bias
rsrDouble: RMSE / STDEV_obs
runoff_ratioFloat representing runoff / precipitation for the model run output
userfitnessDict<String, Float> representing user-defined fitness parameters for the run.
Returns
ID of run fitness entry created.
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.insertRunFitnessResults (   self,
  postprocess_id,
  run_id,
  nse = None,
  nse_log = None,
  pbias = None,
  rsr = None,
  runoff_ratio = None,
  userfitness = None 
)

Set fitness results of a model run for a particular post process entry.

Parameters
postprocess_idInteger representing The ID of the post process entry
run_idInteger representing The ID of the run whose fitness results are to be update
fitness_periodString indicating time step over which all fitness results were calculated. One of: daily, monthly, yearly
nseDouble: Nash-Sutcliffe efficiency of streamflow
nse_logDouble: Nash-Sutcliffe efficiency log(streamflow)
pbiasDouble: Percent bias
rsrDouble: RMSE / STDEV_obs
runoff_ratioFloat representing runoff / precipitation for the model run output
userfitnessDict<String, Float> representing user-defined fitness parameters for the run.
Returns
ID of run fitness entry created.
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.insertRunFitnessResults (   self,
  postprocess_id,
  run_id,
  nse = None,
  nse_log = None,
  pbias = None,
  rsr = None,
  runoff_ratio = None,
  userfitness = None 
)

Set fitness results of a model run for a particular post process entry.

Parameters
postprocess_idInteger representing The ID of the post process entry
run_idInteger representing The ID of the run whose fitness results are to be update
fitness_periodString indicating time step over which all fitness results were calculated. One of: daily, monthly, yearly
nseDouble: Nash-Sutcliffe efficiency of streamflow
nse_logDouble: Nash-Sutcliffe efficiency log(streamflow)
pbiasDouble: Percent bias
rsrDouble: RMSE / STDEV_obs
runoff_ratioFloat representing runoff / precipitation for the model run output
userfitnessDict<String, Float> representing user-defined fitness parameters for the run.
Returns
ID of run fitness entry created.
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.insertSession (   self,
  user,
  project,
  notes,
  iterations,
  processes,
  basedir,
  cmd_proto 
)

Creates a new session with a starttime of the current time, and a status of 'submitted'.

Parameters
userString representing the username of the user who is submitting jobs
projectString representing a short description of the project this modeling session is associated with
notesString representing a description of the calibraton session
iterationsInteger representing the number of iterations to calibrate each world file
processesInteger representing the number of simultaneous processes (jobs) to submit
basedirString representing the basedir where run results are stored
cmd_protoString representing the command template for running RHESSys
Returns
The ID of the session
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.insertSession (   self,
  user,
  project,
  notes,
  iterations,
  processes,
  basedir,
  cmd_proto 
)

Creates a new session with a starttime of the current time, and a status of 'submitted'.

Parameters
userString representing the username of the user who is submitting jobs
projectString representing a short description of the project this modeling session is associated with
notesString representing a description of the calibraton session
iterationsInteger representing the number of iterations to calibrate each world file
processesInteger representing the number of simultaneous processes (jobs) to submit
basedirString representing the basedir where run results are stored
cmd_protoString representing the command template for running RHESSys
Returns
The ID of the session
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.insertSession (   self,
  user,
  project,
  notes,
  iterations,
  processes,
  basedir,
  cmd_proto 
)

Creates a new session with a starttime of the current time, and a status of 'submitted'.

Parameters
userString representing the username of the user who is submitting jobs
projectString representing a short description of the project this modeling session is associated with
notesString representing a description of the calibraton session
iterationsInteger representing the number of iterations to calibrate each world file
processesInteger representing the number of simultaneous processes (jobs) to submit
basedirString representing the basedir where run results are stored
cmd_protoString representing the command template for running RHESSys
Returns
The ID of the session
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.migrateDbToCurrentVersion (   cls,
  db_path 
)

DO NOT CALL THIS FUNCTION UNLESS YOU KNOW WHAT YOU ARE DOING.

def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.migrateDbToCurrentVersion (   cls,
  db_path 
)

DO NOT CALL THIS FUNCTION UNLESS YOU KNOW WHAT YOU ARE DOING.

def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.migrateDbToCurrentVersion (   cls,
  db_path 
)

DO NOT CALL THIS FUNCTION UNLESS YOU KNOW WHAT YOU ARE DOING.

def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.updateRunEndtime (   self,
  id,
  endtime,
  status 
)

Updates the end time and the status of the given run.

Parameters
idInteger representing the ID of the run to update
endtimedatetime representing the end time of the run (in UTC not local time)
statusString: one of: PEND, RUN, PUSP, USUSP, SSUSP, DONE, EXIT, UNKWN, WAIT, ZOMBI
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.updateRunEndtime (   self,
  id,
  endtime,
  status 
)

Updates the end time and the status of the given run.

Parameters
idInteger representing the ID of the run to update
endtimedatetime representing the end time of the run (in UTC not local time)
statusString: one of: PEND, RUN, PUSP, USUSP, SSUSP, DONE, EXIT, UNKWN, WAIT, ZOMBI
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.updateRunEndtime (   self,
  id,
  endtime,
  status 
)

Updates the end time and the status of the given run.

Parameters
idInteger representing the ID of the run to update
endtimedatetime representing the end time of the run (in UTC not local time)
statusString: one of: PEND, RUN, PUSP, USUSP, SSUSP, DONE, EXIT, UNKWN, WAIT, ZOMBI
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.updateRunJobId (   self,
  id,
  job_id 
)

Updates the job_id of the given run.

Parameters
idInteger representing the ID of the run to update
job_idString representing the job ID of the run
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.updateRunJobId (   self,
  id,
  job_id 
)

Updates the job_id of the given run.

Parameters
idInteger representing the ID of the run to update
job_idString representing the job ID of the run
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.updateRunJobId (   self,
  id,
  job_id 
)

Updates the job_id of the given run.

Parameters
idInteger representing the ID of the run to update
job_idString representing the job ID of the run
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.updateRunStatus (   self,
  id,
  status,
  endtime = None 
)

Updates the status of the given run.

If endtime is not None, will update endtime as well as status

Parameters
idInteger representing the ID of the run to update
statusString: one of: PEND, RUN, PUSP, USUSP, SSUSP, DONE, EXIT, UNKWN, WAIT, ZOMBI
endtimedatetime representing the end time of the run (in UTC not local time)
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.updateRunStatus (   self,
  id,
  status,
  endtime = None 
)

Updates the status of the given run.

If endtime is not None, will update endtime as well as status

Parameters
idInteger representing the ID of the run to update
statusString: one of: PEND, RUN, PUSP, USUSP, SSUSP, DONE, EXIT, UNKWN, WAIT, ZOMBI
endtimedatetime representing the end time of the run (in UTC not local time)
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.updateRunStatus (   self,
  id,
  status,
  endtime = None 
)

Updates the status of the given run.

If endtime is not None, will update endtime as well as status

Parameters
idInteger representing the ID of the run to update
statusString: one of: PEND, RUN, PUSP, USUSP, SSUSP, DONE, EXIT, UNKWN, WAIT, ZOMBI
endtimedatetime representing the end time of the run (in UTC not local time)
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.updateSessionEndtime (   self,
  id,
  endtime,
  status 
)

Updates the end time and the status of the given session.

Parameters
idInteger representing the ID of the session to update
endtimedatetime representing the end time of the session (in UTC not local time)
statusString: one of: submitted, complete, aborted
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.updateSessionEndtime (   self,
  id,
  endtime,
  status 
)

Updates the end time and the status of the given session.

Parameters
idInteger representing the ID of the session to update
endtimedatetime representing the end time of the session (in UTC not local time)
statusString: one of: submitted, complete, aborted
def rhessyscalibrator.model_runner_db2.ModelRunnerDB2.updateSessionEndtime (   self,
  id,
  endtime,
  status 
)

Updates the end time and the status of the given session.

Parameters
idInteger representing the ID of the session to update
endtimedatetime representing the end time of the session (in UTC not local time)
statusString: one of: submitted, complete, aborted

Member Data Documentation

float rhessyscalibrator.model_runner_db2.ModelRunnerDB2.DB_VERSION = 2.0
static
string rhessyscalibrator.model_runner_db2.ModelRunnerDB2.ELEM_SEP = '|'
static
rhessyscalibrator.model_runner_db2.ModelRunnerDB2.version

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