From 8ad37ef82d656775eb955d19cafa736e00dacbae Mon Sep 17 00:00:00 2001 From: Tomas Musil Date: Tue, 24 Jun 2014 15:01:09 +0200 Subject: [PATCH 1/1] more comments --- imago_pack/im_debug.py | 7 +++++++ imago_pack/imago.py | 6 +++++- imago_pack/intrsc.py | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/imago_pack/im_debug.py b/imago_pack/im_debug.py index 9916e92..d04144a 100644 --- a/imago_pack/im_debug.py +++ b/imago_pack/im_debug.py @@ -1,3 +1,9 @@ +"""Debugging image display. + +This is a simple module, that shows images on screen using PyGame. +It is not used anywhere in the standard UI, serves only for debugging. +""" + try: import pygame except ImportError, msg: @@ -6,6 +12,7 @@ except ImportError, msg: sys.exit(1) def show(image, caption='', name=None): + """Initialize PyGame and show the *image*.""" if image.mode != 'RGB': image = image.convert('RGB') pygame.init() diff --git a/imago_pack/imago.py b/imago_pack/imago.py index 806ddcc..33e6181 100755 --- a/imago_pack/imago.py +++ b/imago_pack/imago.py @@ -1,6 +1,9 @@ #!/usr/bin/env python -"""Go image recognition.""" +"""Go image recognition. + +This is the main UI module of Imago. +""" import sys import os @@ -43,6 +46,7 @@ def argument_parser(): return parser +# TODO factor this into smaller functions def main(): """Main function of the program.""" diff --git a/imago_pack/intrsc.py b/imago_pack/intrsc.py index c64386f..d577205 100644 --- a/imago_pack/intrsc.py +++ b/imago_pack/intrsc.py @@ -1,4 +1,4 @@ -"""Imago intersections module""" +"""Imago intersections module.""" from math import cos, tan, pi from operator import itemgetter @@ -100,6 +100,7 @@ def board(image, lines, show_all, do_something): return output.Board(19, board_r) def mean_luma(cluster): + """Return mean luma of the *cluster* of points.""" return sum(c[0][0] for c in cluster) / float(len(cluster)) def intersections_from_angl_dist(lines, size, get_all=True): -- 2.4.2