<br><br><div class="gmail_quote">On Sun, Sep 9, 2012 at 1:42 PM, Charles R Harris <span dir="ltr"><<a href="mailto:charlesr.harris@gmail.com" target="_blank">charlesr.harris@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br><div class="gmail_quote"><div><div class="h5">On Sun, Sep 9, 2012 at 11:12 AM, Frédéric Bastien <span dir="ltr"><<a href="mailto:nouiz@nouiz.org" target="_blank">nouiz@nouiz.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi,<br>
<div><div><br>
On Thu, Sep 6, 2012 at 11:32 AM, Charles R Harris<br>
<<a href="mailto:charlesr.harris@gmail.com" target="_blank">charlesr.harris@gmail.com</a>> wrote:<br>
><br>
><br>
> On Thu, Sep 6, 2012 at 10:07 AM, Frédéric Bastien <<a href="mailto:nouiz@nouiz.org" target="_blank">nouiz@nouiz.org</a>> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> I reply with more information probably later today or tomorrow, but I<br>
>> think i need to finish everything to give you the exact information.<br>
>><br>
>> Part of the problem I had was that by default there is a warning that<br>
>> is generated. It tell that to remove this warning we need to set<br>
>> NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION.<br>
><br>
><br>
> You don't want to define this macro if you need to directly access the<br>
> fields. What warning are you getting if you don't define it? Are you using<br>
> Cython?<br>
<br>
</div></div>If I don't define it and I remove the -Werror, I got 3 errors. 1 is<br>
related to an error message that was changed.<br>
<br>
The second was that we called numpy.dot() with 2 sparse matrix(from<br>
scipy). It worked in the past, but not now. Changing the test is easy.<br>
I don't expect people to have done this frequently, but maybe warning<br>
about this in the release note would help people to fix it faster. The<br>
error message is not helpful, it tell that it can't find a common<br>
dtype between float32 and float32 dtype. I changed the np.dot(a,b) to<br>
a*b as this is the matrix multiplication function for sparse matrix in<br>
scipy. This change remove the possibility to make a function that use<br>
matrix product to work with both ndarray and sparse matrix without<br>
special case for the object type. Not great, but there is an easy work<br>
around. So this stay like this in the release, there should be a<br>
warning.<br>
<br>
The third is releated to change to the casting rules in numpy. Before<br>
a scalar complex128 * vector float32 gived a vector of dtype<br>
complex128. Now it give a vector of complex64. The reason is that now<br>
the scalar of different category only change the category, not the<br>
precision. I would consider a must that we warn clearly about this<br>
interface change. Most people won't see it, but people that optimize<br>
there code heavily could depend on such thing.<br>
<br>
The other problem I had was related to the fact that I tryed to use<br>
only the new API. This took me a few day and it is not finished, as<br>
now I have a seg fault that is not easy to trigger. It happen in one<br>
tests, but only when other tests a ran before... This is probably an<br>
error from my change<br>
<br>
The sed script that replace some macro helped, but there is few macro<br>
change that is not in the file: NPY_ALIGNED to NPY_ARRAY_ALIGNED. idem<br>
for NPY_WRITABLE, NPY_UPDATE_ALL, NPY_C_CONTIGUOUS and<br>
NPY_F_CONTIGUOUS.<br></blockquote></div></div><div><br>I can add those, they seem to have been present since at least Numpy 1.5.<br><br></div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<br>
The sed script change NPY_ENSURECOPY to NPY_ARRAY_ENSURECOPY, but I<br>
think that NPY_ARRAY_ENSURECOPY was introduced in numpy 1.7. Maybe<br>
warning somewhere in the API transition doc that if people want to<br>
stay compatible with older version of numpy, the should use an<br>
"#ifndef NPY_ARRAY_ENSURECOPY ..." in there code.<br></blockquote></div><div><br>Hmm... Looks like you are right about NPY_ARRAY_ENSURECOPY. An alternative would be to not deprecate it, but an #ifndef would be better for the long term goal of having everyone use newer macros.<br>

  <br></div></div></blockquote><div><br>And the other *_ARRAY_* macros seem to have been defined in 1.5. If 1.7 is intended to be a long term release, they probably shouldn't be deprecated until a later release.<br> <br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div></div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
I won't have the time to make a PR with those small change as I have a<br>
deadline the 16 september and the 1 october. I hope my comment will be<br>
helpful. If you still have questions, don't hesitate.<br>
<br></blockquote></div><div><br></div></div></blockquote><div><br>Chuck <br></div></div>