Hi folks, It is turning out to be much more of a headache moving from numpy-0.9.x to numpy-1.0b1 than it ever was moving from Numeric to numpy. Could someone please throw together some release notes (the scipy & sourceforge RN pages are blank) or a Wiki page warning what has to be changed? Here are some stumbling blocks I've come across: * Type names are all now lower case. I know this started happening late in 0.9.x, but I only know it by accident, via some email from Travis. This is just one example of the kind of change that really needs to be prominently noted somewhere. * .nonzero() now returns a 1-tuple with an array of indices, for a 1-d array. Before it returned an array of indices. * In the C API, ContiguousFromObject is now ContiguousFromAny. I am surprised that my libraries compile with no errors; I only get a runtime error. Shouldn't I be warned about this at compile-time? * mtrand still uses ContiguousFromObject in a few places; these give exceptions when you call, e.g., setstate. * rand, fft, ift are no longer in the numpy namespace. Is this a permanent change or a bug? There are probably other obstacles I'll come across, but this is what I encountered in code that ran perfectly with 0.9.6. After several hours of work it's still not running. -Tom Loredo ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/
Tom Loredo wrote:
Hi folks,
It is turning out to be much more of a headache moving from numpy-0.9.x to numpy-1.0b1 than it ever was moving from Numeric to numpy. Could someone please throw together some release notes (the scipy & sourceforge RN pages are blank) or a Wiki page warning what has to be changed? Release Notes are forthcoming. But, probably won't be available for awhile.
The "problem" is that backward compatibility is not accomplished simply by using import numpy instead of import Numeric. You have to use import numpy.oldnumeric to get it.
* Type names are all now lower case. I know this started happening late in 0.9.x, but I only know it by accident, via some email from Travis.
Use numpy.oldnumeric where the upper-case typenames are all available.
* .nonzero() now returns a 1-tuple with an array of indices, for a 1-d array. Before it returned an array of indices.
Use the nonzero function which has the same behavior as Numeric.
* In the C API, ContiguousFromObject is now ContiguousFromAny. I am surprised that my libraries compile with no errors; I only get a runtime error. Shouldn't I be warned about this at compile-time?
I'm not sure what the problem you are getting is. Please give your runtime error. This should work. ContiguousFromObject is still available.
* mtrand still uses ContiguousFromObject in a few places; these give exceptions when you call, e.g., setstate.
Please post the error, it's a bug.
* rand, fft, ift are no longer in the numpy namespace. Is this a permanent change or a bug?
Yep, permanent change after long discussion. Get them from numpy.random and numpy.dft respectively. I agree that moving from numpy <1.0 to numpy 1.0 is a little painful because of name-space issues. That's why numpy was labeled pre 1.0. I was assuming adopters were willing to move with us until NumPy 1.0 where backward compatibility would be made an important issue. These issues could not have been sorted out without the users who adopted it early. Name-space issues are the biggest ones. Rather than put all backward compatibility in the bloated numpy namespace we moved some of it. This will be discussed in the Release Notes, but honestly Release Notes take me the longest time to put together and I just haven't had the time. The early adopters deserve a lot of praise because it is harder (you have to manually alter some import statements and watch your usage of .nonzero) to move from numpy 0.9.2 to numpy 1.0 than it is to move from Numeric to NumPy. It was felt that it is better to bite the bullet this one time than to have regrets once NumPy 1.0 is out and backward compatibility is paramount. -Travis
Hi Travis et al.-
Release Notes are forthcoming. But, probably won't be available for awhile.
Thanks for the alert, and for the subsequent clarifications.
The "problem" is that backward compatibility is not accomplished simply by using import numpy instead of import Numeric. You have to use import numpy.oldnumeric to get it.
My problem is not with backward incompatibility. I am quite satisfied that all the changes are sensible, and I've tried to keep pace with them. I do skim the various digests fairly regularly. When I see an issue discussed and resolved, it is clear to me that the decisions are being made by better heads than mine. I'm +1 on all the changes, and grateful to all the developers who are thinking this stuff through so carefully. My problem is with wanting to keep up with at least most of the changes. I want to use numpy, not numpy.oldnumeric. I have a 10k+ line codebase I'm maintaining (with another 10k+ of wrapped Fortran and C) that I want to release when numpy-1.0 settles down. But there's nowhere I can go to find out what the changes are. My digest skimming is not turning up all of them. I have recent copies of the Guide (I'm not sure if these are regularly emailed out or if I always have to ask for an update), and though I find some of the changes when I stumble upon them, even in the Guide there is no section of "recent changes" or something like that. To find the changes, you just have to remember the old way and catch the new way. So now we have a "beta" out, but who are the beta testers supposed to be? Just the developers, who know about all the changes already? I'm not a numpy novice, but I'm stumbling with this beta more than I'm used to with betas, not because it's buggy, but simply because I don't know what's changing from release to release. I was tempted to start a Wiki page about it, but this discussion already reveals I'm not the one to do it, as some of what I thought I figured out about the changes turns out to be in error.
I was assuming adopters were willing to move with us until NumPy 1.0 where backward compatibility would be made an important issue.
I have been trying to move along with the changes (I had to roll back the last micro version or two of 0.9 because mpl wasn't keeping pace across my two main platforms). But without something like release notes or a "what's changed" page, it's sometimes been hard to move with you, and it's esp. hard with the 1.0 jump.
* In the C API, ContiguousFromObject is now ContiguousFromAny. I am surprised that my libraries compile with no errors; I only get a runtime error. Shouldn't I be warned about this at compile-time?
I'm not sure what the problem you are getting is. Please give your runtime error. This should work. ContiguousFromObject is still available.
Okay, I'm at home now on my Mac and it all works fine here. The failures were on FC3 linux. I'll have to undo my patches to mtrand to get the bugs back. More when I'm back at that machine. -Tom ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/
participants (2)
-
Tom Loredo -
Travis Oliphant