/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Private Member Functions
Scraper::adlid::AdLidAverager Class Reference
Inheritance diagram for Scraper::adlid::AdLidAverager:
Inheritance graph
[legend]
Collaboration diagram for Scraper::adlid::AdLidAverager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def changed
def propagate
def seed

Private Member Functions

def _dummy_dict

Detailed Description

Specialization of generic averager for AD Lid Sensor tables

Definition at line 58 of file adlid.py.


Member Function Documentation

def Scraper::adlid::AdLidAverager::changed (   self,
  sv 
)

Definition at line 62 of file adlid.py.

00063                            :
00064         return False   

def Scraper::adlid::AdLidAverager::propagate (   self,
  sv 
)
yields one or more target dicts ready for writing to target DB

NB Averager performs group_by queries within time bins 
that can yield no results 

Definition at line 65 of file adlid.py.

00066                             :
00067         """
00068         yields one or more target dicts ready for writing to target DB
00069 
00070         NB Averager performs group_by queries within time bins 
00071         that can yield no results 
00072 
00073         """
00074         aggl=sv[-1].aggd
00075         assert type(aggl) == list , "expect list when using aggregate_group_by %r " % aggl
00076         if len(aggl) == 0:
00077             log.debug("empty query tcursor %s " % repr(sv.tcursor) ) 
00078         for aggd in aggl:
00079             if aggd['NSamples']==0:
00080                 log.warn("AdLidAverager NSamples zero, yielding dummy ")
00081                 yield self._dummy_dict()
00082             else:    
00083                 yield aggd

def Scraper::adlid::AdLidAverager::seed (   self,
  sc 
)
Used for seeding target DB when testing into empty tables

:param sc: source class, potentially different seeds will be needed 
   for each source that feeds into a single target

Definition at line 84 of file adlid.py.

00085                       :
00086         """
00087         Used for seeding target DB when testing into empty tables
00088 
00089         :param sc: source class, potentially different seeds will be needed 
00090                    for each source that feeds into a single target
00091 
00092         """
00093         kls = self.target.kls               ## the genDbi target  class
00094         keys = kls.SpecKeys().aslist()
00095         return dict(zip(keys,map(lambda _:0, keys)))    ## state dict with all values 0
    
def Scraper::adlid::AdLidAverager::_dummy_dict (   self,
  v = -1 
) [private]
target dict with all values `v`

Definition at line 96 of file adlid.py.

00097                                :
00098         """
00099         target dict with all values `v`
00100         """
00101         kls = self.target.kls             
00102         keys = kls.SpecKeys().aslist()
00103         return dict(zip(keys,map(lambda _:v, keys))) 
00104  


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:50:03 for Scraper by doxygen 1.7.4