set_cell_step package
Submodules
set_cell_step.set_cell module
Non-graphical part of the Set Cell step in a SEAMM flowchart
- class set_cell_step.set_cell.SetCell(flowchart=None, title='Set Cell', extension=None, logger=<Logger set_cell_step.set_cell (WARNING)>)[source]
Bases:
Node
The non-graphical part of a Set Cell 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 Set Cell.
- Type:
See also
TkSetCell
,SetCell
,SetCellParameters
- description_text(P=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.
- Returns:
A description of the current step.
- Return type:
str
- property git_revision
The git version of this module.
- run()[source]
Run a Set Cell step.
- Parameters:
None –
- Returns:
The next node object in the flowchart.
- Return type:
seamm.Node
- property version
The semantic version of this module.
set_cell_step.set_cell_parameters module
Control parameters for the Set Cell step in a SEAMM flowchart
- class set_cell_step.set_cell_parameters.SetCellParameters(defaults={}, data=None)[source]
Bases:
Parameters
The control parameters for Set Cell.
The developer will add a dictionary of Parameters to this class. The keys are parameters for the current plugin, which themselves might be dictionaries.
You need to replace the ‘time’ example below with one or more definitions of the control parameters for your plugin and application.
- parameters
‘format_string’, description’, help_text’}
A dictionary containing the parameters for the current step. Each key of the dictionary is a dictionary that contains the the following keys: kind, default, default_units, enumeration, format_string, description and help text.
- Type:
{‘kind’, ‘default’, ‘default_units’, ‘enumeration’,
- parameters['kind']
Specifies the kind of a variable. 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.
- Type:
custom
- parameters['default']
‘enum’ The default value of the parameter, used to reset it.
- Type:
‘integer’ or ‘float’ or ‘string’ or ‘boolean’ or
- parameters['default_units']
The default units, used for resetting the value.
- Type:
str
- parameters['enumeration']
A tuple of enumerated values.
- Type:
tuple
- parameters['format_string']
A format string for ‘pretty’ output.
- Type:
str
- parameters['description']
A short string used as a prompt in the GUI.
- Type:
str
- parameters['help_text']
A longer string to display as help for the user.
- Type:
tuple
See also
SetCell
,TkSetCell
,SetCell
,SetCellParameters
,Set
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 = {'a': {'default': '10', 'default_units': 'Å', 'description': 'a:', 'enumeration': None, 'format_string': '.2f', 'help_text': 'The length of the first side of the cell.', 'kind': 'float'}, 'alpha': {'default': 90.0, 'default_units': 'degree', 'description': 'alpha:', 'enumeration': None, 'format_string': '.1f', 'help_text': 'The angle between a and b.', 'kind': 'float'}, 'b': {'default': '10', 'default_units': 'Å', 'description': 'b:', 'enumeration': None, 'format_string': '.2f', 'help_text': 'The length of the second side of the cell.', 'kind': 'float'}, 'beta': {'default': 90.0, 'default_units': 'degree', 'description': 'beta:', 'enumeration': None, 'format_string': '.1f', 'help_text': 'The angle between a and c.', 'kind': 'float'}, 'c': {'default': '10', 'default_units': 'Å', 'description': 'c:', 'enumeration': None, 'format_string': '.2f', 'help_text': 'The length of the third side of the cell.', 'kind': 'float'}, 'density': {'default': '1', 'default_units': 'g/mL', 'description': 'Density:', 'enumeration': (), 'format_string': '.3f', 'help_text': 'The target density of the cell.', 'kind': 'float'}, 'expansion': {'default': '1%', 'default_units': None, 'description': 'Percent contraction (-)/expansion(+):', 'enumeration': (), 'format_string': '', 'help_text': 'The amount to contract (negative value) or expand (positive value). The change is proportional to current cell lengths and does not affect the angles.', 'kind': 'str'}, 'gamma': {'default': 90.0, 'default_units': 'degree', 'description': 'gamma:', 'enumeration': None, 'format_string': '.1f', 'help_text': 'The angle between b and c.', 'kind': 'float'}, 'method': {'default': 'density', 'default_units': None, 'description': 'Adjust cell by:', 'enumeration': ('density', 'volume', 'cell parameters', 'uniform contraction/expansion'), 'format_string': '', 'help_text': 'How to adjust the cell', 'kind': 'enumeration'}, 'volume': {'default': '1000', 'default_units': 'Å^3', 'description': 'Volume:', 'enumeration': (), 'format_string': '.3f', 'help_text': 'The target volume of the cell.', 'kind': 'float'}}
set_cell_step.set_cell_step module
- class set_cell_step.set_cell_step.SetCellStep(flowchart=None, gui=None)[source]
Bases:
object
Helper 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.
- my_description
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.
- Type:
{description, group, name}
- my_description['description']
A description of the Set Cell step. It must be clear to non-experts.
- Type:
tuple
- my_description['group']
Which group in the menus to put this step. If the group does not exist it will be created. Common groups are ‘Building’, ‘Calculations’, ‘Control’ and ‘Data’.
- Type:
str
- my_description['name']
The name of this step, to be displayed in the menus.
- Type:
str
- create_node(flowchart=None, **kwargs)[source]
Create and return the new node object.
- Parameters:
flowchart (seamm.Node) – A non-graphical SEAMM node
**kwargs (keyworded arguments) – Various keyworded 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:
See also
SetCell
- create_tk_node(canvas=None, **kwargs)[source]
Create and return the graphical Tk node object.
- Parameters:
canvas (tk.Canvas) – The Tk Canvas widget
**kwargs (keyworded arguments) – Various keyworded 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:
See also
TkSetCell
- my_description = {'description': 'An interface for Set Cell', 'group': 'Building', 'name': 'Set Cell'}
set_cell_step.tk_set_cell module
The graphical part of a Set Cell step
- class set_cell_step.tk_set_cell.TkSetCell(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50)[source]
Bases:
TkNode
The graphical part of a Set Cell 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
- namespace
The namespace of the current step.
- Type:
str
- sub_tk_flowchart
A graphical Flowchart representing a subflowchart
- Type:
TkFlowchart
- 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 Set Cell_parameters.py
- Type:
dict
See also
SetCell
,TkSetCell
,SetCellParameters
- create_dialog()[source]
Create the dialog. A set of widgets will be chosen by default based on what is specified in the Set Cell_parameters module.
- Parameters:
None –
- Return type:
None
See also
- edit()[source]
Present a dialog for editing the Set Cell input
- Parameters:
None –
- Return type:
None
See also
- handle_dialog(result)[source]
Handle the closing of the edit dialog
What to do depends on the button used to close the dialog. If the user closes it by clicking the ‘x’ of the dialog window, None is returned, which we take as equivalent to cancel.
- Parameters:
result (None or str) – The value of this variable depends on what the button the user clicked.
- Return type:
None
- handle_help()[source]
Shows the help to the user when click on help button.
- Parameters:
None –
- Return type:
None
- reset_dialog(widget=None)[source]
Layout the widgets in the dialog.
The widgets are chosen by default from the information in Set Cell_parameter.
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
Module contents
set_cell_step A plug-in for setting the periodic (unit) cell in a SEAMM flowchart