added a progress bar
This commit is contained in:
parent
7685b130b7
commit
fad88725e3
@ -6,6 +6,8 @@ import numpy as np
|
|||||||
|
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
|
import progressbar
|
||||||
|
|
||||||
import interp.bootstrap
|
import interp.bootstrap
|
||||||
|
|
||||||
from interp.grid.gmsh import ggrid
|
from interp.grid.gmsh import ggrid
|
||||||
@ -80,6 +82,7 @@ if __name__ == '__main__':
|
|||||||
results = {True:0, False:0}
|
results = {True:0, False:0}
|
||||||
i = 0
|
i = 0
|
||||||
outside = 0
|
outside = 0
|
||||||
|
pbar = progressbar.ProgressBar().start()
|
||||||
while i < int(count):
|
while i < int(count):
|
||||||
try:
|
try:
|
||||||
X = np.random.random((1,options.dimension))[0]
|
X = np.random.random((1,options.dimension))[0]
|
||||||
@ -88,11 +91,13 @@ if __name__ == '__main__':
|
|||||||
e = get_right_exact_func(options)(X)
|
e = get_right_exact_func(options)(X)
|
||||||
|
|
||||||
results[improved_answer(a, e)] += 1
|
results[improved_answer(a, e)] += 1
|
||||||
|
pbar.update(i / count)
|
||||||
i += 1
|
i += 1
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print e
|
# print e
|
||||||
print X, i, count
|
# print X, i, count
|
||||||
outside += 1
|
outside += 1
|
||||||
|
|
||||||
|
pbar.finis()
|
||||||
print "total skipped points: %d" % outside
|
print "total skipped points: %d" % outside
|
||||||
print results
|
print results
|
||||||
|
Loading…
Reference in New Issue
Block a user