From 385294a040d09b82705511a7180d3c94cfeaa79b Mon Sep 17 00:00:00 2001 From: Stephen Mardson McQuay Date: Thu, 24 Mar 2011 15:48:50 -0600 Subject: [PATCH] won't be needing these --- bin/test2d-connectivity.py | 69 ------------------------------------- bin/test3d-connectivity.py | 70 -------------------------------------- 2 files changed, 139 deletions(-) delete mode 100755 bin/test2d-connectivity.py delete mode 100755 bin/test3d-connectivity.py diff --git a/bin/test2d-connectivity.py b/bin/test2d-connectivity.py deleted file mode 100755 index b6c079a..0000000 --- a/bin/test2d-connectivity.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python - -import sys -import os - -import pickle -from glob import glob - -from interp.grid.DD import random_grid -from interp.baker import get_phis, run_baker -from interp.tools import friendly_exact_2D as exact_func, improved_answer - -import numpy as np - -import pylab - -def draw_gb(bad, good): - pylab.xlabel('total runs') - pylab.ylabel('count') - pylab.grid(True) - pylab.plot(bad) - pylab.plot(good) - pylab.legend(('bad', 'good')) - - pylab.savefig("output.png") - -FILE_PREFIX='/tmp/qhull-' - - -if __name__ == '__main__': - for g in glob('%s*' % FILE_PREFIX): - os.remove(g) - - try: - total_points = int(sys.argv[1]) - random_points = int(sys.argv[2]) - total_tries = int(sys.argv[3]) - except: - print "usage: app.py [total points in random grid] [number of random points to attempt] [total attempts]" - sys.exit(1) - - - d = {True: 0, False: 0} - good = [] - bad = [] - for cur_try in xrange(total_tries): - g = random_grid(total_points) - open('%s%0.3d.txt' % (FILE_PREFIX, cur_try), 'w').write(g.for_qhull()) - - for i in xrange(random_points): - X = [np.random.rand(), np.random.rand()] - exact = exact_func(X) - - try: - try: - answer = g.run_baker(X) - d[improved_answer(answer, exact)] += 1 - except ValueError as e: - smblog.error(e) - except smberror as e: - print e - print d - - print d - bad.append(d[False]) - good.append(d[True]) - - draw_gb(bad = bad, good = good) - pickle.dump((bad,good), open("test.p", 'w')) diff --git a/bin/test3d-connectivity.py b/bin/test3d-connectivity.py deleted file mode 100755 index 78c96c6..0000000 --- a/bin/test3d-connectivity.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python - -import sys -import os - -import pickle -from glob import glob - -from interp.grid.DDD import random_grid -from interp.baker import get_phis, run_baker -from interp.tools import baker_exact_3D as exact_func, improved_answer - -import numpy as np - -import pylab - -def draw_gb(bad, good): - pylab.xlabel('total runs') - pylab.ylabel('count') - pylab.grid(True) - pylab.plot(bad) - pylab.plot(good) - pylab.legend(('bad', 'good')) - - pylab.savefig("output.png") - -FILE_PREFIX='/tmp/qhull-' - - -if __name__ == '__main__': - for g in glob('%s*' % FILE_PREFIX): - os.remove(g) - - try: - total_points = int(sys.argv[1]) - random_points = int(sys.argv[2]) - total_tries = int(sys.argv[3]) - except: - print "usage: app.py [total points in random grid] [number of random points to attempt] [total attempts]" - sys.exit(1) - - - print "total points", total_points - - good = [] - bad = [] - for cur_try in xrange(1,total_tries + 1): - d = {True: 0, False: 0} - g = random_grid(total_points * cur_try) - open('%s%0.3d.txt' % (FILE_PREFIX, cur_try), 'w').write(g.for_qhull()) - - for i in xrange(random_points): - X = [np.random.rand(), np.random.rand(), np.random.rand()] - exact = exact_func(X) - - try: - try: - answer = g.run_baker(X, order=2, extra_points=10) - d[improved_answer(answer, exact)] += 1 - except ValueError as e: - print e - except Exception as e: - print e - print d - - print d - bad.append(d[False]) - good.append(d[True]) - - draw_gb(bad = bad, good = good)