Package s3 :: Module s3timeplot :: Class S3TimeSeriesPeriod
[frames] | no frames]

Class S3TimeSeriesPeriod

source code

object --+
         |
        S3TimeSeriesPeriod

Class representing a single time period (slot) in an event frame, within which events will be grouped and facts aggregated

Instance Methods
 
__init__(self, start, end=None)
Constructor
source code
 
add_current(self, event)
Add a current event to this period
source code
 
add_previous(self, event)
Add a previous event to this period
source code
 
as_dict(self, rows=None, cols=None, isoformat=True)
Convert the aggregated results into a JSON-serializable dict
source code
 
group(self, cumulative=False)
Group events by their row and col axis values
source code
 
aggregate(self, facts)
Group and aggregate the events in this period
source code
 
duration(self, event, interval)
Compute the total duration of the given event before the end of this period, in number of interval
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods
 
get_rule(start, end, interval)
Convert a time slot string expression into a dateutil rrule within the context of a time period
source code
Properties

Inherited from object: __class__

Method Details

__init__(self, start, end=None)
(Constructor)

source code 

Constructor

Parameters:
  • start - the start of the time period (datetime)
  • end - the end of the time period (datetime)
Overrides: object.__init__

add_current(self, event)

source code 

Add a current event to this period

Parameters:
  • event - the S3TimeSeriesEvent

add_previous(self, event)

source code 

Add a previous event to this period

Parameters:
  • event - the S3TimeSeriesEvent

as_dict(self, rows=None, cols=None, isoformat=True)

source code 

Convert the aggregated results into a JSON-serializable dict

Parameters:
  • rows - the row keys for the result
  • cols - the column keys for the result
  • isoformat - convert datetimes into ISO-formatted strings

group(self, cumulative=False)

source code 

Group events by their row and col axis values

Parameters:
  • cumulative - include previous events

aggregate(self, facts)

source code 

Group and aggregate the events in this period

Parameters:
  • facts - list of facts to aggregate

duration(self, event, interval)

source code 

Compute the total duration of the given event before the end of this period, in number of interval

Parameters:
  • event - the S3TimeSeriesEvent
  • interval - the interval expression (string)

get_rule(start, end, interval)
Static Method

source code 

Convert a time slot string expression into a dateutil rrule within the context of a time period

Parameters:
  • start - the start of the time period (datetime)
  • end - the end of the time period (datetime)
  • interval - time interval expression, like "days" or "2 weeks"