/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 | Static Public Attributes | Properties | Private Member Functions
DybPython::vlut::vlut::Vlut Class Reference

List of all members.

Public Member Functions

def special_compare
def get_or_create
def create
def __init__
def __str__
def extras
def write

Static Public Attributes

tuple special_compare = classmethod( special_compare )
tuple get_or_create = classmethod( get_or_create )
tuple create = classmethod( create )

Properties

 stat = property(lambda self:self.scan.get('_stat',{}))
 ndif = property(lambda self:self.stat.get('ndif',-1))

Private Member Functions

def _meta

Detailed Description

Definition at line 11 of file vlut.py.


Constructor & Destructor Documentation

def DybPython::vlut::vlut::Vlut::__init__ (   self)

Definition at line 92 of file vlut.py.

00093                       :
00094         list.__init__(self)


Member Function Documentation

def DybPython::vlut::vlut::Vlut::special_compare (   cls,
  avs,
  bvs,
  nominalspec = None 
)
:param avs: `VlutSpec` instance
:param bvs: `VlutSpec` instance
:param nominalspec:  a naming `VlutSpec` instance

Special case comparisons such as cross comparing different dbconf AND
different option variations. 

Definition at line 12 of file vlut.py.

00012                                                             : 
00013         """
00014         :param avs: `VlutSpec` instance
00015         :param bvs: `VlutSpec` instance
00016         :param nominalspec:  a naming `VlutSpec` instance
00017 
00018         Special case comparisons such as cross comparing different dbconf AND
00019         different option variations. 
00020         """
00021         spec = nominalspec if nominalspec else [avs,bvs] 
00022         asc = Scan.get_or_create( avs )
00023         bsc = Scan.get_or_create( bvs )
00024 
00025         csc = Scan.compare_( asc , bsc ) 
00026         cvl = Vlut.create( csc , spec=spec )
00027         cvl.write()   
00028         return cvl

Definition at line 31 of file vlut.py.

00032                                  :
00033         scan = Scan.get_or_create( vs )
00034         vlut = Vlut.create( scan, spec=vs )
00035         vlut.write()
        return vlut
def DybPython::vlut::vlut::Vlut::create (   cls,
  scan,
  fn = lambda _:_['rvs'],
  spec = None 
)
Create validity look up table from a dbiscan  

Definition at line 38 of file vlut.py.

00038                                         :_['rvs'], spec=None ): 
00039         """
00040         Create validity look up table from a dbiscan  
00041         """ 
00042 
00043         if not scan:
00044            log.fatal("undefined scan " ) 
00045            raise Exception("Vlut.create undefined scan") 
00046 
00047         vlut = cls()
00048         alltimes = []
00049         allseqno = []
00050         ambipairs = []
00051 
00052         def insertdates_only(ik):
00053             """
00054             Skip the _stat dict but cannot just pluck datetimes 
00055             as in disparate comparison case labels are used inplace of insertdates
00056             """
00057             if type(ik) == datetime:
00058                 return True
00059             if ik.startswith('_'):
00060                 return False
00061             return True
00062 
00063         iks = sorted(filter(insertdates_only,scan.keys()))
00064         log.debug("Vlut.create %s " % iks )
00065 
00066         # rollback outer loop
00067         for insertdate in iks: 
00068             lod = scan[insertdate]                 # list-of-dict with the TIMESTART results
00069             t   = map(lambda d:d['t'],   lod )
00070             rvs = map(lambda d:d['rvs'], lod )
00071 
00072             alltimes.extend(t)                     
00073             allseqno.extend(rvs)
00074             
00075             # converts lod into tabular data row dict  
00076             thead = ["insertdate"] + map(str,t)
00077             tbody = [ insertdate ] + map(fn,lod )    
00078             vlut.append(dict(zip(thead,tbody)))
00079             pass
00080 
00081         alltimes = sorted(list(set(alltimes)))
00082         vlut.alltimes = alltimes
00083         vlut.allseqno = sorted(list(set(allseqno))) 
00084         vlut.order = ["insertdate"] + map(str,alltimes)
00085         vlut.ambipairs = ambipairs
00086         vlut.spec = spec
00087         vlut.scan = scan
00088         vlut.meta = vlut._meta()
00089         return vlut
def DybPython::vlut::vlut::Vlut::_meta (   self) [private]

Definition at line 98 of file vlut.py.

00099                    :
00100         meta = dict()
00101         meta['insertdates'] = len(self)
00102         meta['timestarts']  = len(self.order)
00103         meta['ndif']        = self.ndif
00104         return meta

def DybPython::vlut::vlut::Vlut::__str__ (   self)

Definition at line 105 of file vlut.py.

00106                      :
00107        td = TabularData(self)           ## tabulates a list of dicts with each row corresponding to each dict
00108        return td.as_rst(cols=self.order)   

def DybPython::vlut::vlut::Vlut::extras (   self,
  _vs = None 
)

Definition at line 109 of file vlut.py.

00110                                :
00111         if not _vs:_vs = self.spec
00112         vl = ""
00113         for pair in self.ambipairs:
00114             vl += rst_title(str(pair))
00115             vl += ".. dbivld:: %s %s %s\n\n" % ( _vs.dbconf , _vs['tn'] , ",".join(map(str,pair)) )
00116         vl += rst_title(str(self.allseqno))  
00117         vl += ".. dbivld:: %s %s %s\n\n" % ( _vs.dbconf , _vs['tn'], ",".join(map(str,self.allseqno)) )
00118         return vl

def DybPython::vlut::vlut::Vlut::write (   self,
  _vs = None 
)

Definition at line 119 of file vlut.py.

00120                              :
00121         if not _vs:
00122             _vs = self.spec
00123         vs = _vs.copy(category='vlut')
00124         titl = vs.title_()
00125         mtitl = " ".join("%s:%s" % kv for kv in filter(lambda kv:not kv[0].startswith("_"),self.meta.items()) )
00126         titl += " ``%s``" % mtitl
00127         path = vs.path 
00128         if os.path.exists(path) and not vs.force: 
00129             log.debug("skip prexisting %s " % path )
00130         else:
00131             log.info("writing %s " % path )
00132             with open(path,"w") as fp:
00133                 fp.write(rst_title(titl))  
00134                 fp.write(str(self))
00135                 if not vs.plain:  
00136                     fp.write(self.extras(vs))
00137         return path
00138 


Member Data Documentation

Definition at line 29 of file vlut.py.

Definition at line 36 of file vlut.py.

tuple DybPython::vlut::vlut::Vlut::create = classmethod( create ) [static]

Definition at line 90 of file vlut.py.


Property Documentation

DybPython::vlut::vlut::Vlut::stat = property(lambda self:self.scan.get('_stat',{})) [static]

Definition at line 95 of file vlut.py.

DybPython::vlut::vlut::Vlut::ndif = property(lambda self:self.stat.get('ndif',-1)) [static]

Definition at line 96 of file vlut.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:55:41 for DybPython by doxygen 1.7.4