next up previous index
Next: Creating a Variable Object Up: Opus Variables Previous: Variable Names   Index


Implementation

The behavior of each Opus variable is defined in a Python class that is a child of the generic class Variable. The name of the Python module and class containing the variable implementation must be the same as the un-qualified part of the Opus variable name, e.g. class population is implemented in file population.py for variable urbansim.gridcell.population. The module should be stored in a directory whose name is the dataset name for which the variable is computed, in the corresponding package. In the above example, population.py is stored in the gridcell directory in the top level of the urbansim package directory. This scheme allows Opus to find that variable. It also means there may be only one Opus variable per Python variable module.



Subsections
next up previous index
Next: Creating a Variable Object Up: Opus Variables Previous: Variable Names   Index
info (at) urbansim.org