csv_storage and tab_storage provide file-based storage.
They are based upon Python's csv module, and thus will appropriately
format data as necessary.
The constructor of this class expects an entry storage_location in its
arguments. It should be a base directory on a hard drive where
the data will be stored to and loaded from.
For these storage classes, all implemented methods of the storage interface which
accept a table_name parameter interpret it as a file name without
extension (relative to the base directory) in which the data is stored (or where
it should be stored). The extension is added automatically. The data is stored
with one attribute per column. The first row contains the attribute names and
optional type information for each column. The type information, if provided, is
appended to the column name and separated by a colon, as in id:int32 which
specifies to use the numpy int32 type for storing the id values.
The type may be any of the numpy types in
Table 24.1.
|
If type information is not included, Opus will use float64 for numeric data
and string for string data.
For instance, the csv_storage for a dataset with three attributes
a, b, and c containing two rows of data could look like:
a:int8,b:float32,c:string40 1,3.14,hello 2,2.18,there