next up previous index
Next: Attribute Box Up: Datasets Previous: Computing Variables   Index


Attribute Names

Attributes for a dataset can be specified in following ways:

Un-qualified name
(e.g. population) It is a character string without any dots or parentheses. It may contain numbers. Un-qualified names within a dataset must be unique. This way of specifying attributes may be used only for accessing already existing attributes within a dataset, e.g. in the method get_attribute().

Dataset-qualified name
(e.g. gridcell.population) Specifies a primary attribute of a specific dataset. It consists of a dataset name (e.g. gridcell) and an un-qualified attribute name (e.g. population). The dataset name allows you to disambiguate attributes of the same name in different datasets, when using outside of a dataset, e.g. in a model specification or in variable dependencies.

Fully-qualified name
(e.g. urbansim.gridcell.population) Specifies an Opus variable. It is the full name of the module or class in which the variable is defined. See Section 7.4.1 below, for more information.

Expression
(e.g. ln(urbansim.gridcell.population+1)) Expressions are composed from variable names, constants, functions, and operators -- see Sections 6.3.5 and 7.4.4.

Each specification can be give an alias using the syntax alias = expr. In that case, the alias name is used as un-qualified name for this attribute and thus, values of this attribute can be accessed by get_attribute(alias).

Opus contains a class VariableName that is initialized by passing a name in one of the forms above. Instances of this class can be also used when accessing attributes or invoking variable computation.


next up previous index
Next: Attribute Box Up: Datasets Previous: Computing Variables   Index
info (at) urbansim.org