table_step package#

Submodules#

table_step.table module#

Non-graphical part of the Table step in SEAMM

class table_step.table.Table(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.

run()[source]#

Do what we need for the table, as dictated by the ‘method’

property version#

The semantic version of this module.

table_step.table_parameters module#

Control parameters for loops

class table_step.table_parameters.TableParameters(defaults={}, data=None)[source]#

Bases: Parameters

The control parameters for tables

parameters = {'column': {'default': 'current', 'default_units': '', 'description': 'Column:', 'enumeration': ('c', 'u', 'r', 'r', 'e', 'n', 't'), 'format_string': '', 'help_text': 'The column to access', 'kind': 'string'}, 'columns': {'default': [], 'default_units': '', 'description': 'columns', 'enumeration': (), 'format_string': '', 'help_text': 'The column definitions.', 'kind': 'list'}, 'file type': {'default': 'from extension', 'default_units': '', 'description': 'File type:', 'enumeration': ('from extension', '.csv', '.json', '.xlsx', '.txt'), 'format_string': '', 'help_text': 'The type of file to read/write.', 'kind': 'string'}, 'filename': {'default': '', 'default_units': '', 'description': 'File name:', 'enumeration': (), 'format_string': '', 'help_text': 'The file name for the table, which may include a path.', 'kind': 'string'}, 'frequency': {'default': 1, 'default_units': '', 'description': 'Frequency:', 'enumeration': (), 'format_string': '', 'help_text': 'Number of calls before saving the table.', 'kind': 'integer'}, 'index column': {'default': '--none--', 'default_units': '', 'description': 'Index column:', 'enumeration': ('-', '-', 'n', 'o', 'n', 'e', '-', '-'), 'format_string': '', 'help_text': 'The column to index the table. Values must be unique.', 'kind': 'string'}, 'method': {'default': 'Create', 'default_units': '', 'description': '', 'enumeration': ('Create', 'Read', 'Save', 'Save as', 'Print', 'Print the current row of', 'Append a row to', 'Go to the next row of', 'Add columns to', 'Set element of', 'Get element of'), 'format_string': 's', 'help_text': 'What to do with the tables', 'kind': 'enumeration'}, 'row': {'default': 'current', 'default_units': '', 'description': 'Row:', 'enumeration': ('c', 'u', 'r', 'r', 'e', 'n', 't'), 'format_string': '', 'help_text': 'The row to access', 'kind': 'string'}, 'table name': {'default': 'table1', 'default_units': '', 'description': ' table ', 'enumeration': (), 'format_string': '', 'help_text': 'The name of the table.', 'kind': 'string'}, 'value': {'default': '', 'default_units': '', 'description': 'Value:', 'enumeration': (), 'format_string': '', 'help_text': 'The value to put into the table.', 'kind': 'string'}, 'variable name': {'default': '', 'default_units': '', 'description': 'Variable name:', 'enumeration': (), 'format_string': '', 'help_text': 'The name of the variable for storing the value from the table.', 'kind': 'string'}}#

table_step.table_step module#

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.

class table_step.table_step.TableStep(flowchart=None, gui=None)[source]#

Bases: object

create_node(flowchart=None, **kwargs)[source]#

Return the new node object

create_tk_node(canvas=None, **kwargs)[source]#

Return the graphical Tk node object

description()[source]#

Return a description of what this extension does

my_description = {'description': 'An interface for Pandas tables', 'group': 'Data', 'name': 'Table'}#

The description needs three fields:

description:

A human-readable description of this step. It can be several lines long, and needs to be clear to non-expert users.

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

name:

The name of this step, to be displayed in the menus.

table_step.tk_table module#

The graphical part of a Table step

class table_step.tk_table.TkTable(tk_flowchart=None, node=None, canvas=None, x=120, y=20, w=200, h=50, my_logger=<Logger table_step.tk_table (WARNING)>)[source]#

Bases: TkNode

The node_class is the class of the ‘real’ node that this class is the Tk graphics partner for

add_column()[source]#

Add entries for another column in the displayed table

add_column_for_add_row()[source]#

Add entries for another column in the displayed table

create_dialog()[source]#

Create the dialog!

handle_dialog(result)[source]#

Do the right thing when the dialog is closed.

layout_columns(first=False)[source]#

Layout the table of columns for adding, editing, etc.

layout_columns_for_add_row(first=False)[source]#

Layout the table of columns for adding a row

node_class#

alias of Table

remove_column(row=None)[source]#

Remove a column from the list of columns

remove_column_for_add_row(row=None)[source]#

Remove a column from the list of columns

reset_dialog(widget=None)[source]#

Layout the dialog based on the current values

right_click(event)[source]#

Probably need to add our dialog…

save_column_data()[source]#

Get the data from the widgets when the table information is changed in the GUI.

Module contents#

table_step A step for data tables in a SEAMM flowchart