Skip to content

Commit 5f54fe1

Browse files
committed
Merge pull request #487 from ketch/run_doctests
Modify Travis script to run doctests.
2 parents 9eadd43 + a619af8 commit 5f54fe1

File tree

3 files changed

+33
-26
lines changed

3 files changed

+33
-26
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ script:
4444
- if [[ "${TEST_PACKAGE}" == "petclaw" ]]; then
4545
mpirun -n 4 ${CLAWPACK}/petsc4py_stack/bin/nosetests -v;
4646
fi
47+
# Run doctests
48+
- cd ../src/pyclaw
49+
- nosetests --first-pkg-wins --with-doctest --exclude=example --exclude=limiters --exclude=sharpclaw --exclude=io
50+
4751

4852
after_success:
4953
- coveralls

cleanup_examples.py

100644100755
Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
1+
#!/usr/bin/env python
12

2-
#
3-
# Cleans up by deleting object files, executable, and _output directory.
4-
# Use after run_examples to clean up stuff not needed on webpages.
3+
r"""
4+
Cleans up by deleting object files, executable, and _output directory.
5+
"""
56

67
import os,sys,glob
78
import shutil
89

9-
examples_dir = os.path.abspath('./examples')
10-
print "Will remove all _output, _plots, and build directories from ",examples_dir
11-
ans = raw_input("Ok? ")
12-
if ans.lower() not in ['y','yes']:
13-
print "Aborting."
14-
sys.exit()
10+
if __name__ == "__main__":
1511

16-
os.chdir(examples_dir)
17-
exdirlist = []
18-
for (dirpath, subdirs, files) in os.walk('.'):
19-
currentdir = os.path.abspath(os.getcwd())
20-
os.chdir(os.path.abspath(dirpath))
21-
22-
print 'In directory ',dirpath
23-
24-
if os.path.isdir('_output'):
25-
shutil.rmtree('./_output')
26-
if os.path.isdir('_plots'):
27-
shutil.rmtree('./_plots')
28-
if os.path.isdir('build'):
29-
shutil.rmtree('./build')
12+
examples_dir = os.path.abspath('./examples')
13+
print "Will remove all _output, _plots, and build directories from ",examples_dir
14+
ans = raw_input("Ok? ")
15+
if ans.lower() not in ['y','yes']:
16+
print "Aborting."
17+
sys.exit()
18+
19+
os.chdir(examples_dir)
20+
exdirlist = []
21+
for (dirpath, subdirs, files) in os.walk('.'):
22+
currentdir = os.path.abspath(os.getcwd())
23+
os.chdir(os.path.abspath(dirpath))
24+
25+
print 'In directory ',dirpath
3026

31-
os.chdir(currentdir)
27+
if os.path.isdir('_output'):
28+
shutil.rmtree('./_output')
29+
if os.path.isdir('_plots'):
30+
shutil.rmtree('./_plots')
31+
if os.path.isdir('build'):
32+
shutil.rmtree('./build')
33+
34+
os.chdir(currentdir)
3235

src/pyclaw/solver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ class Solver(object):
3434
Solver initialization takes one argument -- a Riemann solver:
3535
3636
>>> from clawpack import pyclaw, riemann
37-
>>> solver = pyclaw.ClawSolver2D(riemann.rp2_euler_4wave)
37+
>>> solver = pyclaw.ClawSolver2D(riemann.euler_4wave_2D)
3838
39-
After which solver options may be set.
39+
after which solver options may be set.
4040
It is necessary to set the boundary conditions (for q, and
4141
for aux if an aux array is used):
4242

0 commit comments

Comments
 (0)