Table of Contents

Class: Table sam/Table.py

Holds data extracted from a NETLOG file or produced by an analysis.

Purpose: Holds all the data produced by parsing a NETLOG file, or produced by performing analysis on another such object of this class.

Used By: Model

Uses: Numeric.array, CustomError

Attributes: None

SRS Refs: 3.2.1.5, 3.2.1.6, 3.2.1.8

Author: caedwa

Date: 16/7/02

Methods   
__init__
__isDone
addArray
combineTables
getArray
getLabels
getStream
isAggregate
numArrays
  __init__ 
__init__ (
        self,
        array=[],
        labels=[],
        stream=None,
        isaggregate=0,
        )

Purpose: Creates a new instance of the Table class. Optionally will add an array to the new instance.

Used by: Model

Uses: None

Input: array : Numeric.Array

labels : String[]

stream : Stream

isaggregate : 0 or 1

Output: New instance of the class Table

Preconditions: None

Postconditions: The created class will be a valid Table object, containing either 0 or 1 arrays.

SRS Refs: 3.2.1.5, 3.2.1.8

Author: caedwa

Date: 17/7/02

  __isDone 
__isDone ( self,  array_info_list )

Purpose: Returns 0 if the array_info_list is not yet done (that is, it still contains items with first element not "Done") and 1 if the array_info_list has been processed (that is, all first elements are "Done").

Used by: Table

Uses: None

Input: array_info_list : list of [Integer or string, Integer, Array] objects

Output: __isDone : Integer (0 or 1)

Preconditions: None

Postconditions: None

SRS Refs: 3.2.1.6

Author: mayadm

Date: 5/8/02

  addArray 
addArray (
        self,
        array,
        labels,
        stream,
        isaggregate=0,
        )

Purpose: Adds an array and details about it (the labels for its columns, which stream it corresponds to, and whether it is an aggregate stream) to the instance of the Table class.

Used by: Model

Uses: None

Input: array : Numeric.Array

labels : String[]

stream : Stream

isaggregate : 0 or 1

Output: addArray: id of the array within the table, as an integer.

Preconditions: labels.length == array.shape[1]

Postconditions: array is now contained within the Table object

SRS Refs: 3.2.1.5, 3.2.1.8

Author: caedwa

Date: 11/7/02

  combineTables 
combineTables ( self )

Purpose: Returns a new array which combines together all the arrays in Table. It does this by having the first column the same (eg, time), and the next columns represent the data values from each array in Table. When an array has no data value for that particular time, a 0 is used.

Used by: ScreenTable

Uses: None

Input: None

Output: combineTables : Array

Preconditions: None

Postconditions: None

SRS Refs: 3.2.1.6

Author: mayadm

Date: 4/8/02

  getArray 
getArray ( self,  id=0 )

Purpose: Returns the array of id id if given, or if not given, the first array. Used by: Model

Uses: None

Input: id : Integer

Output: getArray : Numeric.Array

Preconditions: There exists an array of ID id in the Table

Postconditions: None

SRS Refs: 3.2.1.6, 3.2.1.8

Author: caedwa

Date: 17/7/02

Exceptions   
CustomError, "Table.getArray: array index is out of bounds"
  getLabels 
getLabels ( self,  id=0 )

Purpose: Returns a list of strings which identify the columns within an array. Used by: Model

Uses: None

Input: id : Integer

Output: getLabels : String[]

Preconditions: There exists an array of ID id within the Table. Postconditions: None

SRS Refs: 3.2.1.6, 3.2.1.8

Author: caedwa

Date: 17/7/02

  getStream 
getStream ( self,  id=0 )

Purpose: Returns a Stream object which identifies the Stream from which the data in the Array id was collected. Used by: OutputPlugins

Uses: None

Input: id : Integer

Output: getStream : Stream

Preconditions: There exists an array of ID id within the Table.

Postconditions: None

SRS Refs: 3.2.1.5, 3.2.1.8

Author: caedwa

Date: 17/7/02

  isAggregate 
isAggregate ( self,  id=0 )

Purpose: Returns 1 if the array of ID id within the object is an aggregate array, 0 otherwise.

Used by: Model

Uses: None

Input: id : Integer

Output: 0 or 1

Preconditions: An array of ID id exists within the Table

Postconditions: None

SRS Refs: 3.2.1.5

Author: caedwa

Date: 17/7/02

  numArrays 
numArrays ( self )

Purpose: Returns the number of arrays stored within the Table. Used by: Model

Uses: None

Input: None

Output: numArrays : Integer

Preconditions: None

Postconditions: None

SRS Refs: 3.2.1.6, 3.2.1.8

Author: caedwa

Date: 17/7/02


Table of Contents

This document was automatically generated on Wed Oct 30 23:04:21 2002 by HappyDoc version 2.0