[Numpy-discussion] Handling of backward compatibility
Travis Oliphant
oliphant at ee.byu.edu
Tue Aug 1 20:21:49 EDT 2006
Torgil Svensson wrote:
>>They are supposed to have different defaults because the functional
>>forms are largely for backward compatibility where axis=0 was the default.
>>
>>-Travis
>>
>>
>
>Isn't backwards compatibility what "oldnumeric" is for?
>
>
>
As this discussion indicates there has been a switch from numpy 0.9.8 to
numpy 1.0b of how to handle backward compatibility. Instead of
importing old names a new sub-package numpy.oldnumeric was created.
This mechanism is incomplete in the sense that there are still some
backward-compatible items in numpy such as defaults on the axis keyword
for functions versus methods and you still have to make the changes that
convertcode.py makes to the code to get it to work.
I'm wondering about whether or not some additional effort should be
placed in numpy.oldnumeric so that replacing Numeric with
numpy.oldnumeric actually gives no compatibility issues (i.e. the only
thing you have to change is replace imports with new names). In
other words a simple array sub-class could be created that mimics the
old Numeric array and the old functions could be created as well with
the same arguments.
The very same thing could be done with numarray. This would make
conversion almost trivial.
Then, the convertcode script could be improved to make all the changes
that would take a oldnumeric-based module to a more modern numpy-based
module. A similar numarray script could be developed as well.
What do people think? Is it worth it? This could be a coding-sprint
effort at SciPy.
-Travis
More information about the NumPy-Discussion
mailing list