Fixes to support numpy 1.25.0#35826
Merged
vbraun merged 1 commit intosagemath:developfrom Jul 1, 2023
Merged
Conversation
Mostly due to a deprecation warning: `Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)`. Also fix: - a change of output in `numpy.linalg.eig()` - a change in an exception class
|
Documentation preview for this PR (built with commit 941ca85; changes) is ready! 🎉 |
Contributor
|
Works for me |
Contributor
|
diff --git a/src/sage/tests/books/computational-mathematics-with-sagemath/graphique_doctest.py
b/src/sage/tests/books/computational-mathematics-with-sagemath/graphique_doctest.py
index aa153fd4cd..eebbe87aff 100644
--- a/src/sage/tests/books/computational-mathematics-with-sagemath/graphique_doctest.py
+++ b/src/sage/tests/books/computational-mathematics-with-sagemath/graphique_doctest.py
@@ -134,11 +134,11 @@ Sage example in ./graphique.tex, line 1120::
sage: t = srange(0, 5, 0.1); p = Graphics()
sage: for k in srange(0, 10, 0.15):
....: y = integrate.odeint(f, k, t)
- ....: p += line(zip(t, flatten(y)))
+ ....: p += line(zip(t, y.flatten()))
sage: t = srange(0, -5, -0.1); q = Graphics()
sage: for k in srange(0, 10, 0.15):
....: y = integrate.odeint(f, k, t)
- ....: q += line(zip(t, flatten(y)))
+ ....: q += line(zip(t, y.flatten()))
sage: y = var('y')
sage: v = plot_vector_field((1, -cos(x*y)), (x,-5,5), (y,-2,11))
sage: g = p + q + v; g.show()Another option would be to explicitly ignore the deprecation warning in the doctest. @tornaria @mkoeppe @antonio-rojas any suggestions? |
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📚 Description
Mostly due to a deprecation warning:
Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.).Also fix:
numpy.linalg.eig()See: #35081
📝 Checklist