crystal_builder_step package
Submodules
crystal_builder_step.crystal_builder module
Non-graphical part of the Crystal Builder step in a SEAMM flowchart
- class crystal_builder_step.crystal_builder.CrystalBuilder(flowchart=None, title='Crystal Builder', extension=None)[source]
Bases:
Node
The non-graphical part of a Crystal Builder 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 Crystal Builder.
- Type:
See also
TkCrystalBuilder
,CrystalBuilder
,CrystalBuilderParameters
- 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]
Run a Crystal Builder step.
- Returns:
next_node – The next node object in the flowchart.
- Return type:
seamm.Node
- property version
The semantic version of this module.
crystal_builder_step.crystal_builder_parameters module
Control parameters for the Crystal Builder step in a SEAMM flowchart
- class crystal_builder_step.crystal_builder_parameters.CrystalBuilderParameters(defaults={}, data=None)[source]
Bases:
Parameters
The control parameters for Crystal Builder.
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
CrystalBuilder
,TkCrystalBuilder
,CrystalBuilder
,CrystalBuilderParameters
,Crystal
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 = {'AFLOW prototype': {'default': '', 'default_units': None, 'description': 'AFLOW Prototype:', 'enumeration': (), 'format_string': '', 'help_text': 'The AFLOW prototype', 'kind': 'string'}, 'a': {'default': 10.0, '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.0, '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.0, 'default_units': 'Å', 'description': 'c:', 'enumeration': None, 'format_string': '.2f', 'help_text': 'The length of the third side of the cell.', 'kind': 'float'}, 'elements': {'default': ['Al'], 'default_units': None, 'description': 'Elements:', 'enumeration': (), 'format_string': '', 'help_text': 'The elements at the different sites.', 'kind': 'list'}, 'gamma': {'default': 90.0, 'default_units': 'degree', 'description': 'gamma:', 'enumeration': None, 'format_string': '.1f', 'help_text': 'The angle between b and c.', 'kind': 'float'}, 'n_sites': {'default': 'any', 'default_units': None, 'description': 'Number of occupied sites:', 'enumeration': ('any',), 'format_string': '', 'help_text': 'The number of occupied sites in the structure.', 'kind': 'int'}, 'prototype': {'default': '', 'default_units': None, 'description': 'Prototype:', 'enumeration': ('place', 'holders'), 'format_string': '', 'help_text': 'The prototype to use', 'kind': 'enumeration'}, 'prototype_group': {'default': 'common', 'default_units': None, 'description': 'Which prototypes:', 'enumeration': ('common', 'Strukturbericht', 'all'), 'format_string': '', 'help_text': 'The group of prototypes to display', 'kind': 'enumeration'}}
crystal_builder_step.crystal_builder_step module
- class crystal_builder_step.crystal_builder_step.CrystalBuilderStep(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 Crystal Builder 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
CrystalBuilder
- 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
TkCrystalBuilder
- my_description = {'description': 'An interface for the pyiron crystal builder', 'group': 'Building', 'name': 'Crystal Builder'}
crystal_builder_step.crystal_metadata module
Non-graphical part of the Crystal Builder step in a SEAMM flowchart
crystal_builder_step.parse module
- crystal_builder_step.parse.get_bibtex(prototype)[source]
Create the BibTex for the prototype
Example:
- @article{doi:10.1139/v68-576,
- author = {Knop, Osvald and Reid, K. I. G. and Sutarno and Nakagawa,
Yasuaki},
- title = {Chalkogenides of the transition elements. VI. X-Ray, neutron,
and magnetic investigation of the spinels Co3O4, NiCo2O4, Co3S4, and NiCo2S4},
journal = {Canadian Journal of Chemistry}, volume = {46}, number = {22}, pages = {3463-3476}, year = {1968},
}
crystal_builder_step.tk_crystal_builder module
The graphical part of a Crystal Builder step
- class crystal_builder_step.tk_crystal_builder.TkCrystalBuilder(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50)[source]
Bases:
TkNode
The graphical part of a Crystal Builder 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 Crystal Builder_parameters.py
- Type:
dict
See also
CrystalBuilder
,TkCrystalBuilder
,CrystalBuilderParameters
- create_dialog()[source]
Create the dialog. A set of widgets will be chosen by default based on what is specified in the Crystal Builder_parameters module.
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.
- reset_dialog(widget=None)[source]
Layout the widgets in the dialog.
The widgets are chosen by default from the information in Crystal Builder_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 –
See also
Module contents
crystal_builder_step A step for building crystals in SEAMM