/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
Scraper::vplot::DB Class Reference

List of all members.

Public Member Functions

def __init__
def __call__
def ss
def noncon
def all

Public Attributes

 conn

Detailed Description

Definition at line 56 of file vplot.py.


Constructor & Destructor Documentation

def Scraper::vplot::DB::__init__ (   self,
  dbconf 
)

Definition at line 57 of file vplot.py.

00058                               :
        self.conn = _mysql.connect(read_default_group=dbconf)

Member Function Documentation

def Scraper::vplot::DB::__call__ (   self,
  sql,
  verbose = 3 
)
:return: numpy array result

Note that this is using the slow access technique, 
fast buffer casting is failing with newer numpy 

Definition at line 59 of file vplot.py.

00060                                       :
00061         """
00062         :return: numpy array result
00063 
00064         Note that this is using the slow access technique, 
00065         fast buffer casting is failing with newer numpy 
00066         """
00067         self.conn.query(sql)
00068         r = self.conn.store_result()
        return r.fetch_nparray(verbose=verbose)
def Scraper::vplot::DB::ss (   self,
  tab 
)
:param tab: DBI table name
:return: list of distinct "SITEMASK=X and SUBSITE=Y" clauses for the table

Definition at line 69 of file vplot.py.

00070                      :
00071         """
00072         :param tab: DBI table name
00073         :return: list of distinct "SITEMASK=X and SUBSITE=Y" clauses for the table
00074         """ 
00075         sql = "select distinct(concat('SITEMASK=',SITEMASK,' and SUBSITE=',SUBSITE)) as SS from %(tab)sVld" % locals()
00076         return map(lambda _:_[0],self(sql).tolist())

def Scraper::vplot::DB::noncon (   self,
  tab,
  ss 
)
:param tab: DBI table name
:param ss: sitemask subsite clause
:return: numpy array result

Definition at line 77 of file vplot.py.

00077                              : 
00078         """
00079         :param tab: DBI table name
00080         :param ss: sitemask subsite clause
00081         :return: numpy array result
00082         """ 
00083         sql = "select * from %(tab)sVld where %(ss)s and TIMESTART not in (select distinct(TIMEEND) from %(tab)sVld where %(ss)s )" % locals()
00084         return self(sql)
00085 
def Scraper::vplot::DB::all (   self,
  tab,
  ss = "1=1" 
)
:param tab: DBI table name
:param ss: sitemask subsite clause
:return: numpy array result

Definition at line 86 of file vplot.py.

00086                                 : 
00087         """
00088         :param tab: DBI table name
00089         :param ss: sitemask subsite clause
00090         :return: numpy array result
00091         """ 
00092         sql = "select * from %(tab)sVld where %(ss)s " % locals()
00093         return self(sql)
00094 
00095 
00096 

Member Data Documentation

Definition at line 57 of file vplot.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:50:03 for Scraper by doxygen 1.7.4