[Numpy-discussion] matlab vs. python question

Bill Baxter wbaxter at gmail.com
Sat May 5 01:44:02 EDT 2007


On 4/29/07, Benjamin Thyreau <benjamin at decideur.info> wrote:
> Le Samedi 28 Avril 2007 20:03, Simon Berube a écrit:
> > (...)
> >  On the other hand, if you are more interested in small
> > projects where speed of development is more important than long term
> > sustainability of the code Matlab is probably better. This is usually
> > the case in research environment, at least until you figure out
> > exactly what you want to do, then switch to python.
> >
> > I hope this help,  (...)
>
> I guess the point of the question was, in what way should numpy/scipy be
> improved in order to get the same usability at those cases, according to
> you ? It's not as obvious as you make it sound, and there also are for sure
> some advantages in the ipython/scipy stack over matlab's prompt,
> usability-wise. Any experiences which helps in improving it is thus useful

I like ipython's post-fix ? help.  I was back in Matlab a couple of
days ago and that's one of the few things I missed about my Numpy
setup.  I often find I'm typing a command and then I realize I don't
recall what the arguments are so then I can just type one extra '?' to
get the help.

Of course even better would be if ipython were in a GUI, and
docstrings could just be proactively prefectched and displayed in
another pane while I type, or argument lists could be popped up like
in PyCrust.

Sadly, other than that I can't think of a whole lot about the numpy
environment that I like better than the Matlab environment. (just
talking about the environment here -- not the language).   Matlab's
debugger is very nicely integrated with the prompt, and plots just
work, always, and are fast without having to think about ion/ioff
stuff or show().  Never need any prayers to the god of GUI event loops
to keep plots from freezing things up with Matlab.  It's also
refreshing to just be able to type "zeros" and "rand" and not have to
worry about namespace prefixes.  On the other hand I think I yelled a
profanity out loud when Matlab gave me the "can't define functions in
a script" error.  I'd completely forgotten that particular bit of
Matlab stupidity.

There are probably ways to make the numpy environment more like the
above.  But there needs to be a 'button' that sets everything up like
that or most people just won't find it.  For instance maybe ipython
could install a "Numpy Interactive" link that uses the -pylab flag and
also pulls the numpy namespace into the global one.  For debugger
integration, is there any way to set up ipython so that on errors it
will pop up a GUI debugger that shows the line of source code where
the error occured and let you set break points?

--bb



More information about the NumPy-Discussion mailing list