Exemplo n.º 1
0
def check_germs(germs, xlo, ylo, sizex, sizey):
    for G in germs:
        if G[0] < xlo or G[1] < ylo or G[0] > xlo + sizex or G[1] > ylo + sizey:
            print >>sys.stderr, 'germ found outside bounding box: %f %f' \
                % (G[0], G[1])
            if not ('--ignore-germs-outside-bbox' in sys.argv):
                die('germs found outside boundary box. aborting.')
Exemplo n.º 2
0
Arquivo: bc.py Projeto: skapfer/papaya
def add(x, y):
    assert len(x) == len(y)
    if len(x) == 2:
        return (x[0] + y[0], x[1] + y[1])
    else:
        die("NYI")
Exemplo n.º 3
0
Arquivo: bc.py Projeto: skapfer/papaya
def check_germs(germs, xlo, ylo, sizex, sizey):
    for G in germs:
        if G[0] < xlo or G[1] < ylo or G[0] > xlo + sizex or G[1] > ylo + sizey:
            print >>sys.stderr, "germ found outside bounding box: %f %f" % (G[0], G[1])
            if not ("--ignore-germs-outside-bbox" in sys.argv):
                die("germs found outside boundary box. aborting.")
Exemplo n.º 4
0
def add(x, y):
    assert len(x) == len(y)
    if len(x) == 2:
        return (x[0] + y[0], x[1] + y[1])
    else:
        die("NYI")