next up previous index
Next: Loading Attributes Up: Datasets Previous: Datasets   Index

Initialization

The Dataset class is initialized by the following arguments:
resources
- on object of class Resources (dictionary). It can contain any of the remaining arguments, but if an argument of the constructor is not None, it has a priority over the entry in resources.
in_storage
- an object of class Storage for reading the data from (see Section 7.3).
id_name
- a list of character strings giving the names of the unique identifiers of the dataset. If it is an empty list, a ``hidden'' identifier will be created, i.e. an additional attribute of the dataset that enumerates the entries.
dataset_name
- a character string giving the name of the dataset.
out_storage
- an object of class Storage for writing the data into (see Section 7.3). This argument can be omitted in the constructor and instead directly passed to the write_dataset() method, which is the only method of the class that uses this argument.
in_table_name
- name of the table, directory or file that contains the data for this dataset (see Section 7.3 for the different meanings of this argument in the different storage classes). This name also is the name used for this dataset in the cache (see below).
out_table_name
- name of the table, directory or file that the dataset should be written into (see Section 7.3 for the different meanings of this argument in the different storage classes). This argument can be omitted in the constructor and instead directly passed to the write_dataset() method.

All arguments are merged with resources and kept in the class attribute resources.

The constructor determines all attributes available on the input storage (primary attributes), without loading them into memory. If id_name is an empty list, it loads at least one attribute from the storage in order to obtain the dataset size. The constructor also sets up a reference to the singleton AttributeCache which is used for caching data (see below).


next up previous index
Next: Loading Attributes Up: Datasets Previous: Datasets   Index
info (at) urbansim.org