/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 | Public Attributes
DybDbi::vrb::CompareVrb Class Reference

List of all members.

Public Member Functions

def __init__
def __call__
def check_payload
def check_validity

Public Attributes

 rpt
 length

Detailed Description

Definition at line 81 of file vrb.py.


Constructor & Destructor Documentation

def DybDbi::vrb::CompareVrb::__init__ (   self,
  kwa 
)

Definition at line 82 of file vrb.py.

00083                              :
00084         dict.__init__(self, **kwa)


Member Function Documentation

def DybDbi::vrb::CompareVrb::__call__ (   self)

Definition at line 85 of file vrb.py.

00086                       :
00087         rpt = {}
00088         ldict = {}
00089         for tag, vrb in self.items():
00090             ldict[tag] = len(vrb)
00091             rpt[tag] = vrb.kls.Rpt().Clone()
00092         self.rpt = rpt
00093 
00094         lset = list(set(ldict.values()))   # uniquing by passing thru the set
00095         assert len(lset) == 1, ("all argument vrb required to have the same length", ldict )
00096         self.length = lset[0]

def DybDbi::vrb::CompareVrb::check_payload (   self,
  first = 0,
  check = None 
)
SEQNO by SEQNO comparisons of digests between tables

:param first: column index to start the digest from, 1 to skip first column, 0 to include all
:param check: function that accepts single arguement, the single seqno dict 

C++ digests `rpt.digest` are constructed from all values in the payloads allowing 
a quick way to check payload correspondence between multiple tables

Definition at line 97 of file vrb.py.

00098                                                 :
00099         """
00100         SEQNO by SEQNO comparisons of digests between tables
00101 
00102         :param first: column index to start the digest from, 1 to skip first column, 0 to include all
00103         :param check: function that accepts single arguement, the single seqno dict 
00104 
00105         C++ digests `rpt.digest` are constructed from all values in the payloads allowing 
00106         a quick way to check payload correspondence between multiple tables
00107         """
00108         for i in range(self.length):
00109             d = dict(index=i) 
00110             for tag,vrb in self.items():
00111                 vrec = vrb.offseq_(i)
00112                 self.rpt[tag].ctx( validityrec=vrec ) 
00113                 d[tag] = dict(seqno=vrec.seqno,digest=self.rpt[tag].digest,pydigest=pydigest_(self.rpt[tag], first=first))
00114             tags = self.keys()
00115             for tag in tags[1:]:
00116                 assert d[tags[0]]['pydigest'] == d[tag]['pydigest'], ("pydigest mismatch", d )
00117             if check:
00118                 check(d)

def DybDbi::vrb::CompareVrb::check_validity (   self,
  check = None 
)
SEQNO by SEQNO comparisons of validity fields between tables

Definition at line 119 of file vrb.py.

00120                                          :
00121         """
00122         SEQNO by SEQNO comparisons of validity fields between tables
00123         """
00124         pass
00125         for i in range(self.length):
00126             v = dict(index=i)
00127             for tag,vrb in self.items():
00128                 vrec = vrb.offseq_(i)
00129                 for qwn in Vrec.qwns:
00130                     if qwn not in v:
00131                         v[qwn] = {}
00132                     qbit = qwn.split(".")
00133                     if len(qbit) == 2: 
00134                         g_ = lambda vrec:getattr(getattr(vrec,qbit[0]),qbit[1]) 
00135                     else:
00136                         g_ = lambda vrec:getattr(vrec,qwn)
00137                     v[qwn][tag] = g_(vrec) 
00138                 pass
00139             if check:
00140                 check(v)
00141 
00142 
00143 


Member Data Documentation

Definition at line 85 of file vrb.py.

Definition at line 85 of file vrb.py.


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:57:25 for DybDbi by doxygen 1.7.4