[Numpy-discussion] Typecasting changes from 1.5.1 to 1.6.1
Travis Oliphant
travis@continuum...
Tue Feb 14 01:46:16 CST 2012
Here is the code I used to determine the coercion table of types. I first used *all* of the numeric_ops, narrowed it down to those with 2 inputs and 1 output, and then determined the run-time coercion table. Then, I removed ops that had the same tables until I was left with binary ops that had different coercion tables.
Some operations were NotImplemented and I used 'X' in the table for those combinations.
The table for each op is a dictionary with keys given by (type1, type2) and values given by a length-4 list of the types of the result between: [scalar-scalar, scalar-array, array-scalar, array-array] where the first term is type1 and the second term is type2.
This resulting dictionary of tables for each op is then saved to a file. I ran this code for NumPy 1.5.1 64-bit and then again for NumPy 1.6.1 64-bit. I also ran this code for NumPy 1.4.1 64-bit and NumPy 1.3.1.dev 64-bit.
The code to compare them is also attached. I'm attaching also the changes that have occurred between 1.3.1.dev and 1.4.1, 1.4.1 to 1.5.1, and finally 1.5.1 to 1.6.1
As you can see there were changes in each release. Most of these were minor prior to the change from 1.5.1 to 1.6.1. I am still reviewing the changes from 1.5.1 to 1.6.1. At first blush, it looks like there are a lot of changes to swallow that are not necessarily minor. I really would like to just say all is well, and it's no big deal. I hope that users really don't care and nobody's code is really relying on array-scalar combination conversions.
-Travis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: coercion_test.py
Type: text/x-python-script
Size: 1864 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120214/f3f6e994/attachment-0002.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: coercion_compare.py
Type: text/x-python-script
Size: 1026 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120214/f3f6e994/attachment-0003.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.3.1.dev_to_1.4.1
Type: application/octet-stream
Size: 19026 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120214/f3f6e994/attachment-0003.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.4.1_to_1.5.1
Type: application/octet-stream
Size: 3246 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120214/f3f6e994/attachment-0004.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.5.1_to_1.6.1
Type: application/octet-stream
Size: 35266 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120214/f3f6e994/attachment-0005.obj
-------------- next part --------------
More information about the NumPy-Discussion
mailing list