got rid of magic number

This commit is contained in:
Stephen McQuay 2011-03-23 17:34:42 -06:00
parent 50cc783b97
commit bf6e1002a9
1 changed files with 3 additions and 1 deletions

View File

@ -12,6 +12,8 @@ import interp.grid.simplex
import logging
log = logging.getLogger("interp")
MAX_SEARCH_COUNT = 128
class grid(object):
def __init__(self, verts = None, q = None):
"""
@ -55,7 +57,7 @@ class grid(object):
while not simplex and cells_to_check:
attempts += 1
if attempts > 200:
if attempts > MAX_SEARCH_COUNT:
raise Exception("Is the search becoming exhaustive?")
cur_cell = cells_to_check.pop(0)