From f7f40fc0702de0bbe0dad4293f871936859b333f Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Fri, 21 Dec 2012 11:24:16 -0600 Subject: [PATCH] Pi: comment cleanups --- modules/Pi.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/modules/Pi.py b/modules/Pi.py index 5d9c52d..44d1e2e 100644 --- a/modules/Pi.py +++ b/modules/Pi.py @@ -14,6 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . + """ import math @@ -25,19 +26,21 @@ import MySQLdb as mdb from Module import Module class Pi(Module): - """ - Use the Monte Carlo method to approximate pi. Each time this method is called, - it calculates a random point inside a square on the xy plane. If that point also - falls within a circle bound within that square, it is added to the count of points - inside. Over time, 4 * count_inside / count approaches pi. - Idea from #linode on OFTC. Code from http://www.eveandersson.com/pi/monte-carlo-circle + """Use the Monte Carlo method to approximate pi. + + Each time this method is called, it calculates a random point inside a + square on the xy plane. If that point also falls within a circle bound + within that square, it is added to the count of points inside. Over time, + 4 * count_inside / count approaches pi. + + Idea from #linode on OFTC. + Code from http://www.eveandersson.com/pi/monte-carlo-circle + """ def db_init(self): - """ - Initialize database tables. - """ + """Initialize database tables.""" # init the database if pi table doesn't exist version = self.db_module_registered(self.__class__.__name__)