Package glue :: Package ligolw :: Module lsctables :: Class TimeSlideTable
[hide private]
[frames] | no frames]

Class TimeSlideTable

source code

     object --+                
              |                
 ligolw.Element --+            
                  |            
ligolw.EmptyElement --+        
                      |        
           ligolw.Table --+    
                          |    
             object --+   |    
                      |   |    
                   list --+    
                          |    
                table.Table --+
                              |
                             TimeSlideTable

Nested Classes [hide private]
  RowType
Helpful parent class for row objects.

Inherited from table.Table: TableName

Instance Methods [hide private]
 
append_offsetvector(self, offsetvect, process)
Append rows describing an instrument --> offset mapping to this table.
source code
 
as_dict(self)
Return a ditionary mapping time slide IDs to offset dictionaries.
source code
 
get_time_slide_id(self, offsetdict, create_new=None, superset_ok=False, nonunique_ok=False)
Return the time_slide_id corresponding to the offset vector described by offsetdict, a dictionary of instrument/offset pairs.
source code

Inherited from table.Table: __init__, appendColumn, appendRow, applyKeyMapping, copy, endElement, getColumnByName, removeChild, sync_next_id, unlink, updateKeyMapping

Inherited from ligolw.EmptyElement: appendData

Inherited from ligolw.Element: appendChild, end_tag, getAttribute, getChildrenByAttributes, getElements, getElementsByTagName, hasAttribute, insertBefore, removeAttribute, replaceChild, setAttribute, start_tag, write

Inherited from list: __add__, __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setitem__, __setslice__, __sizeof__, append, count, extend, index, insert, pop, remove, reverse, sort

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from table.Table: CheckElement, CheckProperties, getTablesByName, get_next_id, get_table, reset_next_id, set_next_id

Inherited from ligolw.Element: validattributes

Class Variables [hide private]
  constraints = 'PRIMARY KEY (time_slide_id, instrument)'
hash(x)
  interncolumns = ('process_id', 'time_slide_id', 'instrument')
hash(x)
  next_id = <glue.ligolw.ilwd.time_slide_time_slide_id_class obj...
hash(x)
  tableName = 'time_slide'
  validcolumns = {'instrument': 'lstring', 'offset': 'real_8', '...
hash(x)

Inherited from table.Table: how_to_index, loadcolumns

Inherited from ligolw.Table: tagName, validchildren

Inherited from list: __hash__

Properties [hide private]

Inherited from table.Table: Name

Inherited from ligolw.Table: Type

Inherited from object: __class__

Method Details [hide private]

append_offsetvector(self, offsetvect, process)

source code 

Append rows describing an instrument --> offset mapping to this table. offsetvect is a dictionary mapping instrument to offset. process should be the row in the process table on which the new time_slide table rows will be blamed (or any object with a process_id attribute). The return value is the time_slide_id assigned to the new rows.

get_time_slide_id(self, offsetdict, create_new=None, superset_ok=False, nonunique_ok=False)

source code 

Return the time_slide_id corresponding to the offset vector described by offsetdict, a dictionary of instrument/offset pairs.

If the optional create_new argument is None (the default), then the table must contain a matching offset vector. The return value is the ID of that vector. If the table does not contain a matching offset vector then KeyError is raised.

If the optional create_new argument is set to a Process object (or any other object with a process_id attribute), then if the table does not contain a matching offset vector a new one will be added to the table and marked as having been created by the given process. The return value is the ID of the (possibly newly created) matching offset vector.

If the optional superset_ok argument is False (the default) then an offset vector in the table is considered to "match" the requested offset vector only if they contain the exact same set of instruments. If the superset_ok argument is True, then an offset vector in the table is considered to match the requested offset vector as long as it provides the same offsets for the same instruments as the requested vector, even if it provides offsets for other instruments as well.

More than one offset vector in the table might match the requested vector. If the optional nonunique_ok argument is False (the default), then KeyError will be raised if more than one offset vector in the table is found to match the requested vector. If the optional nonunique_ok is True then the return value is the ID of one of the matching offset vectors selected at random.


Class Variable Details [hide private]

next_id

hash(x)

Value:
<glue.ligolw.ilwd.time_slide_time_slide_id_class object at 0x7f3904171\
830>

validcolumns

hash(x)

Value:
{'instrument': 'lstring',
 'offset': 'real_8',
 'process_id': 'ilwd:char',
 'time_slide_id': 'ilwd:char'}