minor: removed useless improts, and changed used appropriate class variable

This commit is contained in:
Stephen Mardson McQuay 2010-11-08 16:25:59 -07:00
parent 2471f650bc
commit c6a9f38046

View File

@ -1,22 +1,19 @@
import sys import sys
import re import re
from collections import defaultdict from collections import defaultdict
import inspect
import numpy as np import numpy as np
import scipy.spatial from scipy.spatial import KDTree
from interp.baker import run_baker from interp.baker import run_baker
from interp.tools import log from interp.tools import log
from simplex import cell, contains from interp.grid.simplex import cell, contains
from smcqdelaunay import * from interp.grid.smcqdelaunay import *
class grid(object): class grid(object):
def __init__(self, verts = None, q = None): def __init__(self, verts = None, q = None):
""" """
this thing eats two pre-constructed arrays of floats:
verts = array of arrays (if passed in, will convert to numpy.array) verts = array of arrays (if passed in, will convert to numpy.array)
[ [
[x0,y0], [x0,y0],
@ -28,7 +25,7 @@ class grid(object):
if verts: if verts:
self.verts = np.array(verts) self.verts = np.array(verts)
self.tree = scipy.spatial.KDTree(self.verts) self.tree = KDTree(self.verts)
if q: if q:
self.q = np.array(q) self.q = np.array(q)
@ -218,7 +215,6 @@ class delaunay_grid(grid):
S is S_j from baker's paper : some verts from all point that are not the simplex S is S_j from baker's paper : some verts from all point that are not the simplex
""" """
log.debug(inspect.stack()[1][3])
log.debug("extra verts: %d" % extra_points) log.debug("extra verts: %d" % extra_points)
log.debug("simplex size: %d" % simplex_size) log.debug("simplex size: %d" % simplex_size)
@ -313,7 +309,7 @@ class delaunay_grid(grid):
log.debug('start') log.debug('start')
qdelaunay_string = get_qdelaunay_dump_str(self) qdelaunay_string = get_qdelaunay_dump_str(self)
cell_to_cells = [] cell_to_cells = []
for matcher in grid.cell_re.finditer(qdelaunay_string): for matcher in delaunay_grid.cell_re.finditer(qdelaunay_string):
d = matcher.groupdict() d = matcher.groupdict()
cell_name = d['cell'] cell_name = d['cell']