Sunday, April 19, 2009

Data get/set C and Python routines

One of the chief design features in TinkerCell is the ability to store tables associated with items or the model. For example, a typical reaction would have a Numerical Data Table called "Stoichiometry" and a Text Data Table called "Rates". Most items have a Numerical Data Table called "Numerical Attributes", i.e. parameters. 

Now, there are certain plug-ins, e.g. the flux balance analysis plug-in, that store data in the model, not pertaining to any particular item. These data are stored in the scene->symbolsTable.modelItem item. 

Plug-ins may provide easier C and Python functions to access these tables, e.g. functions like stoichiometry(), setRates(), getRates(), etc.

But, the Core library provides generic Python and C functions to access any of these data:

use getNumericalDataNames(item) and getTextDataNames(item) to get the list of all table names for that item. Use a null argument to get the tables for the model item.

similarly, there is setNumericalData(item,tablename,rowname,colname,value), getNumericalDataMatrix(item,tablename), and a few other functions.

No comments: