Adding software engineering example files and notebook to the repository.
[swc-testing-nose.git] / 4-SoftwareEngineering / SoftwareEngineering.ipynb
1 {
2  "metadata": {
3   "name": "SoftwareEngineering"
4  }, 
5  "nbformat": 2, 
6  "worksheets": [
7   {
8    "cells": [
9     {
10      "cell_type": "code", 
11      "collapsed": true, 
12      "input": [
13       "import glob"
14      ], 
15      "language": "python", 
16      "outputs": [], 
17      "prompt_number": 1
18     }, 
19     {
20      "cell_type": "code", 
21      "collapsed": false, 
22      "input": [
23       "glob.glob('*.txt')"
24      ], 
25      "language": "python", 
26      "outputs": [
27       {
28        "output_type": "pyout", 
29        "prompt_number": 2, 
30        "text": [
31         "['fergus_animals.txt',", 
32         " 'big_animals.txt',", 
33         " 'dingwall_animals.txt',", 
34         " 'animals.txt',", 
35         " 'macguffin_animals.txt',", 
36         " 'merida_animals.txt']"
37        ]
38       }
39      ], 
40      "prompt_number": 2
41     }, 
42     {
43      "cell_type": "code", 
44      "collapsed": false, 
45      "input": [
46       "pwd"
47      ], 
48      "language": "python", 
49      "outputs": [
50       {
51        "output_type": "pyout", 
52        "prompt_number": 3, 
53        "text": [
54         "u'/home/swc/SWC-bootcamp/4-SoftwareEngineering'"
55        ]
56       }
57      ], 
58      "prompt_number": 3
59     }, 
60     {
61      "cell_type": "code", 
62      "collapsed": false, 
63      "input": [
64       "ls"
65      ], 
66      "language": "python", 
67      "outputs": [
68       {
69        "output_type": "stream", 
70        "stream": "stdout", 
71        "text": [
72         "animals.txt      demo.py               \u001b[0m\u001b[01;34mDocumentation\u001b[0m/         merida_animals.txt  Untitled0.ipynb", 
73         "big_animals.txt  dev_notes.rst         fergus_animals.txt     README.rst", 
74         "\u001b[01;34mDebugging\u001b[0m/       dingwall_animals.txt  macguffin_animals.txt  \u001b[01;34mTesting\u001b[0m/"
75        ]
76       }
77      ], 
78      "prompt_number": 4
79     }, 
80     {
81      "cell_type": "code", 
82      "collapsed": true, 
83      "input": [
84       "import demo"
85      ], 
86      "language": "python", 
87      "outputs": [], 
88      "prompt_number": 5
89     }, 
90     {
91      "cell_type": "code", 
92      "collapsed": false, 
93      "input": [
94       "demo.square(5.5)"
95      ], 
96      "language": "python", 
97      "outputs": [
98       {
99        "output_type": "pyout", 
100        "prompt_number": 7, 
101        "text": [
102         "30.25"
103        ]
104       }
105      ], 
106      "prompt_number": 7
107     }, 
108     {
109      "cell_type": "code", 
110      "collapsed": false, 
111      "input": [
112       "ls"
113      ], 
114      "language": "python", 
115      "outputs": [
116       {
117        "output_type": "stream", 
118        "stream": "stdout", 
119        "text": [
120         "animals.py       \u001b[0m\u001b[01;34mDebugging\u001b[0m/  dev_notes.rst         fergus_animals.txt     README.rst", 
121         "animals.txt      demo.py     dingwall_animals.txt  macguffin_animals.txt  \u001b[01;34mTesting\u001b[0m/", 
122         "big_animals.txt  demo.pyc    \u001b[01;34mDocumentation\u001b[0m/        merida_animals.txt     Untitled0.ipynb"
123        ]
124       }
125      ], 
126      "prompt_number": 8
127     }, 
128     {
129      "cell_type": "code", 
130      "collapsed": true, 
131      "input": [
132       "import animals"
133      ], 
134      "language": "python", 
135      "outputs": [], 
136      "prompt_number": 9
137     }, 
138     {
139      "cell_type": "code", 
140      "collapsed": false, 
141      "input": [
142       "animals.read_animals('animals.txt')"
143      ], 
144      "language": "python", 
145      "outputs": [
146       {
147        "output_type": "pyout", 
148        "prompt_number": 10, 
149        "text": [
150         "(['2011-04-22', '2011-04-23', '2011-04-23', '2011-04-23', '2011-04-23'],", 
151         " ['21:06', '14:12', '10:24', '20:08', '18:46'],", 
152         " ['Grizzly', 'Elk', 'Elk', 'Wolverine', 'Muskox'],", 
153         " [36, 25, 26, 31, 20])"
154        ]
155       }
156      ], 
157      "prompt_number": 10
158     }, 
159     {
160      "cell_type": "code", 
161      "collapsed": false, 
162      "input": [
163       "[1, 2, 3] != [2, 1, 3]"
164      ], 
165      "language": "python", 
166      "outputs": [
167       {
168        "output_type": "pyout", 
169        "prompt_number": 14, 
170        "text": [
171         "True"
172        ]
173       }
174      ], 
175      "prompt_number": 14
176     }, 
177     {
178      "cell_type": "code", 
179      "collapsed": false, 
180      "input": [
181       "raise ValueError(\"Encountered negative number in Kelvin function.\")"
182      ], 
183      "language": "python", 
184      "outputs": [
185       {
186        "ename": "ValueError", 
187        "evalue": "Encountered negative number in Kelvin function.", 
188        "output_type": "pyerr", 
189        "traceback": [
190         "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)", 
191         "\u001b[0;32m/home/swc/SWC-bootcamp/4-SoftwareEngineering/<ipython-input-15-5aa188293e94>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Encountered negative number in Kelvin function.\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", 
192         "\u001b[0;31mValueError\u001b[0m: Encountered negative number in Kelvin function."
193        ]
194       }
195      ], 
196      "prompt_number": 15
197     }, 
198     {
199      "cell_type": "code", 
200      "collapsed": true, 
201      "input": [], 
202      "language": "python", 
203      "outputs": [], 
204      "prompt_number": 11
205     }, 
206     {
207      "cell_type": "code", 
208      "collapsed": true, 
209      "input": [], 
210      "language": "python", 
211      "outputs": [], 
212      "prompt_number": 11
213     }, 
214     {
215      "cell_type": "code", 
216      "collapsed": true, 
217      "input": [], 
218      "language": "python", 
219      "outputs": [], 
220      "prompt_number": 11
221     }, 
222     {
223      "cell_type": "code", 
224      "collapsed": true, 
225      "input": [], 
226      "language": "python", 
227      "outputs": [], 
228      "prompt_number": 11
229     }, 
230     {
231      "cell_type": "code", 
232      "collapsed": true, 
233      "input": [], 
234      "language": "python", 
235      "outputs": [], 
236      "prompt_number": 11
237     }, 
238     {
239      "cell_type": "code", 
240      "collapsed": true, 
241      "input": [], 
242      "language": "python", 
243      "outputs": [], 
244      "prompt_number": 11
245     }, 
246     {
247      "cell_type": "code", 
248      "collapsed": true, 
249      "input": [], 
250      "language": "python", 
251      "outputs": [], 
252      "prompt_number": 11
253     }, 
254     {
255      "cell_type": "code", 
256      "collapsed": true, 
257      "input": [], 
258      "language": "python", 
259      "outputs": [], 
260      "prompt_number": 11
261     }, 
262     {
263      "cell_type": "code", 
264      "collapsed": true, 
265      "input": [], 
266      "language": "python", 
267      "outputs": [], 
268      "prompt_number": 11
269     }, 
270     {
271      "cell_type": "code", 
272      "collapsed": true, 
273      "input": [], 
274      "language": "python", 
275      "outputs": [], 
276      "prompt_number": 11
277     }, 
278     {
279      "cell_type": "code", 
280      "collapsed": true, 
281      "input": [], 
282      "language": "python", 
283      "outputs": [], 
284      "prompt_number": 11
285     }, 
286     {
287      "cell_type": "code", 
288      "collapsed": true, 
289      "input": [], 
290      "language": "python", 
291      "outputs": [], 
292      "prompt_number": 11
293     }, 
294     {
295      "cell_type": "code", 
296      "collapsed": true, 
297      "input": [], 
298      "language": "python", 
299      "outputs": [], 
300      "prompt_number": 11
301     }, 
302     {
303      "cell_type": "code", 
304      "collapsed": true, 
305      "input": [], 
306      "language": "python", 
307      "outputs": [], 
308      "prompt_number": 11
309     }, 
310     {
311      "cell_type": "code", 
312      "collapsed": true, 
313      "input": [], 
314      "language": "python", 
315      "outputs": [], 
316      "prompt_number": 11
317     }, 
318     {
319      "cell_type": "code", 
320      "collapsed": true, 
321      "input": [], 
322      "language": "python", 
323      "outputs": [], 
324      "prompt_number": 11
325     }, 
326     {
327      "cell_type": "code", 
328      "collapsed": true, 
329      "input": [], 
330      "language": "python", 
331      "outputs": [], 
332      "prompt_number": 11
333     }, 
334     {
335      "cell_type": "code", 
336      "collapsed": true, 
337      "input": [], 
338      "language": "python", 
339      "outputs": [], 
340      "prompt_number": 11
341     }, 
342     {
343      "cell_type": "code", 
344      "collapsed": true, 
345      "input": [], 
346      "language": "python", 
347      "outputs": [], 
348      "prompt_number": 11
349     }, 
350     {
351      "cell_type": "code", 
352      "collapsed": true, 
353      "input": [], 
354      "language": "python", 
355      "outputs": [], 
356      "prompt_number": 11
357     }, 
358     {
359      "cell_type": "code", 
360      "collapsed": true, 
361      "input": [], 
362      "language": "python", 
363      "outputs": [], 
364      "prompt_number": 11
365     }, 
366     {
367      "cell_type": "code", 
368      "collapsed": true, 
369      "input": [], 
370      "language": "python", 
371      "outputs": [], 
372      "prompt_number": 11
373     }, 
374     {
375      "cell_type": "code", 
376      "collapsed": true, 
377      "input": [], 
378      "language": "python", 
379      "outputs": [], 
380      "prompt_number": 11
381     }, 
382     {
383      "cell_type": "code", 
384      "collapsed": true, 
385      "input": [], 
386      "language": "python", 
387      "outputs": [], 
388      "prompt_number": 11
389     }, 
390     {
391      "cell_type": "code", 
392      "collapsed": true, 
393      "input": [], 
394      "language": "python", 
395      "outputs": [], 
396      "prompt_number": 11
397     }, 
398     {
399      "cell_type": "code", 
400      "collapsed": true, 
401      "input": [], 
402      "language": "python", 
403      "outputs": [], 
404      "prompt_number": 11
405     }, 
406     {
407      "cell_type": "code", 
408      "collapsed": true, 
409      "input": [], 
410      "language": "python", 
411      "outputs": [], 
412      "prompt_number": 11
413     }, 
414     {
415      "cell_type": "code", 
416      "collapsed": true, 
417      "input": [], 
418      "language": "python", 
419      "outputs": [], 
420      "prompt_number": 11
421     }, 
422     {
423      "cell_type": "code", 
424      "collapsed": true, 
425      "input": [], 
426      "language": "python", 
427      "outputs": [], 
428      "prompt_number": 11
429     }, 
430     {
431      "cell_type": "code", 
432      "collapsed": true, 
433      "input": [], 
434      "language": "python", 
435      "outputs": [], 
436      "prompt_number": 11
437     }, 
438     {
439      "cell_type": "code", 
440      "collapsed": true, 
441      "input": [], 
442      "language": "python", 
443      "outputs": [], 
444      "prompt_number": 11
445     }, 
446     {
447      "cell_type": "code", 
448      "collapsed": true, 
449      "input": [], 
450      "language": "python", 
451      "outputs": [], 
452      "prompt_number": 11
453     }, 
454     {
455      "cell_type": "code", 
456      "collapsed": true, 
457      "input": [], 
458      "language": "python", 
459      "outputs": [], 
460      "prompt_number": 11
461     }, 
462     {
463      "cell_type": "code", 
464      "collapsed": true, 
465      "input": [], 
466      "language": "python", 
467      "outputs": [], 
468      "prompt_number": 11
469     }, 
470     {
471      "cell_type": "code", 
472      "collapsed": true, 
473      "input": [], 
474      "language": "python", 
475      "outputs": []
476     }
477    ]
478   }
479  ]
480 }