seamm package#
Submodules#
seamm.builtins module#
Helper class needed for the stevedore integration. Needs to provide a description() method that returns a dict containing a description of this node, and a factory() method for creating the graphical and non-graphical nodes.
- class seamm.builtins.JoinStep(flowchart=None, gui=None)[source]#
Bases:
object
- my_description = {'description': 'An interface for a node to join the control flow', 'group': 'Control', 'name': 'Join'}#
seamm.dashboard_handler module#
The interface for submitting SEAMM jobs.
A job in SEAMM is composed of a flowchart and any other files that the flowchart requires. This module provides the JobHandler class, which provides a use interface and the machinery to gather the necessary files and submit the job to a dashboard.
- class seamm.dashboard_handler.DashboardHandler(user_agent=None)[source]#
Bases:
object
- property credentials#
The data Dashboard from ~/.seamm.d/seammrc.
- property current_dashboard#
The currently selected dashboard
- property dashboards#
The list of dashboards.
- get_credentials(dashboard, ask=None)[source]#
The user for the dashboard.
- Parameters:
dashboard (str) – The name of the dashboard to use.
- Returns:
str, str – The user name and password
ask (function) – A function or method to call to get the user name and passwd.
seamm.data module#
A module for holding data
seamm.flowchart module#
A flowchart, which is a set of nodes. There must be a single ‘start’ node, with other nodes connected via their ports to describe the flowchart. There may be isolated nodes or groups of connected nodes; however, the flow starts at the ‘start’ node and follows the connections, so isolated nodes and fragments will not be executed.
- class seamm.flowchart.Flowchart(parent=None, data=None, namespace='org.molssi.seamm', name='', description='', directory=None, output='files', parser_name='SEAMM')[source]#
Bases:
object
- property data_path#
A path to local and user data, such as forcefields.
- digest(strict=False)[source]#
Generate a unique hash key for this flowchart.
- Parameters:
strict (bool) – Whether to include version information. Default: False
- Return type:
string
- property executor#
The executor for tasks.
- graphics = 'Tk'#
The default graphics to use for display, if needed. Default: ‘Tk’
- Type:
str
- property in_jobserver#
Whether running in a JobServer.
- property is_development#
Check if any of nodes are development versions.
- last_node(node='1')[source]#
Find the last node walking down the main execution path from the given node, which defaults to the start node
- property output#
Where to print output: files: to files in subdirectories stdout: to standard output (for intereactive use) both: to both files and standard output
- property parser#
The SEAMM parser associated with this flowchart.
- property root_directory#
The root directory for files, etc for this flowchart
- tag_exists(tag)[source]#
Check if the node with a given tag exists. A tag is a string like ‘node=<uuid>’, where <uuid> is the unique integer id for the node.
seamm.graph module#
- class seamm.graph.Edge(graph, node1, node2, edge_type='execution', edge_subtype='next', **kwargs)[source]#
Bases:
MutableMapping
- property edge_subtype#
- property edge_type#
- property node1#
- property node2#
seamm.join_node module#
A node to join together parallel flows in a flowchart
- class seamm.join_node.Join(flowchart=None, extension='Join')[source]#
Bases:
Node
- description_text(P=None)[source]#
Return a short description of this step.
- Return a nicely formatted string describing what this step will
do.
- Keyword Arguments:
P – a dictionary of parameter values, which may be variables or final values. If None, then the parameters values will be used as is.
- property git_revision#
The git version of this module.
- property version#
The semantic version of this module.
seamm.node module#
The base class for nodes (steps) in flowcharts.
- class seamm.node.Node(flowchart=None, title='', extension=None, module=None, logger=<Logger seamm.node (WARNING)>, uid=None)[source]#
Bases:
Hashable
The base class for nodes (steps) in flowcharts.
- Parameters:
flowchart (seamm.Flowchart) – The Flowchart object that contained this node.
title (str, optional) – The title of this step for use in output.
extension (str, optional) – Data used in serializing to the flowchart.
module (str, optional) – The module for this step.
logger (logging.Logger) – The logger to use for (debug) output. Defaults to the gloabl logger in the module.
uid (str, optional) – The unigue ID for the step, used when reading a flowchart. If not given it is generated using uuid.uuid4().
calculation
description
directory
extension
flowchart – The flowchart that this step is part of.
global_options
header
indent
job_path
logger – The logger for debug, etc. output.
metadata
method
model
options
parent (seamm.Node) – The node that is the parent, usually because this node is in a subflowchart of the parent.
parameters (seamm.Parameters) – The control parameters for this step.
references
step_type
tables
title
x (int) – The x-coordinate of the step in the GUI
y (int) – The y-coordinate of the step in the GUI
w (int) – The width of the step in the GUI
h (int) – The height of the step in the GUI
uuid
visited
Notes
Handling results#
The Node class takes most or all of the effort out of handling the results of calculations in steps. The developer needs to specify the information about possible results in metadata[“results”]. The keys are the steps internal names of the results, which match those in the data passed to store_results(). The fields of the dict for each key give human readable names, units, dimensions, etc.
The results can be filtered by the calculation attribute, and if further filtering is needed, the method attribute. While these two attirbutes have suggestive names, they are simply tags that should match those in the calculation filed of the the results metadata.
The model attribute is used to form the property name for the database. Often results depend on the model chemistry or something similar. The property names consist of up to three parts: the property, such as dipole moment; how the property was obtained, which is either experiment or the name of the code fo calculated results; and the model used, which is usually the model chemistry for calculated results.
- property all_options#
The complete set of all options.
- property calculation#
The type of calculation for filtering available results.
- close_printing(printer)[source]#
Close the handlers for printing, so that buffers are flushed, files closed, etc.
- connections()[source]#
Return a list of all the incoming and outgoing edges for this node, giving the anchor points and other node
- create_figure(title='', template='line.graph_template', module_path=None)[source]#
Create a new figure.
- Parameters:
title (str, optional) – The title of the figure
template (str, optional) – The Jinja template for the desired graph. Defaults to ‘line.graph_template’
- Return type:
seamm_util.Figure
- create_parser(name=None)[source]#
Create the parser for this node.
All nodes have at least –log-level, which is setup here,
- Parameters:
name (str) – The name of the parser. Defaults to a name derived from the module.
- Returns:
The next node in the flowchart.
- Return type:
seamm.Node()
- property data_files#
tuples of short name and path for any data files needed
- property data_path#
A path to local and user data, such as forcefields.
- default_edge_subtype()[source]#
Return the default subtype of the edge. Usually this is ‘next’ but for nodes with two or more edges leaving them, such as a loop, this method will return an appropriate default for the current edge. For example, by default the first edge emanating from a loop-node is the ‘loop’ edge; the second, the ‘exit’ edge.
A return value of ‘too many’ indicates that the node exceeds the number of allowed exit edges.
- property description#
A textual description of this node
- description_text(P=None)[source]#
Return a short description of this step.
Return a nicely formatted string describing what this step will do.
- Parameters:
P – a dictionary of parameter values, which may be variables or final values. If None, then the parameters values will be used as is.
- digest(strict=False)[source]#
Generate a unique hash key for this node.
- Parameters:
strict (bool) – Whether to include version information. Default: False
- Return type:
string
- property directory#
The directory for output and files for this step.
- existing_tables()[source]#
Tables from previous steps in the flowchart.
- Returns:
Sorted list of existing tables.
- Return type:
[str]
- file_path(filename)[source]#
Remove any prefix from a filename and return the path.
- Parameters:
filename (str) – The filename with optional prefix such as ‘job:’
- Returns:
The normalized, full path.
- Return type:
pathlib.Path
- find_data_file(filename)[source]#
Using the data_path, find a file.
- Parameters:
filename (str or pathlib.Path) – Name of the file to find – a relative path
- Returns:
path (pathlib.Path) – The path to the file
Exceptions
———-
FileNotFoundError if the file does not exist.
- get_input()[source]#
Return the input from this subnode, usually used for building up the input for the executable.
- get_system_configuration(P=None, same_as='current', first=True, **kwargs)[source]#
Get the current system and configuration.
Optionally use the standard structure handling to create new configuration or new system and configuration based on user input.
Note that if the system or configuration do not exist, they are automatically created as needed. This allows flowcharts to be started with and empty system database and “do the right” thing if a plug-in wants to use the curent configuration.
- Parameters:
P (dict(str, any) = None) – The dictionary of options and values. If none, the default system and configuration are returned as-is.
same_as (_Configuration = "current"") – Share atoms, bonds, or cell with this configuration, depending on other flags. Defaults to “current”, which results in using the current configuration. If None, an empty configuration is created/used
first (bool = True) – First configuration of several, which can have different handling than the subsequent ones.
- Returns:
The system and configuration.
- Return type:
(System, Configuration)
- get_value(variable_or_value)[source]#
Return the value of the workspace variable is <variable_or_value> is the name of a variable. Otherwise, simply return the value of <variable_or_value>.
This provides a convenient way to handle both values and variables in widgets. A reference to a variable is $<name> or ${name}, and is replaced by the contents of the variable. If the text is not a reference to a variable then the value passed in is returned unchanged.
- glob_data_files(pattern)[source]#
Using the data_path, glob for files.
- Parameters:
filename (str or pathlib.Path) – Name of the file to find – a relative path
- Returns:
paths ([pathlib.Path]) – A list of paths to the files
Exceptions
———-
FileNotFoundError if the file does not exist.
- property global_options#
Dictionary of global options
- property header#
A printable header for this section of output
- property in_jobserver#
Whether running in a jobserver
- property indent#
The amount to indent the output of this step in job.out.
- static is_expr(value)[source]#
Return whether the value is an expression or constant.
- Parameters:
value (str) – The value to test
- Returns:
True for an expression, False otherwise.
- Return type:
bool
- property job_path#
Return the path to the job’s top-level directory
- list_data_files()[source]#
Returns a list of auxilliary data files needed, like forcefields.
- Returns:
Tuples with the local path or URI for the file, and its full pathlib.Path
- Return type:
(shortname, pathlib.Path)
- property metadata#
Metadata describing aspects of the calculation.
The metadata is a dictionary of various types of metdata, often themselves dictionaries. Common types of metadata are:
- Parameters:
keywords – The keywords for programs with keyword-based input.
results – The results that this step can produce.
- property method#
The method of a calculation, used for filtering metadata.
A calculation, such as energy or optimization, might return different results depending on the type of calculation or how it is carried out. The method can be used in the metadata to further filter the calculation results.
- property model#
The model (chemistry) used to obtain results.
- Properties in the database use a trinomial naming scheme:
property`#`code`#`model
This is the last part of the name, or None if it is not relevant. It is often the model chemistry, such as mp2/6-31g or PM7.
- property options#
Dictionary of options for this step
- property references#
The reference handler for citations.
- run(printer=None)[source]#
Do whatever we need to do! The base class does nothing except return the next node.
- set_variable(variable, value)[source]#
Set the value of a variable in the workspace. The name of the variable maybe a plain string, or be $<name> or ${<name>}
- property step_type#
The step type, e.g. ‘lammps-step’, used for e.g. options
- store_results(configuration=None, data={}, create_tables=True)[source]#
Store results in the database, as variables,and in tables.
- Parameters:
configuration (molsystem._Configuration) – The configuration for storing properties in the database.
data (dict(str, dict(str, any))) – The data resulting from running the step.
create_tables (bool, optional) – Whether to create tables that do not yet exist, default is True.
- property tables#
Any tables this step creates.
A list of tables this step creates. If it is not easy to decide whether the tables are created or just used here, add them to the list. This data is used by subsequent steps to present possible tables in the GUI.
- property tag#
The string representation of the uuid of the node
- property title#
The title to display
- property uuid#
The uuid of the node to give it a unique id.
- property visited#
Whether this node has been visited in a traversal
seamm.parameters module#
Control parameters for a step in a MolSSI flowchart
- class seamm.parameters.Parameter(*args, **kwargs)[source]#
Bases:
MutableMapping
A single parameter, with defaults, units, description, etc. This is object is a dict-like mutable mapping with properties to make it appear to be a simple object with attributes.
- property default#
The current default of the parameter. May be a value, a Python expression containing variables prefix with $, standard operators or parenthesise, or a pint units quantity.
- property default_units#
The default units, as a string. These need to be compatible with pint
- property description#
Short description of this parameter, preferable just a few words
- property enumeration#
The possible values for an enumerated type.
- property format_string#
The format string for the value
- get(context=None, formatted=False, units=True)[source]#
Return the value evaluated in the given context
- property has_units#
Does this parameter have units associated?
- property help_text#
A longer description of this parameter that is suitable for e.g. help text.
- property is_expr#
Is the current value a variable reference or expression?
- property kind#
integer, float, string, enum or special. This can be used to convert the value to the correct type in e.g. get_value.
- Type:
The type of the parameter
- property units#
The units, as a string. These need to be compatible with pint
- update(data)[source]#
Update values from a dict
This assumes that the static data such as ‘kind’ and ‘default’ has been created already.
- property value#
The current value of the parameter. May be a value, a Python expression containing variables prefix with $, standard operators or parentheses.
- class seamm.parameters.Parameters(defaults={}, data=None)[source]#
Bases:
MutableMapping
A dict-like container for parameters
- current_values_to_dict(context=None, formatted=False, units=True)[source]#
Return the current values of the parameters, resolving any expressions, etc. in the given context or the root context is none is given.
- to_dict()[source]#
Return a new dictionary with the pertinent data
The Parameter class only saves the value and units, as everything else comes form the constructor below
seamm.plugin_manager module#
seamm.seammrc module#
A singleton to ensure the ~.seammrc file is always up-to-date.
seamm.split_node module#
A node to split the flow into parallel segements in a flowchart
- class seamm.split_node.Split(flowchart=None, extension=None)[source]#
Bases:
Node
- description_text(P=None)[source]#
Return a short description of this step.
- Return a nicely formatted string describing what this step will
do.
- Keyword Arguments:
P – a dictionary of parameter values, which may be variables or final values. If None, then the parameters values will be used as is.
- property git_revision#
The git version of this module.
- property version#
The semantic version of this module.
seamm.standard_parameters module#
Standard sets of parameters widely used in SEAMM.
- param structure_handling_parameters:
Parameters for providing options for how to handle newly created structures. The options are:
Overwrite the current configuration in the current system.
Add a new configuration to the current system.
Create new system and a configuration in it to hold the structure.
In addition, options are provided for naming the system and configuration whether or not new ones are created, i.e. the system and configuration can be renamed if they are reused.
- type structure_handling_parameters:
dict(str, dict(str, str))
- seamm.standard_parameters.multiple_structure_handling_description(P, **kwargs)[source]#
Return a standard description for how the new structures will be handled.
- Parameters:
P (dict(str, any)) – The dictionary of parameter values, which must contain the standard structure handling parameters.
- Returns:
The text for printing.
- Return type:
str
- seamm.standard_parameters.set_names(system, configuration, P, _first=True, **kwargs)[source]#
Set the names of the system and configuration.
- Parameters:
system (_System) – The system being named
configuration (_Configuration) – The configuration being named
P (dict(str, any)) – The dictionary of parameter values, which must contain the standard structure handling parameters.
_first (bool) – Whether this is the first or a subseqnet structure.
kwargs ({str: str}) – keyword arguments providing values that may be substituted in the names.
- Returns:
The text for printing.
- Return type:
str
- seamm.standard_parameters.structure_handling_description(P, **kwargs)[source]#
Return a standard description for how the structure will be handled.
- Parameters:
P (dict(str, any)) – The dictionary of parameter values, which must contain the standard structure handling parameters.
- Returns:
The text for printing.
- Return type:
str
seamm.start_node module#
The start node in a flowchart
- class seamm.start_node.StartNode(flowchart=None)[source]#
Bases:
Node
- description_text(P=None)[source]#
Return a short description of this step.
Return a nicely formatted string describing what this step will do.
- Keyword Arguments:
P – a dictionary of parameter values, which may be variables or final values. If None, then the parameters values will be used as is.
- property git_revision#
The git version of this module.
- setup_printing(aprinter)[source]#
Establish the handlers for printing as controlled by options. The start step never writes to disk, so don’t create that handler.
- property version#
The semantic version of this module.
seamm.tk_edge module#
The Tk graphical representation of an edge in the graph, i.e. an arrow connecting nodes.
The information is stored in the graph object as attributes of the edge so that the graphical representation can be restored as needed.
- class seamm.tk_edge.TkEdge(graph, node1, node2, edge_type='execution', edge_subtype='next', canvas=None, anchor1='s', anchor2='n', coords=None, **kwargs)[source]#
Bases:
Edge
- property anchor1#
- property anchor2#
- property canvas#
- property coords#
- property has_label#
- property label_bg_id#
- property label_id#
- str_to_object = <WeakValueDictionary>#
seamm.tk_flowchart module#
The flowchart is a visual representation of a flowchart drawn on a Tk canvas. The nodes of the graph are shown as ovals, rectangles, etc. with the edges indicated by arrows from one node to another.
The outline of a node has the following Tk tags:
node=xxxxx type=outline
The title:
node=xxxxx type=title
When the mouse is over the node, the anchor points are activated. They have the following tags:
node=xxxxx type=anchor anchor=<point>
When the mouse is over one of the active anchor points, it is covered with a larger circle, with tags:
node=xxxxx type=active_anchor anchor=<point>
Edges are indicated by directional arrows between nodes. The arrows have the following tags:
edge=xxxxx type=arrow
When the mouse if over an arrow, it is shown to be active by placing two red squares on the base and head of the arrow:
type=arrow_base arrow=<item> edge=xxxxx
type=arrow_head arrow=<item> edge=xxxxx
Clicking on either of these allows dragging the head or tail to another anchor point on the same or another node (but not on the same node as the tail/head for head/tail!). If the arrow is dropped anywhere else it just snaps back to its original place.
- class seamm.tk_flowchart.TkFlowchart(master=None, flowchart=None, namespace='org.molssi.seamm.tk')[source]#
Bases:
object
- activate_node(node, point=None, exclude=())[source]#
Activate a node, i.e. display the anchor points, unless it is in the exclusion list. Also, if the anchor point is given, make it active.
- canvas_configure(event)[source]#
Redraw the background as the canvas changes size
Only after the process is idle!
- canvas_configure_doit()[source]#
Redraw the background as the canvas changes size
This keeps the background image as large as possible and centered in the flowchart canvas.
- click(event)[source]#
Handle a left-click on the canvas by finding out what the mouse is on/in/near and doing the appropriate thing, such as selecting to preparing to move the item.
- create_node(event)[source]#
Create a node using the type in menu. This is a bit tricky because we need to create both the node and its graphical partner, each of which needs to know the other.
- double_click(event)[source]#
Handle a double-click on the canvas by finding out what the mouse is on/in/near and doing the appropriate thing.
- drag_arrow(event)[source]#
Drag an arrow from the anchor on the node to the mouse Used when creating a new edge.
- drop_arrow(event)[source]#
The user has dropped a new arrow somewhere! If it is on another node, make the connection. If it is in empty space or on the original node, just cancel the operation.
- drop_arrow_base(event)[source]#
The user has dropped the arrow somewhere! If it is on another node, make the connection. If it is in empty space or on the original node, just cancel the operation.
- drop_arrow_head(event)[source]#
The user has dropped the arrow somewhere! If it is on another node, make the connection. If it is in empty space or on the original node, just cancel the operation.
- find_items(x, y, exclude=())[source]#
Return the ‘top’ node under the mouse coordinates x, y
It appears that the canvas find_closest does not work properly in Python. Even if you give it a tag to look below, it always returns the topmost item, so we cannot loop through items.
Instead we use find_overlapping, which does return a list. However, if the mouse is e.g. inside a rectangle bat far enough from the edges find_overlapping does not find it. In this case we use the current tag to find the object.
- property flowchart#
The flowchart, which holds the nodes
- get_tags(item)[source]#
Return the tags of “item” as a dict. Any added tags like “active” are added to the “extra” dict entry.
- last_node(tk_node='1')[source]#
Find the last node walking down the main execution path from the given node, which defaults to the start node
- property master#
The window that is our master
- mouse_motion(event, exclude=())[source]#
Track the mouse and highlight the node under the mouse
It appears that the canvas find_closest does not work properly in Python. Even if you give it a tag to look below, it always returns the topmost item, so we cannot loop through items.
Instead we use find_overlapping, which does return a list. However, if the mouse is e.g. inside a rectangle but far enough from the edges find_overlapping does not find it. In this case we use the current tag to find the object.
- right_click(event)[source]#
Handle a right-click on the canvas by finding out what the mouse is on/in/near and doing the appropriate thing, such as posting an action menu
seamm.tk_job_handler module#
The graphical interface for submitting SEAMM jobs.
A job in SEAMM is composed of a flowchart and any other files that the flowchart requires. This module provides the TkJobHandler class, which provides a use interface and the machinery to gather the necessary files and submit the job to a dashboard.
- class seamm.tk_job_handler.TkJobHandler(root=None)[source]#
Bases:
object
- ask_for_credentials(dashboard, user=None, password=None)[source]#
Prompt the user for the login for the dashboard
- Parameters:
dashboard (str) – The name of the dashboard.
user (str) – The username for that dashboard.
password (str) – The password for the user.
- Returns:
A tuple with the username and password.
- Return type:
(str, str)
- create_submit_dialog(title='', description='')[source]#
Create the dialog for submitting a job.
- Parameters:
flowchart (seamm.Flowchart) – The flowchart object
- property current_dashboard#
The current dashboard, from dashboard_handler
- property dashboard_handler#
The connection to the dashboards.
- display_dashboards()[source]#
Display a list of all the dashboards with their status.
Allow users to edit, remove and add dashboards.
- file_cb(table, row, name, data)[source]#
Method to handle parameters with files
- Parameters:
table (sw.ScrolledColumns) – The widget displaying the table of parameters.
row (int) – The row of the table.
name (str) – The name of the parameter.
data (dict(str, str)) – The definition of the parameter.
- fit_dialog(dialog)[source]#
Resize and fit the dialog to the current contents and the constraint of the window.
- get_all_status(show_progress=True, master=None)[source]#
Get the status of all the dashboards.
- Parameters:
show_progress (Boolean, optional) – Show a dialog with progress, default is True
seamm.tk_join_node module#
A node to join the flow in a flowchart
seamm.tk_node module#
The base class for Tk nodes (steps) in the GUI for flowcharts.
- class seamm.tk_node.TkNode(tk_flowchart=None, node=None, node_type='simple', canvas=None, x=None, y=None, w=None, h=None, my_logger=<Logger seamm.tk_node (WARNING)>)[source]#
Bases:
MutableMapping
The base class for Tk nodes (steps) in the GUI for flowcharts.
- Parameters:
tk_flowchart (seamm.TkFlowchart) – The graphical flowchart this step is in.
node (seamm.Node) – The non-graphical node this corresponds to.
node_type (enum("simple", "loop")) – The type of node on the graph. “simple” has an in and out arrow. “loop” has three arrows.
canvas (tkinter.Canvas) – The Canvas widget that this node is drawn on.
x (int) – The x-coordinate the drawing for the node on the canvas.
y (int) – The y-coordinate of the drawing for the node on the canvas.
w (int) – The width of the drawing for the node on the canvas.
h (int) – The height of the drawing for the node on the canvas.
my_logger (logging.Logger, optional) – The logger to use. Defaults to the global one defined in the module.
Fields
------
border
canvas
dialog (tkinter.Toplevel) – The dialog for editing the parameters.
flowchart
h
logger (logging.Logger) – The logger for debug & warning output.
node – The non-graphical node corresponding to this graphical one.
node_type – The type of the node from the point of connectivity.
popup_menu (tkinter.Menu) – The popup menu used for right-clicks.
selected
tag
title
title_label (tkinter.ttk.Label) – The label for the title of the step on the display.
tk_flowchart – The Tk Flowchart that contains this step.
tk_subflowchart (seamm.TkFlowchart) – The sub flowchart is if this step contains one.
w
x
y
uuid
Notes
The state is held in the corresponding non-graphical node, self.node. Many of the properties are thin-wrappers to the same property of the non-graphical node.
Results are stored in the following columns of the results table:
0 Result name 1 <separator> 2 Save in database 3 <separator> 4 Save as JSON 5 <separator> 6 checkbox 7 Save in variable named 8 <separator> 9 Save in table 10 as Column name 11 Units
- activate_anchor_point(point, halo)[source]#
Put a marker on the anchor point to indicate it is under the cursor.
- anchor_point(anchor='all')[source]#
Where the anchor points are located. If “all” is given a dictionary of all points is returned
- anchor_points = {'e': (0.5, 0.0), 'ene': (0.5, -0.25), 'ese': (0.5, 0.25), 'n': (0.0, -0.5), 'ne': (0.5, -0.5), 'nne': (0.25, -0.5), 'nnw': (-0.25, -0.5), 'nw': (-0.5, -0.5), 's': (0.0, 0.5), 'se': (0.5, 0.5), 'sse': (0.25, 0.5), 'ssw': (-0.25, 0.5), 'sw': (-0.5, 0.5), 'w': (-0.5, 0.0), 'wnw': (-0.5, -0.25), 'wsw': (-0.5, 0.25)}#
- property border#
The border of the picture in the flowchart
- property canvas#
The canvas for drawing the node
- check_anchor_points(x, y, halo)[source]#
If the position x, y is within halo or one of the anchor points activate the point and return the name of the anchor point
- connections()[source]#
Return a list of all the incoming and outgoing edges for this node, giving the anchor points and other node
- create_dialog(title='Edit step', widget='frame', results_tab=False)[source]#
Create the base dialog for editing the parameters for a step.
- Parameters:
title (str) – The title of the dialog.
widget (enum) – Whether to use a simple dialog (“frame”) or use a notebook (“notebook”).
results_tab (bool) – OBSOLETE Not longer used.
- default_edge_subtype()[source]#
Return the default subtype of the edge. Usually this is ‘’ but for nodes with two or more edges leaving them, such as a loop, this method will return an appropriate default for the current edge. For example, by default the first edge emanating from a loop-node is the ‘loop’ edge; the second, the ‘exit’ edge.
A return value of ‘too many’ indicates that the node exceeds the number of allowed exit edges.
- double_click(event)[source]#
Handle a double-click on the node.
This method raises the dialog to edit the parameters. Subclasses should override this as appropriate!
- end_move(deltax, deltay)[source]#
End moving the node on the canvas.
- Parameters:
deltax (int) – The number of pixels to move in the x-direction.
deltay (int) – The number of pixels to move in the y-direction.
- fit_dialog()[source]#
Resize and fit the dialog to the current contents and the constraint of the window.
- property flowchart#
The flowchart object
- from_flowchart(tk_flowchart=None, flowchart=None)[source]#
Recreate the graphics from the non-graphical flowchart. Only used in nodes that contain flowchart
- property h#
The height of the graphical node
- handle_dialog(result)[source]#
Handle closing the dialog.
- Parameters:
result (str) – The button that was pressed to close the dialog, or None if the x dialog close button was pressed.
- initialize_results()[source]#
Initialize the results if empty.
When the GUI for the step is first created the results parameter is empty. However the default is to save properties to the database, so they need to be put into the results parameter.
- static is_expr(value)[source]#
Return whether the value is an expression or constant.
- Parameters:
value (str) – The value to test
- Returns:
True for an expression, False otherwise.
- Return type:
bool
- is_inside(x, y, halo=0)[source]#
Return a boolean indicating whether the point x, y is inside this node, using halo as a size around the point
- property metadata#
Return the metadata for the node.
- move(deltax, deltay)[source]#
Move the node on the canvas.
- Parameters:
deltax (int) – The number of pixels to move in the x-direction.
deltay (int) – The number of pixels to move in the y-direction.
- next_anchor()[source]#
Return where the next node should be positioned. The default is <gap> below the ‘s’ anchor point.
- reset_dialog(widget=None)[source]#
Reset the layout of the dialog as needed for the parameters.
In this base class this does nothing. Override as needed in the subclasses derived from this class.
- right_click(event)[source]#
Respond to a right-click by posting the popup menu.
This method provides a popup menu with a delete command.
Subclasses should override or extend this as appropriate! The menu created in this base method is accessible in subclasses which should make it easy to override.
- property selected#
Whether I am selected or not
- property tag#
The string representation of the uuid of the node
- property title#
The title to display
- update_flowchart(tk_flowchart=None, flowchart=None)[source]#
Update the nongraphical flowchart. Only used in nodes that contain flowcharts
- property uuid#
The uuid of the node
- property w#
The width of the graphical node
- property x#
The x-position of the center of the graphical node
- property y#
The y-position of the center of the graphical node
seamm.tk_open module#
The GUI for opening flowcharts.
- class seamm.tk_open.TkOpen(toplevel)[source]#
Bases:
MutableMapping
- property dashboard_handler#
The connection to the dashboards.
- fill_tree(job_list)[source]#
Fill the tree with a job list
The job list looks is a list of Job objects that are dicts like:
{ 'description': 'test of api', 'finished': '2022-02-24 10:06', 'flowchart_id': '1', 'group': None, 'group_id': None, 'id': 18, 'last_update': '2022-02-24 10:05', 'owner': 'psaxe', 'owner_id': 2, 'parameters': { 'cmdline': ['job:data/Users_psaxe_SEAMM_data_TiO2--anatase.cif'] }, 'path': '/Users/psaxe/SEAMM_DEV/Jobs/projects/default/Job_000018', 'projects': [{'id': 1, 'name': 'default'}], 'started': '2022-02-24 10:06', 'status': 'finished', 'submitted': '2022-02-24 10:05', 'title': 'test of api' }
- Parameters:
job_list ([seamm_dashboard_client._Job]) – List of Job objects contain info about the jobs
- insert_node(parent, text, path, open=False)[source]#
Insert a new node in the tree, corresponding to a file or directory.
- Parameters:
parent (str) – The parent node in the tree, “” for toplevel.
text (str) – The text to display for the node.
path (pathlib.Path) – The absolute path of the file or directory.
seamm.tk_publish module#
The GUI for publishing – flowcharts for the moment.
seamm.tk_split_node module#
A node to split the flow in a flowchart
seamm.tk_start_node module#
The start node in a flowchart
- class seamm.tk_start_node.TkStartNode(tk_flowchart=None, node=None, canvas=None, x=150, y=50, w=200, h=50)[source]#
Bases:
TkNode
The Tk-based graphical representation of a Start node
- anchor_points = {'e': (0.5, 0.0), 's': (0, 0.5), 'w': (-0.5, 0.0)}#
- handle_dialog(result)[source]#
Handle closing the dialog.
- Parameters:
result (str) – The button that was pressed to close the dialog, or None if the x dialog close button was pressed.
seamm.variables module#
A dictionary-like object for holding variables accessible to the executing flowchart.
- class seamm.variables.Variables(**kwargs)[source]#
Bases:
MutableMapping
- delete(variable)[source]#
Return whether a variable exists. The variable may be specified as a simple string or start with a $ and optionally have braces around it, i.e.
<name> $<name>
or
${<name>}
- exists(variable)[source]#
Return whether a variable exists. The variable may be specified as a simple string or start with a $ and optionally have braces around it, i.e.
<name> $<name>
or
${<name>}
- filter_expression(string)[source]#
A variable or expression coming from the GUI uses ‘$’ to indicate a variable, optionally bracketing the variable with braces, i.e. ${name}.
This method filters out the variable markers, respecting quoted string, returning a string that can be eval’ed in the Python interpreter.
- get_variable(variable)[source]#
Get the value of the variable. The variable may be a simple string or start with a $ and optionally have braces around it, i.e.
<name> $<name>
or
${<name>}
- set_variable(variable, value)[source]#
Set the value of the variable. The variable may be a simple string or start with a $ and optionally have braces around it, i.e.
<name> $<name>
or
${<name>}
Module contents#
seamm Simulation Environment for Atomistic and Molecular Modeling.