ivanov / ipython-trainingwheels

A beginner student friendly profile for IPython notebook
4 stars 2 forks source link

What goes in the "standard imports" imports? #13

Open ivanov opened 10 years ago

ivanov commented 10 years ago

right now it's os, sys, numpy as np, and matplotlib.pyplot as plt - are there others? take out os and sys?

ChristinaLK commented 10 years ago

I haven't used a lot of os, but I have done sys. How common is glob?

riordan commented 10 years ago

Love them all. And yes, those should be standard imports. That said, numpy and matplotlib require pipping. Would it make sense to add an instruction set on what packages to install as additional requirements?

justbennet commented 10 years ago

I would second importing glob, perhaps more specifically even, glob.glob as glob. If this is to benefit Software Carpentry (SC), that will be a useful import to tie file globbing in the shell portion of a bootcamp to any file operations that are used in basic python sections. At some point, I think everyone wants the equivalent of the shell's

for i in *.dat ; do
    good works on $i
done

I do file operations early because everyone has to read data or write output, and I use things like this

if os.path.isdir(dataDir):
    pass
else:
    print "No data directory %s", dataDir
    sys.exit(9)

and

sys.path.append('/home/bennet/abbot')

as examples (perhaps not good ones, but my intentions are honorable).

In looking back at the last workshop I did, the other modules I imported so I could show slightly more realistic examples in a basic workshop were time, datetime from datetime, urllib, and pandas. They all have straightforward uses in simple problems, and they get students used to thinking there might be a library that does 'blah'.

I am a bit ambivalent about pandas, but I could count on it being there because the workshop was in a lab with a known installation and list of libraries. I used it more as a tickler for what could be done rather than for doing much with it in class.

If people are getting either of the two big 'distributions' in their free versions, perhaps the intersection of the list of included libraries included in those, plus whatever is the next biggest player in the Windows market could be a good guide for what is reasonable to expect students to have installed? An easy way to meet that criterion is available for download.

ivanov commented 10 years ago

thanks for your thoughts @ChristinaLK, @riordan, and @justbennet. I was thinking of this as user interface helper in the bootcamp - we'll assume the that installation story has been solved pre-bootcamp by either having the attendees install one of the python distributions or loading a virtual machine with all of the scientific python stack.

There will be a tension between which things it makes sense to include in a "one click" feature like this, since some things just aren't hard to type, whereas others aren't universally used... One thought would be to punt on this and make the training wheels be the sort of thing that instructors can customize for each bootcamp, for example.

ivanov commented 10 years ago

@BernhardKonrad also suggested: "we could also have a "basic" and an "advanced" (with things like pandas, datetime, etc)"

willingc commented 10 years ago

I think pandas would be valuable to include for library science or any data science stuff. It's useful for importing csv or text files of data.