From bf6e1002a92b712c2fbfb98c13d060718cd1a349 Mon Sep 17 00:00:00 2001 From: Stephen Mardson McQuay Date: Wed, 23 Mar 2011 17:34:42 -0600 Subject: [PATCH] got rid of magic number --- interp/grid/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interp/grid/__init__.py b/interp/grid/__init__.py index 4ad1d23..b806b98 100644 --- a/interp/grid/__init__.py +++ b/interp/grid/__init__.py @@ -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)