From d3bcf0219b92c2cfdd19239d2bf75de4ff26e579 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Sun, 17 Jun 2012 14:00:40 -0400 Subject: [PATCH] Split SoftwareEngineering notes into a README for the students and a notes file for the presenters. Added Exercises notebook for Intro lesson. W. Trevor King: I dropped everything from the original 2992452 except for the 4-SoftwareEngineering modifications. I also reformatted the original commit message so it fits better into --oneline logs. Conflicts: 2-PythonIntro/README.rst --- 4-SoftwareEngineering/README.rst | 32 ++++++++++------------------- 4-SoftwareEngineering/dev_notes.rst | 32 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 21 deletions(-) create mode 100644 4-SoftwareEngineering/dev_notes.rst diff --git a/4-SoftwareEngineering/README.rst b/4-SoftwareEngineering/README.rst index fa04005..0bcf4f2 100644 --- a/4-SoftwareEngineering/README.rst +++ b/4-SoftwareEngineering/README.rst @@ -1,24 +1,14 @@ -Dev Notes -========= +==================================== +Building a Library of Code you Trust +==================================== -Things we want to demonstrate: +Suppose we're going to be dealing a lot with these animal count files, +and doing many different kinds of analysis with them. In the introduction +to Python lesson we wrote a function that reads these files but it's stuck +off in an IPython notebook. We could copy and paste it into a new notebook +every time we want to use it but that gets tedious and makes it difficult to +add features to the function. The ideal solution would be to keep the +function in one spot and use it over and over again from many different places. +Python modules to the rescue! -- write lots of small tools (functions) -- document your code -- test your code -- debugging - - build in a crash somewhere and explain tracebacks - - do an import pdb; pdb.set_trace() - -Create a few utilities to work with the `*animal.txt` files from -introductory Python. - -Put all the functionality in one file and make small scripts that import -from that file, parse command line arguments, and do stuff. - -- average number of an animal seen per sighting -- total number of an animal seen over the season -- all the sightings on a given day - -Students may want an IPython notebook open as a scratch pad. diff --git a/4-SoftwareEngineering/dev_notes.rst b/4-SoftwareEngineering/dev_notes.rst new file mode 100644 index 0000000..dc61910 --- /dev/null +++ b/4-SoftwareEngineering/dev_notes.rst @@ -0,0 +1,32 @@ +Dev Notes +========= + +Things we want to demonstrate: + +- write lots of small tools (functions) +- document your code +- test your code, including TDD +- debugging + + - build in a crash somewhere and explain tracebacks + - do an import pdb; pdb.set_trace() + +Create a few utilities to work with the `*animal.txt` files from +introductory Python. + +Put all the functionality in one file and make small scripts that import +from that file, parse command line arguments, and do stuff. + +- average number of an animal seen per sighting +- total number of an animal seen over the season +- all the sightings on a given day + +Students may want an IPython notebook open as a scratch pad. + +Lesson Plan +----------- + +1. Demonstrate putting code in a `.py` file and running it. +2. Demonstrate importing a module (maybe `math` or `glob`) + +Exercise: -- 2.26.2