예제 #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.')
예제 #2
0
파일: bc.py 프로젝트: 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")
예제 #3
0
파일: bc.py 프로젝트: 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.")
예제 #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")