[Pythonmac-SIG] First Experience, Unix Python vs. MacPython and Science

Chris Barker Chris.Barker@noaa.gov
Thu, 21 Feb 2002 08:36:42 -0800


"Lizardo H. C. M. Nunes" wrote:
> I'm interested about using Python as a
> research tool, specially for number crushing. I hope you can help me
> providing pointers.

Good choice. It's an excellent tool for that kind of thing.
 
> I thought I'd never experience that, but "Unix" Python left a better
> impression.

Don't be surprised. Python is a programming language, and *nix has
always been a fabulous development environment. The Mac was designed to
counter exactly that: with the PC revolution, most users were NOT
developers, so the Mac was designed to provide a comfortable environment
for everyday use by foolks that do not program. IT has always been an
uncomfortable environment for programming. To Use it effectively, and
entire programming enviroment has to be provide, e.g. MPW and
CodeWarrior. MacPython provides the IDE, but it really isn't quite
feature complete. I am far more productive with emacs and the Linux
command line than I am with MacPython.

> I've seen a couple of packages that I'm interested about, specially
> numpy

NumPy is critical for this kind of work, and is a fabulaous package.

>and scipy.

SciPy has some nice stuf, and is getting better and more complete. It
aims ot have everythong MATLAB has and more, but really isn't there yet.
However, it seems a great deal of the scientific programming with Python
community is contributing to it, so I would certainly look there first
for anythong you might need. Also, please contribute anything you might
wroite yourself that would be of general interest.
 
> Did somebody in the list installed scipy? Any hint that you could share
> about dependencies and installations on OSX? Is there a GUI support?

SciPy is using wxPython for it's native GUI stuff, but wxPython is not
yet running on OS-X. It is being worked on, and I expect it will be
available in the next few months. Another good place to contribute, by
the way. In the meantime, SciPy uses PyGnuplot, and I'm not sure if
gnuplot os available on OS-X, but it is on MacOS, so I expect it is
either there or coming.

> Also, I would appreciate if you could suggest other scientific packages
> and address me to essential documentation that could ease the task of
> learning a new programming language.

"Learning Python" is a very nice book (O'Reilly"for getting started, and
of course the NumPy documentation. Also check out "Dive into Python" on
the web. If you are familiar with another array-oriented language
(MATLAB, IDL, maybe even Fortran 95) you will be able to pick it up quickly.

Johann Hibschman wrote:
> Readline is pretty good.

Readline is not just good, it's critical. Command line Python is painful
and almost useless without it, and fun and powerful with it.
> By default, there's not much support for LAPACK.  I'm sure someone has
> it somewhere.  I actually didn't do that much matrix math, just lots of
> elementwise, so I don't have much experience with that.

The LinearAlgebra package is a wrapper aroound some of LAPACK. It is
possible to compile it to use a native BLAS if you have it, but I can't
tell you how, I've never had the need. By the way, if you figure it out,
and you are using a re-distributable LaPack, it would be great to make
your custom compiled version available. NumPy is so much more that a
wrappe around LaPack, because it provides N-dimensional arrays, not just Matrixes.

> of fun using Python to drive C++ computational codes, but I'm not a real
> Fortran guru.

I don't remember if the OP mentioned Fortran, but if you do want to
interface with Fortran codes, check out f2Py for ways to make it easy to
interface Fortran and Python.

Jack Jansen wrote:
> One of the reasons to use MacPython might then be that NumPy is
> bundled with it, so no need to install or build anything to use
> it.

I have never had any problems building o installing NumPy on Linux.
Hopefully, with disutils, it's just as easy on OS-X. Also, if you want
it linked with a Native BLAS, you'll be re-compiling, and that will
probably be much easier with Unix Python.

Good luck, I think you'll like it.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer
                                    		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov