Polynomial silent breakage with 1.13

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Polynomial silent breakage with 1.13

Matthew Brett
Hi,

Our (nipy's) test suite just failed with the upgrade to numpy 1.13,
and the cause boiled down to this:

```
import numpy as np

poly = np.poly1d([1])
poly.c[0] *= 2
print(poly.c)
```

Numpy 1.12 gives (to me) expected output:

[2]

Numpy 1.13 gives (to me) unexpected output:

[1]

The problem is caused by the fact that the coefficients are now a
*copy* of the actual coefficient array - I think in an attempt to stop
us modifying the coefficients directly.

I can't see any deprecation warnings with `-W always`.

The pain point here is that code that used to give the right answer
has now (I believe silently) switched to giving the wrong answer.

Cheers,

Matthew
_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Polynomial silent breakage with 1.13

Eric Wieser

That’s a regression, and it’s on me, in 8762.

That was a side effect of a fix for the weird behaviour here.

I think we need to fix this in 1.13.2, so we should file an issue about it.

Eric


On Fri, 7 Jul 2017 at 18:31 Matthew Brett <[hidden email]> wrote:
Hi,

Our (nipy's) test suite just failed with the upgrade to numpy 1.13,
and the cause boiled down to this:

```
import numpy as np

poly = np.poly1d([1])
poly.c[0] *= 2
print(poly.c)
```

Numpy 1.12 gives (to me) expected output:

[2]

Numpy 1.13 gives (to me) unexpected output:

[1]

The problem is caused by the fact that the coefficients are now a
*copy* of the actual coefficient array - I think in an attempt to stop
us modifying the coefficients directly.

I can't see any deprecation warnings with `-W always`.

The pain point here is that code that used to give the right answer
has now (I believe silently) switched to giving the wrong answer.

Cheers,

Matthew
_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Polynomial silent breakage with 1.13

Matthew Brett
Hi,

On Fri, Jul 7, 2017 at 6:14 PM, Eric Wieser <[hidden email]> wrote:
> That’s a regression, and it’s on me, in 8762.
>
> That was a side effect of a fix for the weird behaviour here.
>
> I think we need to fix this in 1.13.2, so we should file an issue about it.

Thanks for the feedback.  Do you want to file an issue, or should I?

Cheers,

Matthew
_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Polynomial silent breakage with 1.13

Eric Wieser
I've gone ahead and filed one at https://github.com/numpy/numpy/issues/9385, along with links to relevant PRs.

On Fri, 7 Jul 2017 at 22:28 Matthew Brett <[hidden email]> wrote:
Hi,

On Fri, Jul 7, 2017 at 6:14 PM, Eric Wieser <[hidden email]> wrote:
> That’s a regression, and it’s on me, in 8762.
>
> That was a side effect of a fix for the weird behaviour here.
>
> I think we need to fix this in 1.13.2, so we should file an issue about it.

Thanks for the feedback.  Do you want to file an issue, or should I?

Cheers,

Matthew
_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Loading...