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

Class S3TimeSeriesFact

source code

object --+
         |
        S3TimeSeriesFact

Class representing a fact layer

Instance Methods
 
__init__(self, method, base, slope=None, interval=None, label=None)
Constructor
source code
 
aggregate(self, period, events)
Aggregate values from events
source code
 
compute(self, values)
Aggregate a list of values.
source code
 
resolve(self, resource)
Resolve the base and slope selectors against resource
source code

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

Class Methods
 
parse(cls, fact)
Parse fact expression
source code
 
lookup_label(cls, resource, method, base, slope=None, interval=None)
Lookup the fact label from the timeplot options of resource
source code
 
default_label(cls, rfield, method)
Generate a default fact label
source code
Class Variables
  METHODS = {"count": "Count", "sum": "Total", "cumulate": "Cumu...
Properties

Inherited from object: __class__

Method Details

__init__(self, method, base, slope=None, interval=None, label=None)
(Constructor)

source code 

Constructor

Parameters:
  • method - the aggregation method
  • base - column name of the (base) field
  • slope - column name of the slope field (for cumulate method)
  • interval - time interval expression for the slope
Overrides: object.__init__

aggregate(self, period, events)

source code 

Aggregate values from events

Parameters:
  • period - the period
  • events - the events

compute(self, values)

source code 

Aggregate a list of values.

Parameters:
  • values - iterable of values

parse(cls, fact)
Class Method

source code 

Parse fact expression

Parameters:
  • fact - the fact expression

resolve(self, resource)

source code 

Resolve the base and slope selectors against resource

Parameters:
  • resource - the resource

lookup_label(cls, resource, method, base, slope=None, interval=None)
Class Method

source code 

Lookup the fact label from the timeplot options of resource

Parameters:
  • resource - the resource (S3Resource)
  • method - the aggregation method (string)
  • base - the base field selector (string)
  • slope - the slope field selector (string)
  • interval - the interval expression (string)

default_label(cls, rfield, method)
Class Method

source code 

Generate a default fact label

Parameters:
  • rfield - the S3ResourceField (alternatively the field label)
  • method - the aggregation method

Class Variable Details

METHODS

Value:
{"count": "Count", "sum": "Total", "cumulate": "Cumulative Total", "mi\
n": "Minimum", "max": "Maximum", "avg": "Average",}