structure_step package#
Submodules#
structure_step.metadata module#
This file contains metadata describing the results from Structure
structure_step.structure module#
Non-graphical part of the Structure step in a SEAMM flowchart
- class structure_step.structure.Structure(flowchart=None, title='Structure', namespace='org.molssi.seamm', extension=None, logger=<Logger structure_step.structure (WARNING)>)[source]#
Bases:
Node,ASE_mixin,geomeTRIC_mixinThe non-graphical part of a Structure step in a flowchart.
- parser#
The parser object.
- Type:
configargparse.ArgParser
- options#
It contains a two item tuple containing the populated namespace and the list of remaining argument strings.
- Type:
tuple
- subflowchart#
A SEAMM Flowchart object that represents a subflowchart, if needed.
- Type:
seamm.Flowchart
- parameters#
The control parameters for Structure.
- Type:
See also
TkStructure,Structure,StructureParameters- analyze(indent='', **kwargs)[source]#
Do any analysis of the output from this step.
Also print important results to the local step.out file using “printer”.
- Parameters:
indent (str) – An extra indentation for the output
- description_text(P=None, short=False, natoms=None)[source]#
Create the text description of what this step will do. The dictionary of control values is passed in as P so that the code can test values, etc.
- Parameters:
P (dict) – An optional dictionary of the current values of the control parameters.
short (bool) – If True, return a short description of the step.
natoms (int) – The number of atoms in the structure.
- Returns:
A description of the current step.
- Return type:
str
- generate_stereoisomers(P)[source]#
Generate the stereoisomers.
- Parameters:
P (dict(str, value)) – The control parameters
- property git_revision#
The git version of this module.
- optimize(P, PP)[source]#
Optimize the structure to a minimum or transition state
- Parameters:
P (dict(str, value)) – The control parameters
PP (dict(str, value)) – The printable control parameters
- plot(E_units='', F_units='')[source]#
Generate a plot of the convergence of the geometry optimization.
- run()[source]#
Run a Structure step.
- Parameters:
None
- Returns:
The next node object in the flowchart.
- Return type:
seamm.Node
- property version#
The semantic version of this module.
structure_step.structure_parameters module#
Control parameters for the Structure step in a SEAMM flowchart
- class structure_step.structure_parameters.StructureParameters(defaults={}, data=None)[source]#
Bases:
ParametersThe control parameters for Structure.
You need to replace the “time” entry in dictionary below these comments with the definitions of parameters to control this step. The keys are parameters for the current plugin,the values are dictionaries as outlined below.
Examples
parameters = { "time": { "default": 100.0, "kind": "float", "default_units": "ps", "enumeration": tuple(), "format_string": ".1f", "description": "Simulation time:", "help_text": ("The time to simulate in the dynamics run.") }, }
- parameters{str: {str: str}}
A dictionary containing the parameters for the current step. Each key of the dictionary is a dictionary that contains the the following keys:
- parameters[“default”] :
The default value of the parameter, used to reset it.
- parameters[“kind”]enum()
Specifies the kind of a variable. One of “integer”, “float”, “string”, “boolean”, or “enum”
While the “kind” of a variable might be a numeric value, it may still have enumerated custom values meaningful to the user. For instance, if the parameter is a convergence criterion for an optimizer, custom values like “normal”, “precise”, etc, might be adequate. In addition, any parameter can be set to a variable of expression, indicated by having “$” as the first character in the field. For example, $OPTIMIZER_CONV.
- parameters[“default_units”]str
The default units, used for resetting the value.
- parameters[“enumeration”]tuple
A tuple of enumerated values.
- parameters[“format_string”]str
A format string for “pretty” output.
- parameters[“description”]str
A short string used as a prompt in the GUI.
- parameters[“help_text”]str
A longer string to display as help for the user.
See also
Structure,TkStructure,Structure,StructureStep- parameters = {'Energy change criterion': {'default': 1e-06, 'default_units': 'E_h', 'description': 'Energy:', 'enumeration': (), 'format_string': '.g', 'help_text': 'The criterion for the change of the energy between steps.', 'kind': 'float'}, 'Maximum atomic gradient criterion': {'default': 0.00045, 'default_units': 'E_h/Å', 'description': 'Maximum atomic gradient:', 'enumeration': (), 'format_string': '.g', 'help_text': 'The criterion for the maximum gradient of an atom.', 'kind': 'float'}, 'Maximum atomic step criterion': {'default': 0.00045, 'default_units': 'Å', 'description': 'Maximum atomic step:', 'enumeration': (), 'format_string': '.g', 'help_text': 'The criterion for the maximum displacement of an atom between steps.', 'kind': 'float'}, 'RMS gradient criterion': {'default': 0.0003, 'default_units': 'E_h/Å', 'description': 'RMS gradient:', 'enumeration': (), 'format_string': '.g', 'help_text': 'The criterion for the RMS gradient.', 'kind': 'float'}, 'RMS step criterion': {'default': 0.0003, 'default_units': 'Å', 'description': 'RMS step:', 'enumeration': (), 'format_string': '.g', 'help_text': 'The criterion for the RMS displacement between steps.', 'kind': 'float'}, 'approach': {'default': 'Optimization', 'default_units': '', 'description': 'Approach:', 'enumeration': ('Optimization',), 'format_string': '', 'help_text': 'The approach or method for determining the structure.', 'kind': 'enum'}, 'calculate hessian': {'default': 'never', 'default_units': '', 'description': 'Recalculate Hessian:', 'enumeration': ('never', 'first', 'each', 'first+last'), 'format_string': '', 'help_text': 'How often to recalculate the Hessian.', 'kind': 'enum'}, 'continue if not converged': {'default': 'no', 'default_units': '', 'description': 'Continue if not converged:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to stop if the optimizer does not converge.', 'kind': 'boolean'}, 'convergence': {'default': 'Gaussian', 'default_units': '', 'description': 'Convergence criterion:', 'enumeration': ('custom', 'ASE', 'Gaussian (loose)', 'Gaussian', 'Gaussian (tight)', 'Gaussian (very tight)', 'Inter-fragment (tight)', 'MolPro', 'NWChem (loose)', 'NWChem', 'NWChem (tight)', 'QChem', 'Turbomole'), 'format_string': 's', 'help_text': 'The criterion for convergence of the optimizer.', 'kind': 'enum'}, 'convergence formula': {'default': '', 'default_units': '', 'description': 'Convergence formula:', 'enumeration': (), 'format_string': 's', 'help_text': 'The formula of the criteria for convergence.', 'kind': 'enum'}, 'coordinate system': {'default': 'TRIC: translation-rotation internal coordinates', 'default_units': '', 'description': 'The coordinate system to use:', 'enumeration': ('TRIC: translation-rotation internal coordinates', 'TRIC-p: primitive (redundant) TRIC', 'Cart: Cartesian coordinates', 'DLC: delocalized internal coordinates', 'HDLC: hybrid delocalized internal coordinates'), 'format_string': '', 'help_text': 'The coordinates system to use in the calculation.', 'kind': 'integer'}, 'max steps': {'default': '12 * natoms', 'default_units': '', 'description': 'Maximum # of steps:', 'enumeration': ('6 * natoms', '12 * natoms', '18 * natoms'), 'format_string': '', 'help_text': 'The maximum number of steps to take.', 'kind': 'integer'}, 'max stereoisomers': {'default': 1024, 'default_units': '', 'description': 'Maximum # of stereoisomers:', 'enumeration': (), 'format_string': '', 'help_text': 'The maximum number of stereoisomers to keep.', 'kind': 'integer'}, 'on error': {'default': 'keep all subdirectories', 'default_units': '', 'description': 'On error:', 'enumeration': ('keep last subdirectory', 'keep all subdirectories', 'delete all subdirectories'), 'format_string': '', 'help_text': 'Which subdirectories to keep if there is an error.', 'kind': 'enum'}, 'on success': {'default': 'keep last subdirectory', 'default_units': '', 'description': 'On success:', 'enumeration': ('keep last subdirectory', 'keep all subdirectories', 'delete all subdirectories'), 'format_string': '', 'help_text': 'Which subdirectories to keep.', 'kind': 'enum'}, 'optimizer': {'default': 'geomeTRIC/geomeTRIC', 'default_units': '', 'description': 'Method:', 'enumeration': (), 'format_string': '', 'help_text': 'The optimizer to use.', 'kind': 'enum'}, 'results': {'default': {}, 'default_units': None, 'description': 'results', 'enumeration': (), 'format_string': '', 'help_text': 'The results to save to variables or in tables.', 'kind': 'dictionary'}, 'target': {'default': 'minimum', 'default_units': '', 'description': 'Target:', 'enumeration': ('minimum', 'transition state', 'stereoisomers'), 'format_string': '', 'help_text': 'The type of structure that is the target.', 'kind': 'enum'}}#
structure_step.structure_step module#
- class structure_step.structure_step.StructureStep(flowchart=None, gui=None)[source]#
Bases:
objectHelper class needed for the stevedore integration.
This must provide a description() method that returns a dict containing a description of this node, and create_node() and create_tk_node() methods for creating the graphical and non-graphical nodes.
The dictionary for the description is the class variable just below these comments. The felds are as follows:
- my_description{str, str}
A human-readable description of this step. It can be several lines long, and needs to be clear to non-expert users. It contains the following keys: description, group, name.
- my_description[“description”]tuple
A description of the Structure step. It must be clear to non-experts.
- my_description[“group”]str
Which group in the menus to put this step. If the group does not exist it will be created. Common groups are “Building”, “Control”, “Custom”, “Data”, and “Simulations”.
- my_description[“name”]str
The name of this step, to be displayed in the menus.
- create_node(flowchart=None, **kwargs)[source]#
Create and return the new node object.
- Parameters:
flowchart (seamm.Node) – A non-graphical SEAMM node
**kwargs (keyword arguments) – Various keyword arguments such as title, namespace or extension representing the title displayed in the flowchart, the namespace for the plugins of a subflowchart and the extension, respectively.
- Return type:
- create_tk_node(canvas=None, **kwargs)[source]#
Create and return the graphical Tk node object.
- Parameters:
canvas (tk.Canvas) – The Tk Canvas widget
**kwargs (keyword arguments) – Various keyword arguments such as tk_flowchart, node, x, y, w, h representing a graphical flowchart object, a non-graphical node for a step, and dimensions of the graphical node.
- Return type:
- description()[source]#
Return a description of what this step does.
- Returns:
description
- Return type:
dict(str, str)
- my_description = {'description': 'An interface for predicting structures', 'group': 'Properties', 'name': 'Structure'}#
structure_step.tk_structure module#
The graphical part of a Structure step
- class structure_step.tk_structure.TkStructure(tk_flowchart=None, node=None, namespace='org.molssi.seamm.tk', canvas=None, x=None, y=None, w=200, h=50)[source]#
Bases:
TkNodeThe graphical part of a Structure step in a flowchart.
- tk_flowchart#
The flowchart that we belong to.
- Type:
TkFlowchart = None
- node#
The corresponding node of the non-graphical flowchart
- Type:
Node = None
- canvas#
The Tk Canvas to draw on
- Type:
tkCanvas = None
- dialog#
The Pmw dialog object
- Type:
Dialog
- x#
The x-coordinate of the center of the picture of the node
- Type:
int = None
- y#
The y-coordinate of the center of the picture of the node
- Type:
int = None
- w#
The width in pixels of the picture of the node
- Type:
int = 200
- h#
The height in pixels of the picture of the node
- Type:
int = 50
- self[widget]#
A dictionary of tk widgets built using the information contained in Structure_parameters.py
- Type:
dict
See also
Structure,TkStructure,StructureParameters- create_dialog()[source]#
Create the dialog. A set of widgets will be chosen by default based on what is specified in the Structure_parameters module.
- Parameters:
None
- Return type:
None
See also
- reset_dialog(widget=None)[source]#
Layout the widgets in the dialog.
The widgets are chosen by default from the information in Diffusivity parameters.
This function simply lays them out row by row with aligned labels. You may wish a more complicated layout that is controlled by values of some of the control parameters. If so, edit or override this method
- Parameters:
widget (Tk Widget = None)
- Return type:
None
See also
TkDiffusivity.create_dialog
- reset_structure_frame(widget=None)[source]#
Layout the widgets in the structure frame as needed for the current state
Module contents#
structure_step A SEAMM plug-in for energy optimized structures