Skip to main content
Version: Next

LookUpTableBase

class compolyx.LookUpTableBase(obj, parent=None)

Lookup table class.

Associates scalar or vector values to points.

Example:

>>> table = db.models['class40.1'].create_lookup_table1d(name='LookUpTable1D.1')
>>> table.columns['Location'].values = [0,1,2,3]
>>> db.models['class40.1'].lookup_tables['LookUpTable1D.2'].create_column( name='Radius', type='scalar' )
>>> r = db.models['class40.1'].lookup_tables['LookUpTable1D.2'].columns['Radius']
>>> r.values = [0,0.3,0.6,1]

Attributes

NameDescription
LookUpTableBase.activeLookUpTable active
LookUpTableBase.column_factory
LookUpTableBase.column_typesA list of column types ('scalar', or 'direction')
LookUpTableBase.columnsDictionary with all columns
LookUpTableBase.dimensions
LookUpTableBase.emptyTrue if table is empty
LookUpTableBase.enabledWhether this object is currently enabled or not.
LookUpTableBase.idID of object
LookUpTableBase.is_dict_itemSpecifies whether the object is an item of a dict
LookUpTableBase.is_list_itemSpecifies whether the object is an item of a list
LookUpTableBase.link_pathRoot path of the current node in the tree for links to this object
LookUpTableBase.location_column_name
LookUpTableBase.nameName of object
LookUpTableBase.num_colsNumber of rows
LookUpTableBase.num_rowsNumber of columns
LookUpTableBase.parentParent object in tree
LookUpTableBase.root_pathRoot path of the current node in the tree
LookUpTableBase.statusStatus of the object
LookUpTableBase.status_changedBoolean flag which is set to true in C++ when up-to-date status of object changes
LookUpTableBase.tabular_dataa tuple containing a list of column labels and a 2d array with floats for all cells
LookUpTableBase.uidUID of object
LookUpTableBase.vector_column_suffix
LookUpTableBase.vertexThrows an error if the object has been removed from the graph

Methods

NameDescription
LookUpTableBase.clear()Clear table data (rows and columns)
LookUpTableBase.clear_rows()Clear table rows (keep columns)
LookUpTableBase.create_column(name[, type, ...])Create a new column
LookUpTableBase.find_parent(type)Steps up the tree and returns the first parent with given type
LookUpTableBase.load_from_csv_file(path)Load the table from .csv file in path
LookUpTableBase.obj_exists()Checks if __obj still references the C++ object (i.e. has not been reset to None by self._delete) and exists in the graph
LookUpTableBase.save_to_csv_file(path)Save LookUpTable to CSV file
LookUpTableBase.serialize_name_and_id()Helper function to serialize name and ID
LookUpTableBase.update()
LookUpTableBase.visit(visitor)Walk through the tree and let the visitor perform action on every descendant node