Goulib.units module¶
-
class
Goulib.units.
Row
(row)[source]¶ Bases:
object
a Raw is internally a dict of {‘colname1’:value,’colname2’,value…}
-
class
Goulib.units.
Table
(name, cols, cells)[source]¶ Bases:
object
to create a table, use the following syntax
- t = Table (‘myTable’, [‘col1’, ‘col2’, ‘col3’],
- [ ‘distance’, V(20,’m’), V(30,’m’), V(40,’m’),
- (‘speed’,’m/s’),V(2,’m/min’), V(5,’m/s’), V(10,’inch/s’)
])
the row label can be a tuple of (‘label’,’unit’). in that case, all the values of the row will be converted to ‘unit’ (if possible) and the cells won’t diplay the units saving space in the future, the label could be replaced by a dictionary having more properties like {‘label’:<label>, ‘comment’:<comment>….}
internally, the rows are represented as {‘<the label>’:{‘col1’:<value>, ‘col2’:<value> ….},
‘<the next label>’-
appendCol
(colname, values)[source]¶ appends a column at the right of the table :parameter values: is a dict of {<row>:V(…),…}