{
"metadata": {
"name": "",
"signature": "sha256:f567f2e716ed0c19935c28b650becfb7d9d4704a0140ea074dfb150a5fe19a3d"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"PyParty Regression Test Suite"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is a quick run and capture test notebook. It runs other notebooks, including tutorials while suppressing output. Any errors will hault the running, forming a quasi-regression test suite. Standard unit testing is a work in progress.\n",
"\n",
"**Required IPython 3.0.0 dev or higher to properly use %capture magic** due to a recent [issue fix.](https://github.com/ipython/ipython/issues/5685)"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from time import time as TIMENOW\n",
"import os.path as op\n",
"\n",
"NBDIR = '../examples/Notebooks/'\n",
"\n",
"def run_nb(nb):\n",
" \"\"\" Run a notebook in NBDIR; adds .ipynb extension if none found. \"\"\"\n",
" if not op.splitext(nb)[1]:\n",
" nb = '%s.ipynb' % nb\n",
" nbpath = op.join(NBDIR, nb)\n",
" %run $nbpath\n",
" \n",
"run_nb('NBCONFIG.ipynb')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Populating the interactive namespace from numpy and matplotlib\n"
]
},
{
"html": [
""
],
"metadata": {},
"output_type": "display_data",
"text": [
""
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"[Basic Tutorial](http://nbviewer.ipython.org/github/hugadams/pyparty/blob/master/examples/Notebooks/basictests.ipynb?create=1)"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%capture CAPTURED\n",
"ts = TIMENOW()\n",
"NB = 'basictests.ipynb'\n",
"run_nb(NB)\n",
"tdiff = TIMENOW() - ts\n",
"'COMPLETED %s: %.2f sec' % (NB, tdiff)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 2,
"text": [
"'COMPLETED basictests.ipynb: 66.59 sec'"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"ERROR: File `u'NBCONFIG.ipynb.py'` not found.\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"[Intro to Shapes](http://nbviewer.ipython.org/github/hugadams/pyparty/blob/master/examples/Notebooks/shapes.ipynb?create=1)"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%capture CAPTURED\n",
"ts = TIMENOW()\n",
"NB = 'shapes.ipynb'\n",
"run_nb(NB)\n",
"tdiff = TIMENOW() - ts\n",
"'COMPLETED %s: %.2f sec' % (NB, tdiff)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 3,
"text": [
"'COMPLETED shapes.ipynb: 7.46 sec'"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"ERROR: File `u'NBCONFIG.ipynb.py'` not found.\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"[Intro to MultiCanvas](http://nbviewer.ipython.org/github/hugadams/pyparty/blob/master/examples/Notebooks/multi_tutorial.ipynb?create=1)"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%capture CAPTURED\n",
"ts = TIMENOW()\n",
"NB = 'multi_tutorial.ipynb'\n",
"run_nb(NB)\n",
"tdiff = TIMENOW() - ts\n",
"'COMPLETED %s: %.2f sec' % (NB, tdiff)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 4,
"text": [
"'COMPLETED multi_tutorial.ipynb: 32.29 sec'"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"ERROR: File `u'NBCONFIG.ipynb.py'` not found.\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"[Intro to Grids](http://nbviewer.ipython.org/github/hugadams/pyparty/blob/master/examples/Notebooks/grids.ipynb?create=1)"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%capture CAPTURED\n",
"ts = TIMENOW()\n",
"NB = 'grids.ipynb'\n",
"run_nb(NB)\n",
"tdiff = TIMENOW() - ts\n",
"'COMPLETED %s: %.2f sec' % (NB, tdiff)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 5,
"text": [
"'COMPLETED grids.ipynb: 34.17 sec'"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"ERROR: File `u'NBCONFIG.ipynb.py'` not found.\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"[Intro to Labeling](http://nbviewer.ipython.org/github/hugadams/pyparty/blob/master/examples/Notebooks/Analyze_Particles.ipynb?create=1)"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%capture CAPTURED\n",
"ts = TIMENOW()\n",
"NB = 'Analyze_Particles.ipynb'\n",
"run_nb(NB)\n",
"tdiff = TIMENOW() - ts\n",
"'COMPLETED %s: %.2f sec' % (NB, tdiff)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 6,
"text": [
"'COMPLETED Analyze_Particles.ipynb: 117.75 sec'"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"ERROR: File `u'NBCONFIG.ipynb.py'` not found.\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"[Groups of Labels](http://nbviewer.ipython.org/github/hugadams/pyparty/blob/master/examples/Notebooks/groups_of_labels.ipynb?create=1)"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%capture CAPTURED\n",
"ts = TIMENOW()\n",
"NB = 'groups_of_labels.ipynb'\n",
"run_nb(NB)\n",
"tdiff = TIMENOW() - ts\n",
"'COMPLETED %s: %.2f sec' % (NB, tdiff)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 7,
"text": [
"'COMPLETED groups_of_labels.ipynb: 36.82 sec'"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"ERROR: File `u'NBCONFIG.ipynb.py'` not found.\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"[Basic Artificial SEM images and Noise](http://nbviewer.ipython.org/github/hugadams/pyparty/blob/master/examples/Notebooks/making_noise.ipynb?create=1)"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%capture CAPTURED\n",
"ts = TIMENOW()\n",
"NB = 'making_noise.ipynb'\n",
"run_nb(NB)\n",
"tdiff = TIMENOW() - ts\n",
"'COMPLETED %s: %.2f sec' % (NB, tdiff)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 8,
"text": [
"'COMPLETED making_noise.ipynb: 34.62 sec'"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"ERROR: File `u'NBCONFIG.ipynb.py'` not found.\n"
]
}
],
"prompt_number": 8
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"[More Examples for JORS](http://nbviewer.ipython.org/github/hugadams/pyparty/blob/master/examples/Notebooks/JORS_data.ipynb?create=1)"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%capture CAPTURED\n",
"ts = TIMENOW()\n",
"NB = 'JORS_data.ipynb'\n",
"run_nb(NB)\n",
"tdiff = TIMENOW() - ts\n",
"'COMPLETED %s: %.2f sec' % (NB, tdiff)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 9,
"text": [
"'COMPLETED JORS_data.ipynb: 38.03 sec'"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"ERROR: File `u'NBCONFIG.ipynb.py'` not found.\n"
]
}
],
"prompt_number": 9
}
],
"metadata": {}
}
]
}