stream module

Author: Valmor F. de Almeida dealmeidav@ornl.gov; vfda

Stream container

VFdALib support classes

Sat Aug 15 17:24:02 EDT 2015

class stream.Stream(timeStamp, species=None, quantities=None, values=0.0)[source]

Bases: object

GetActors()[source]

Returns the actors present in the stream of data.

Returns

list(self.stream.columns)

Return type

list

GetQuantities()[source]

Returns all the quantities given by the stream.

Returns

self.quantities

Return type

list

GetQuantity(name)[source]

Returns the specified quantity called “name” from the stream, or none if the specified name does not exist.

Parameters

name (str) –

Returns

quant

Return type

float

GetRow(timeStamp=None)[source]

Returns an entire row of data from the stream. A row of data is all the data in a dataframe at a specified time stamp, given by timeStamp. If timeStamp is not specified, this function will return the entire stream dataframe.

Parameters

timeStamp (float) –

Returns

  • self.stream.loc[self.timestamp, (]) or self.stream.loc[timeStamp, :]):)

  • list

GetSpecie(name)[source]

Returns a specie named “name” from the stream.

Parameters

name (str) –

Returns

specie

Return type

obj

GetSpecies()[source]

Returns a list of all species in the stream.

Returns

self.species

Return type

list

GetTimeStamp()[source]

Returns the time stamp of the stream.

Returns

self.timeStamp

Return type

float

GetValue(actor, timeStamp=None)[source]

Returns the value associated with a specified “actor” at a specified “timeStamp”. If no timeStamp is specified, then the function will return all values associated with the specified actor at all time stamps.

Parameters
Returns

  • self.stream.loc[self.timeStamp, actor] or self.stream.loc[timeStamp,

  • actor] (list or float, respectively.)

SetSpecieId(name, val)[source]

Sets the numerical id of the specie of name “name” to val.

Parameters
  • name (str) –

  • val (int) –

SetValue(actor, value=None, timeStamp=None)[source]

Sets the value associated with a specified actor at a specified timeStamp to “value”. If no value is specified, the value will default to 0.0. If no timeStamp is specified, it will set all values associated with actor to the specified value (or 0.0 if value = None).

Parameters