[Numpy-discussion] Making NumPy accessible to everyone (or no-one) (was Numpy-discussion Digest, Vol 19, Issue 44)

Christopher Burns cburns at berkeley.edu
Fri Apr 11 04:57:31 EDT 2008


On Thu, Apr 10, 2008 at 3:55 AM, Stéfan van der Walt <stefan at sun.ac.za>
wrote:

> Hi Joe, all
>
> On 10/04/2008, Joe Harrington <jh at physics.ucf.edu> wrote:
> > > Absolutely.  Let's please standardize on:
> >  > import numpy as np
> >  > import scipy as sp
> >
> >  I hope we do NOT standardize on these abbreviations.  While a few may
> >  have discussed it at a sprint, it hasn't seen broad discussion


Valid point... Travis did a wonderful job of summarizing that sprint and
posting to the list.  However, the N vs. np discussion was missed.

http://projects.scipy.org/pipermail/scipy-dev/2007-December/008078.html


> Namespaces throttle the amount of information with which the user is
> presented, and well thought through design leads to logical, intuitive
> segmentation of functionality.
>
> >  Namespaces add characters to code that have a high redundancy factor.
> >  This means they pollute code, make it slow and inaccurate to read, and
> >  making learning harder.  Lines get longer and may wrap if they contain
> >  several calls.  It is harder while visually scanning code to
> >  distinguish the function name if it's adjacent to a bunch of other
> >  text, particularly if that text appears commonly in the nearby code.


I think namespaces are one of the crown-jewels that make python more
attractive to scientists (not programmers) over Matlab.  Even if they don't
realize it yet.  :)

I think a lot of researchers would spend less time debugging their code if
they were using python with namespaces instead of adding this:

addpath(genpath('mydirectory'))

in all of their Matlab code!  Or other path manipulation.

We certainly need a better discover mechanism for users to find functions
however.

-- 
Christopher Burns
Computational Infrastructure for Research Labs
10 Giannini Hall, UC Berkeley
phone: 510.643.4014
http://cirl.berkeley.edu/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080411/512e7d30/attachment.html>


More information about the NumPy-Discussion mailing list