Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: dealing with NumPy pre-release test failures #11172

Closed
tylerjereddy opened this issue Dec 4, 2019 · 6 comments
Closed

MAINT: dealing with NumPy pre-release test failures #11172

tylerjereddy opened this issue Dec 4, 2019 · 6 comments
Labels
maintenance Items related to regular maintenance tasks

Comments

@tylerjereddy
Copy link
Contributor

As you can see in Travis CI for recent PRs ( https://travis-ci.org/scipy/scipy/jobs/620455062?utm_medium=notification&utm_source=github_status ) we now get hundreds of test failures related to
NumPy deprecating the automatic creation of object arrays, with:

DeprecationWarning: Creating an ndarray with automatic object dtype is deprecated, use dtype=object if you intended it, otherwise specify an exact dtype

While I was never a fan of the protections that enables vs. the disruption, I suspect we'll need a way to handle this gracefully moving forward. This is also making my life harder for 1.4.0 as noted in #11161.

See also: numpy/numpy#15047

@tylerjereddy tylerjereddy added the maintenance Items related to regular maintenance tasks label Dec 4, 2019
@pv
Copy link
Member

pv commented Dec 4, 2019

For 1.4.0 probably add here https://github.com/scipy/scipy/blob/master/pytest.ini#L4
once:Creating an ndarray with automatic object dtype.*:DeprecationWarning

@rgommers
Copy link
Member

rgommers commented Dec 4, 2019

Already reverted in numpy 1.18.x, and should be temporarily reverted in numpy master as well.

@rgommers
Copy link
Member

rgommers commented Dec 4, 2019

So no need to filter for now, we have some time to investigate and fix up the cases where we didn't expect to see object arrays.

@mattip
Copy link
Contributor

mattip commented Dec 9, 2019

xref gh-11147 which will fix some of the warnings

@QuLogic
Copy link
Contributor

QuLogic commented Jun 23, 2020

These deprecations are back again for NumPy 1.19.

@tylerjereddy
Copy link
Contributor Author

I'm pretty sure this has long since been dealt with. For example, trying to create a jagged array implicitly in our testsuite fails because of NumPy error, so we'd probably detect if any cases were left over at this point:

--- a/scipy/signal/tests/test_ltisys.py
+++ b/scipy/signal/tests/test_ltisys.py
@@ -352,7 +352,7 @@ class TestSS2TF:
         assert_allclose(num, [[0, 1], [2, 3]], rtol=1e-13)
         assert_allclose(den, [1, 6], rtol=1e-13)
 
-        tf = (np.array([[1, -3], [1, 2, 3]], dtype=object), [1, 6, 5])
+        tf = (np.array([[1, -3], [1, 2, 3]]), [1, 6, 5])
         A, B, C, D = tf2ss(*tf)
         assert_allclose(A, [[-6, -5], [1, 0]], rtol=1e-13)
         assert_allclose(B, [[1], [0]], rtol=1e-13)

so, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Items related to regular maintenance tasks
Projects
None yet
Development

No branches or pull requests

5 participants