supercell_step package#

Submodules#

supercell_step.supercell module#

Non-graphical part of the Supercell step in a SEAMM flowchart

class supercell_step.supercell.Supercell(flowchart=None, title='Supercell', extension=None, logger=<Logger supercell_step.supercell (WARNING)>)[source]#

Bases: Node

The non-graphical part of a Supercell step in a flowchart.

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 Supercell.

Type:

SupercellParameters

See also

TkSupercell, Supercell, SupercellParameters

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:

description – A description of the current step.

Return type:

str

property git_revision#

The git version of this module.

run()[source]#

Create the supercell.

The strategy used is to expand in the a direction, adding the atoms and bonds from the original system for each cell add, and keeping the new fractional coordinates. Then move to the b direction, getting the current atoms and bonds for the expanded a direction. And finally for the c direction. At the end, after setting the cell the coordinates are updated with the fractional coordinates that have been accumulated.

Returns:

next_node – The next node object in the flowchart.

Return type:

seamm.Node

property version#

The semantic version of this module.

supercell_step.supercell_parameters module#

Control parameters for the Supercell step in a SEAMM flowchart

class supercell_step.supercell_parameters.SupercellParameters(defaults={}, data=None)[source]#

Bases: Parameters

The control parameters for Supercell.

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[]#

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[]#

‘enum’ The default value of the parameter, used to reset it.

Type:

‘integer’ or ‘float’ or ‘string’ or ‘boolean’ or

parameters[]#

The default units, used for resetting the value.

Type:

str

parameters[]#

A tuple of enumerated values.

Type:

tuple

parameters[]#

A format string for ‘pretty’ output.

Type:

str

parameters[]#

A short string used as a prompt in the GUI.

Type:

str

parameters[]#

A longer string to display as help for the user.

Type:

tuple

See also

Supercell, TkSupercell, Supercell, SupercellParameters, SupercellStep

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 = {'na': {'default': 2, 'default_units': None, 'description': "Number of cells in 'a' direction:", 'enumeration': (), 'format_string': 'd', 'help_text': "The number of cells to create in the 'a' lattice direction.", 'kind': 'integer'}, 'nb': {'default': 2, 'default_units': None, 'description': "Number of cells in 'b' direction:", 'enumeration': (), 'format_string': 'd', 'help_text': "The number of cells to create in the 'b' lattice direction.", 'kind': 'integer'}, 'nc': {'default': 2, 'default_units': None, 'description': "Number of cells in 'c' direction:", 'enumeration': (), 'format_string': 'd', 'help_text': "The number of cells to create in the 'c' lattice direction.", 'kind': 'integer'}}#

supercell_step.supercell_step module#

class supercell_step.supercell_step.SupercellStep(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[]#

A description of the Supercell step. It must be clear to non-experts.

Type:

tuple

my_description[]#

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[]#

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:

Supercell

See also

Supercell

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:

TkSupercell

See also

TkSupercell

description()[source]#

Return a description of what this extension does

my_description = {'description': 'An interface for Supercell', 'group': 'Building', 'name': 'Supercell'}#

supercell_step.tk_supercell module#

The graphical part of a Supercell step

class supercell_step.tk_supercell.TkSupercell(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50)[source]#

Bases: TkNode

The graphical part of a Supercell step in a flowchart.

namespace#

The namespace of the current step.

Type:

str

node#

The corresponding node of the non-graphical flowchart

Type:

Node

dialog#

The Pmw dialog object

Type:

Dialog

sub_tk_flowchart#

A graphical Flowchart representing a subflowchart

Type:

TkFlowchart

self[widget]#

A dictionary of tk widgets built using the information contained in Supercell_parameters.py

Type:

dict

See also

Supercell, TkSupercell, SupercellParameters

create_dialog()[source]#

Create the dialog. A set of widgets will be chosen by default based on what is specified in the Supercell_parameters module.

edit()[source]#

Present a dialog for editing the Supercell input

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.

handle_help()[source]#

Shows the help to the user when click on help button.

reset_dialog(widget=None)[source]#

Layout the widgets in the dialog.

The widgets are chosen by default from the information in Supercell_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.

Parameters:

widget

right_click(event)[source]#

Handles the right click event on the node.

See also

TkSupercell.edit

Module contents#

supercell_step A step for building supercells of periodic systems.