schrodinger.application.xtb.input module

Functions and classes for defining the input to xTB workflow.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.xtb.input.XTBInput(keywords: dict)

Bases: schrodinger.application.jaguar.workflow_input.WorkflowInput

input_file_keys = ['default.inp']
workflow_name = 'XTB'
__init__(keywords: dict)

Create an XTBInput instance.

Parameters

keywords – XTB keyword/value pairs

generate_keywords() Dict[str, Dict[str, schrodinger.application.xtb.keywords.XTBKeyword]]

Initialize dictionary of all possible XTB keywords

validate()

Perform a self-consistency check of all currently set keywords.

:raise WorkflowKeywordConflictError if conflicting values found

getValue(keyword: str) Any

Return the value for Workflow keyword. The return type depends on the keyword.

Parameters

keyword – name of keyword

:raise WorkflowKeywordError if no keyword found

setValue(keyword: str, value: Any)

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 – name of keyword

  • value – value of keyword

Raises

WorkflowKeywordException – if no keyword found or there is an issue with the keyword or value

resetKey(keyword: str)

Reset keyword to default state.

Parameters

keyword – name of keyword

getNonDefaultKeys() Dict[str, Dict[str, schrodinger.application.xtb.keywords.XTBKeyword]]

Return a dictionary of all non-default-value WorkflowKeyword instances indexed by name.

isNonDefault(keyword: str) bool

Has the specified keyword been set to a non-default value?

Parameters

keyword – The key to check

Returns

True if the specified keyword is set to a non-default value. False otherwise.

save(name='default.inp')

Save the current XTBInput instance to a file.

Parameters

name – Name of the file to save to

getConstraints()

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.

getDefault(keyword: str)

Return the default value for Workflow keyword ‘keyword’. The return type depends on the keyword.

Parameters

keyword – name of keyword

:raise WorkflowKeywordError if no keyword found

getFrozenAtoms() Dict[str, List[schrodinger.application.jaguar.autots_bonding.Coordinate]]

Return the frozen atoms 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.

getJaguarNonDefault() Dict[str, Any]

Return a dictionary of all non-default Jaguar keys except ‘multip’ and ‘molchg’, which must be retrieved explicitly.

getJaguarValue(key: str) Any

Return the value for Jaguar keyword ‘key’. The return type depends on the keyword.

Parameters

key – name of keyword

get_input_files() Set[str]

Return set of expected input files.

have_constraints() bool

Do we have internal coordinate constraints

have_frozen_atoms() bool

Do we have frozen atom constraints

property keywords
read(inputfile: str)

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 – Path to a Workflow input file

remove_input_file_paths()

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.

resetAll()

Reset all keywords to their default states.

setConstraints(constraints: Dict[str, List[schrodinger.application.jaguar.autots_bonding.Coordinate]])

Set the constraints.

Parameters

constraints (dict of str: Coordinate instance) – dictionary relating structure title to a list of Coordinate instances which define the constraints

setFrozenAtoms(frozen_atoms: Dict[str, List[schrodinger.application.jaguar.autots_bonding.Coordinate]])

Set the constraints.

Parameters

frozen_atoms – dictionary relating structure title to a list of Coordinate instances which define the frozen atoms

setJaguarValue(key: str, value: Any)

Set the Jaguar &gen section keyword ‘key’ to value ‘value’.

Parameters
  • key – name of keyword

  • value – value of keyword

:raise JaguarKeywordException if keyword is invalid

setJaguarValues(keywords: Dict[str, Any])

Set multiple Jaguar &gen section keywords.

Parameters

keywords – Jaguar &gen section keyword/value pairs

setJobname(jobname: str)

Set the attribute jobname.

Parameters

jobname – input name of job. If jobname is None we try to use self._inputfile. If that is also None we assign a unique name.

setValues(keywords)

Set multiple Workflow keywords.

Parameters

keywords (dict of string/anytype pairs) – keyword/value pairs

update_input_file_paths()

Update full paths for file specifications to reflect the CWD. This is useful if running this job in a subdirectory or on a remote host.

validate_jaguar_keywords(sts: List[schrodinger.structure._structure.Structure])

Perform a check to ensure that Jaguar keywords are not set in a way that cannot be handled.

Parameters

sts – Structures whose basis needs validating

property values

Support access to WorkflowKeyword values via attribute syntax. e.g.:

wi = WorkflowInput()
print wi.values.optimize   # print 'optimize' keyword value