Skip to content

Commit

Permalink
add example tree
Browse files Browse the repository at this point in the history
a simple example using fake data will be started by the run-tests
script.
  • Loading branch information
skuschel committed Dec 11, 2014
1 parent fd4093f commit c7a8ded
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
build/
dist/
doc/_build

*.png
2 changes: 1 addition & 1 deletion doc/getstarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Getting started

The following script should just show an example how to get started using the postpic postprocessor. This script uses the dummy reader (thus auto generated random data). Thats why there is no input file needed to read the simulation data from.

.. literalinclude:: dummyexample.py
.. literalinclude:: ../examples/simpleexample.py
:language: python
7 changes: 6 additions & 1 deletion doc/dummyexample.py → examples/simpleexample.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
pp.datareader.chooseCode('dummy')

dr = pp.datareader.readDump(3e5) # Dummyreader takes a float as argument, not a string.
plotter = pp.plotting.plottercls(dr, outdir='', autosave=True)
savedir = '_examplepictures/'
import os
if not os.path.exists(savedir):
os.mkdir(savedir)

plotter = pp.plotting.plottercls(dr, outdir=savedir, autosave=True)
fa = pp.analyzer.FieldAnalyzer(dr)

from postpic.analyzer import ParticleAnalyzer as PA
Expand Down
3 changes: 3 additions & 0 deletions run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ exitonfailure () {
nosetests
exitonfailure $?

examples/simpleexample.py
exitonfailure $?

pep8 postpic --statistics --count --show-source --ignore=W391,E123,E226,E24 --max-line-length=99
exitonfailure $?

Expand Down

0 comments on commit c7a8ded

Please sign in to comment.