moved some files around to conform to python best practicies

--HG--
rename : lib/baker.py => lib/baker/__init__.py
rename : lib/tools.py => lib/baker/tools.py
rename : lib/grid.py => lib/grid/__init__.py
rename : lib/smcqdelaunay.py => lib/grid/smcqdelaunay.py
This commit is contained in:
smcquay@cfdviz2 2010-03-08 13:05:42 -07:00
parent 9a1b8d14b2
commit c5d8fff883
6 changed files with 15 additions and 11 deletions

View File

@ -5,7 +5,7 @@ from optparse import OptionParser
import numpy as np import numpy as np
from tools import rms, exact_func from baker.tools import rms, exact_func
import grid import grid

View File

@ -3,10 +3,9 @@
import sys import sys
import pickle import pickle
from grid import simple_rect_grid, simple_random_grid from grid import simple_rect_grid, simple_random_grid
from baker import run_baker from baker import run_baker
from baker.tools import smberror
from tools import smberror
qfile = '/tmp/grid_regular.txt' qfile = '/tmp/grid_regular.txt'

View File

@ -1,7 +1,7 @@
import numpy as np import numpy as np
import sys import sys
from tools import smberror from baker.tools import smberror
def get_phis(X, R): def get_phis(X, R):
""" """

View File

@ -1,6 +1,9 @@
import numpy as np import numpy as np
class smberror(Exception): class smberror(Exception):
"""
this is a silly little exception subclass
"""
def __init__(self, val): def __init__(self, val):
self.value = val self.value = val
def __str__(self): def __str__(self):
@ -17,5 +20,7 @@ def rms(errors):
return r return r
def exact_func(x, y): def exact_func(x, y):
"""
the exact function used from baker's article (for testing)
"""
return np.power((np.sin(x * np.pi) * np.cos(y * np.pi)), 2) return np.power((np.sin(x * np.pi) * np.cos(y * np.pi)), 2)
return np.sin(x * np.pi) * np.cos(y * np.pi)

View File

@ -2,14 +2,14 @@
import sys import sys
import re import re
from collections import defaultdict from collections import defaultdict
import numpy as np import numpy as np
import scipy.spatial import scipy.spatial
from baker import run_baker, get_phis from baker import run_baker, get_phis
from tools import exact_func, smberror from baker.tools import exact_func, smberror
from smcqdelaunay import * from grid.smcqdelaunay import *
class face(object): class face(object):
def __init__(self, name): def __init__(self, name):