Pi: comment cleanups

This commit is contained in:
Brian S. Stephan 2012-12-21 11:24:16 -06:00
parent 315869de4d
commit f7f40fc070
1 changed files with 12 additions and 9 deletions

View File

@ -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 <http://www.gnu.org/licenses/>.
"""
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__)