schrodinger.application.jaguar.workflow_input module¶
Functions and classes for defining the input to a Workflow workflow.
-
class
schrodinger.application.jaguar.workflow_input.
WorkflowInput
(inputfile=None, keywords=None, jaguar_keywords=None, jobname=None)[source]¶ Bases:
abc.ABC
A Base class for specifying parameters in workflow calculations.
- The following functions must be defined in the inheriting class:
validate(self)
generate_keywords(self)
-
abstract
generate_keywords
()[source]¶ Initialize the list of possible keywords
- Return type
dictionary (keys are lowercase string, values are WorkflowKeyword)
- Return param
key, WorkflowKeyword pairs specific to this job’s input file
-
abstract
validate
()[source]¶ Perform a self-consistency check of all currently set keywords.
write for inheriting class :return param: Whether or no input passes workflow-specific
validation checks
- Return type
bool
-
input_file_keys
= []¶
-
workflow_name
= 'Workflow'¶
-
__init__
(inputfile=None, keywords=None, jaguar_keywords=None, jobname=None)[source]¶ Create a WorkflowInput instance. If a keyword is specified in both ‘inputfile’ and ‘keywords’, then the values in ‘keywords’ will be set preferrentially. This also applies to ‘jaguar_keywords’.
- Parameters
inputfile (str) – Path to a Workflow input file
keywords (dict) – Workflow keyword/value pairs
jaguar_keywords (dict) – Jaguar &gen section keyword/value pairs
jobname (string) – Name of job, if it is not None it will be set to the basename of the input file name.
-
property
keywords
¶
-
property
values
¶ Support access to WorkflowKeyword values via attribute syntax. e.g.
wi = WorkflowInput() print wi.values.optimize # print ‘optimize’ keyword value
-
getValue
(keyword)[source]¶ Return the value for Workflow keyword. The return type depends on the keyword.
- Parameters
keyword (string) – name of keyword
:raise WorkflowKeywordError if no keyword found
-
setValue
(keyword, value)[source]¶ Set the Workflow keyword ‘keyword’ to value ‘value’. Note that there may be type-checking and conversion by the WorkflowKeyword class.
If ‘value’ is None, the keyword will be reset.
- Parameters
keyword (string) – name of keyword
value (anytype) – value of keyword
:raise WorkflowKeywordError if no keyword found
-
setValues
(keywords)[source]¶ Set multiple Workflow keywords.
- Parameters
keywords (dict of string/anytype pairs) – keyword/value pairs
-
getJaguarValue
(key)[source]¶ Return the value for Jaguar keyword ‘key’. The return type depends on the keyword.
- Parameters
key (string) – name of keyword
-
setJaguarValue
(key, value)[source]¶ Set the Jaguar &gen section keyword ‘key’ to value ‘value’.
- Parameters
key (string) – name of keyword
value (anytype) – value of keyword
:raise JaguarKeywordException if keyword is invalid
-
setJaguarValues
(keywords)[source]¶ Set multiple Jaguar &gen section keywords.
- Parameters
keywords (dict of string/anytype pairs) – Jaguar &gen section keyword/value pairs
-
getJaguarNonDefault
()[source]¶ Return a dictionary of all non-default Jaguar keys except ‘multip’ and ‘molchg’, which must be retrieved explicitly.
-
resetKey
(keyword)[source]¶ Reset keyword to default state.
- Parameters
keyword (string) – name of keyword
-
getDefault
(keyword)[source]¶ Return the default value for Workflow keyword ‘keyword’. The return type depends on the keyword.
- Parameters
keyword (string) – name of keyword
:raise WorkflowKeywordError if no keyword found
-
getNonDefaultKeys
()[source]¶ Return a dictionary of all non-default-value WorkflowKeyword instances indexed by name.
-
isNonDefault
(keyword)[source]¶ Has the specified keyword been set to a non-default value?
- Parameters
keyword (str) – The key to check
- Returns
True if the specified keyword is set to a non-default value. False otherwise.
-
setConstraints
(constraints)[source]¶ Set the constraints.
- Parameters
constraints (dict of str: Coordinate instance) – dictionary relating structure title to a list of Coordinate instances which define the constraints
-
getConstraints
()[source]¶ Return the constraints defined in the input file
- Returns
a dict relating structure titles to constraints the constraints are given as a list of Coordinate instances and the titles refer to the titles of the input molecules.
-
setFrozenAtoms
(frozen_atoms)[source]¶ Set the constraints.
- Parameters
frozen_atoms (dict of str: Coordinate instance) – dictionary relating structure title to a list of Coordinate instances which define the frozen atoms
-
getFrozenAtoms
()[source]¶ Return the frozen atoms defined in the input file :return: a dict relating structure titles to constraints
the constraints are given as a list of Coordinate instances and the titles refer to the titles of the input molecules.
-
validate_jaguar_keywords
(sts)[source]¶ Perform a check to ensure that Jaguar keywords are not set in a way that cannot be handled.
- Parameters
sts (list of Structure objects) – Structures whose basis needs validating
-
save
(name)[source]¶ Create a Workflow input file called ‘name’ in the current working directory based on this class instance. Only write the non-default keyword values.
- Parameters
name (str) – Path to a Workflow input file
-
setJobname
(jobname)[source]¶ Set the attribute jobname.
- Parameters
jobname (string) – input name of job. If jobname is None we try to use self._inputfile. If that is also None we assign a unique name.
-
read
(inputfile)[source]¶ Read an existing Workflow input file. Any keywords specified in the input file will override existing values in this WorkflowInput instance.
- Jaguar &gen section keywords are defined like:
- &JaguarKeywords
key=val key=val …
&
- Constraints can be defined with
- &Constraints
st_title atom_index1 atom_index2… value
&
- Parameters
inputfile (str) – Path to a Workflow input file
-
remove_input_file_paths
()[source]¶ Remove full paths from file specifications. A new input file is no longer written, if that is desired the user must call the save method.