switching to numpy and failing, a user story

Robert Kern robert.kern at gmail.com
Wed Oct 4 01:57:29 EDT 2006

greg.landrum at gmail.com wrote:
> After using numeric for almost ten years, I decided to attempt to
> switch a large codebase (python and C++) to using numpy. Here's are
> some comments about how that went.
> - The code to automatically switch python stuff over just kind of
> works. But it was a 90% solution, I could do the rest by hand. Of
> course, the problem is that then the code is still using the old
> numeric API, so it's not a long term solution. Unfortunately, to switch
> to the numpy API one needs documentation, which is a problem; see
> below.

Actually, it's not too hard to do so with the files that come with the source 
and utilizing the mailing list. I've converted quite a lot of code without 
reference to _The Guide to NumPy_.

> - Well, ok, the automatic switching code doesn't really work all that
> well... my uses of RandomArray still work, but they generate different
> numbers. The underlying random-number generator must have changed. I'm
> sure that it's "better" now, but it's different. This is a major pain
> for my regression tests that rely on seeding the random number
> generator and getting particular results. But that's ok, I can update
> the regressions for the new RNG.

Sorry, but the old PRNG code had an non-open source license that prohibited 
commercial use, and it had to be replaced.

> - My extension modules just won't build because the new numpy stuff
> lives in a different location from where Numeric used to live. I
> probably could fix this, but without the documentation I can't figure
> out how to do that.

That is documented in the files that come with the source. Or you could have 
asked us on the numpy mailing list. In short, if you use numpy.distutils, 
everything would have been taken care of for you; otherwise, numpy.get_include() 
will give you the location of the headers.

> - I guess I should just buy the documentation. I don't like this idea,
> because I think it's counter-productive to the project to have payware
> docs 

<shrug> Otherwise the docs wouldn't have been written at all. And most likely, 
numpy wouldn't exist, either.

> (would Python be successful if you had to buy the documentation? I
> don't think so), but that's the way this project goes. I'm doubly
> unhappy about it because they payment system is using Paypal and I
> don't like Paypal at all, but I guess that's just the way it goes. Oh,
> wait, I *can't* buy the docs because I'm not in the US and the payment
> page requires a US address. I give up; I guess NumPy is only for people
> living in the US.

Or you could have emailed Travis, and he would have worked around the issue.

I'm sorry that you had such problems, but if you had let us know about them 
earlier, we could have helped you out.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

More information about the Python-list mailing list