Package trunk :: Package BIP
[hide private]

Source Code for Package trunk.BIP

 1  """ 
 2  Bayesian Inference Package containing usefull classes and functions 
 3  for doing inference in various applications. 
 4   
 5  This is not a "Bayesian Statistics" package, i.e., it was not conceived   
 6  to provide data analysis methods such as the one you can find  
 7  on a statistical package such as R (for example). 
 8   
 9  Here, you will find some the basic building blocks those  
10  sophisticated Bayesian regression methods are built from, such as  
11  likelihood functions, MCMC samplers, SMC samplers, etc.. 
12   
13  This package exists because such basic tools are not readily accessible  
14  in Task-oriented statistical software. From these tools, as this package matures, 
15  you will be able to easily build a solution for your own inferential inquiries,  
16  a solution which may not be available on standard statistical packages. 
17  """ 
18   
19  __docformat__ = "restructuredtext en" 
20   
21  import logging 
22  from logging.handlers import RotatingFileHandler 
23   
24   
25  logger = logging.getLogger("BIP") 
26  logger.setLevel(logging.DEBUG) 
27  # create file handler which logs even debug messages 
28  fh = RotatingFileHandler("/tmp/BIP.log", maxBytes=500000, backupCount=2) 
29  fh.setLevel(logging.DEBUG) 
30  # create console handler with a higher log level 
31  ch = logging.StreamHandler() 
32  ch.setLevel(logging.ERROR) 
33  # create formatter and add it to the handlers 
34  formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") 
35  ch.setFormatter(formatter) 
36  fh.setFormatter(formatter) 
37  # add the handlers to logger 
38  logger.addHandler(ch) 
39  logger.addHandler(fh) 
40