Package schrodinger :: Package job :: Module launchapi :: Class TaskSpecificationBuilder
[hide private]
[frames] | no frames]

Class TaskSpecificationBuilder

object --+
         |
        TaskSpecificationBuilder

A class for building up a TaskSpecification from a specific list of command-line arguments.

Instance Methods [hide private]
 
__init__(self, data=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
getTaskSpec(self)
 
setCommandLine(self, args, use_schrodinger_run=True, schrodinger_product=None)
Set the command line as provided.
str
setInputFile(self, filename, key=None, jobname_source=False)
Set an input file for the task specification.
 
_updateCommandLineArgs(self, key, filename)
 
addLicense(self, license_name, license_tokens)
 
setOutputFile(self, runtime_path, key=None, stream=False)
 
_redirect(self, key, runtime_path, stream=False)
Redirect stderr or stdout to a file.
 
setStderr(self, runtime_path, stream=False)
 
setStdout(self, runtime_path, stream=False)
 
setProgramName(self, program_name)
 
_fromData(self, data)
 
_loadCommandLine(self, data)
Verify and load the command-line specification from the JSON data.
 
_loadInputSpec(self, data)
 
_loadJobname(self, data)
Load the optional jobname spec.
 
_loadOutputSpec(self, data)
Load the optional output spec.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, data=None)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

setCommandLine(self, args, use_schrodinger_run=True, schrodinger_product=None)

 

Set the command line as provided. Add a SCHRODINGER/run if requested.

Parameters:
  • args (list of str) - The command-line script and arguments.
  • use_schrodinger_run - If True, run the command under $SCHRODINGER/run.
  • schrodinger_product (str) - A product directory to search for the script/executable. This should be the name of a directory under SCHRODINGER without the trailing version (i.e. the "-v*" part).
  • schrodinger_run (bool)

setInputFile(self, filename, key=None, jobname_source=False)

 

Set an input file for the task specification.

Parameters:
  • key (str) - Use the provided key for the input file in the command-line arguments template. If not specified, will default to INPUT_<N>.
Returns: str
The key used for the input file.

addLicense(self, license_name, license_tokens)

 
Parameters:
  • license_name (schrodinger.infra.licensing.MMLIC3*) - Name of a license token that is checked out.
  • license_tokens (str) - The number of tokens required by this job type.

setOutputFile(self, runtime_path, key=None, stream=False)

 
Parameters:
  • runtime_path (str) - The path of an ouptut file that will be generated. May contain input keys in the form <KEY> or <JOBNAME> (if a jobname source has been specified).
  • key (str) - A key to be used to reference this output file.
  • stream (bool) - If True and if possible, the output file will be streamed back while the job is running. Defaults to False. Optional.

_redirect(self, key, runtime_path, stream=False)

 

Redirect stderr or stdout to a file.

Parameters:
  • key (str) - STDERR_KEY or STDOUT_KEY
  • runtime_path (str) - A runtime_path with input keys in the form <KEY>.
  • stream (bool) - If True and if possible, the file will be streamed back while the job is running. Defaults to False. Optional.

setStderr(self, runtime_path, stream=False)

 
Parameters:
  • runtime_path (str) - A runtime_path template with input keys in the form <KEY>.
  • stream (bool) - If True and if possible, the file will be streamed back while the job is running. Defaults to False. Optional.

setStdout(self, runtime_path, stream=False)

 
Parameters:
  • runtime_path (str) - A runtime_path template with input keys in the form <KEY>.
  • stream (bool) - If True and if possible, the file will be streamed back while the job is running. Defaults to False. Optional.