Skip to content

Commit

Permalink
Merge branch 'vbraun' include numpy 2.0 support and raise dependency …
Browse files Browse the repository at this point in the history
…on flint for gcc-14
  • Loading branch information
kiwifb committed Jul 22, 2024
2 parents e40feed + a6efa09 commit 619e87a
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 3 deletions.
52 changes: 52 additions & 0 deletions sci-mathematics/sage-doc/files/numpy-2.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
diff --git a/src/doc/en/faq/faq-usage.rst b/src/doc/en/faq/faq-usage.rst
index 53f225fd729..d03881c36a2 100644
--- a/src/doc/en/faq/faq-usage.rst
+++ b/src/doc/en/faq/faq-usage.rst
@@ -324,7 +324,7 @@ ints. For example::
sage: RealNumber = float; Integer = int
sage: from scipy import stats
sage: stats.ttest_ind([1,2,3,4,5], [2,3,4,5,.6])
- Ttest...Result(statistic=0.0767529..., pvalue=0.940704...)
+ Ttest...Result(statistic=...0.0767529..., pvalue=...0.940704...)
sage: stats.uniform(0,15).ppf([0.5,0.7])
array([ 7.5, 10.5])

diff --git a/src/doc/en/prep/Quickstarts/Statistics-and-Distributions.rst b/src/doc/en/prep/Quickstarts/Statistics-and-Distributions.rst
index b5eb3d842a2..958a378f945 100644
--- a/src/doc/en/prep/Quickstarts/Statistics-and-Distributions.rst
+++ b/src/doc/en/prep/Quickstarts/Statistics-and-Distributions.rst
@@ -24,6 +24,8 @@ NumPy provides, for example, functions to compute the arithmetic mean and
the standard deviation::

sage: import numpy as np
+ sage: if int(np.version.short_version[0]) > 1:
+ ....: np.set_printoptions(legacy="1.25")
sage: np.mean([1, 2, 3, 5])
2.75

diff --git a/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst b/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst
index dbc2de71d42..925e5312882 100644
--- a/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst
+++ b/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst
@@ -7,6 +7,8 @@ import it.
::

sage: import numpy
+ sage: if int(numpy.version.short_version[0]) > 1:
+ ....: numpy.set_printoptions(legacy="1.25") # to ensure numpy 2.0 compatibility

The basic object of computation in NumPy is an array. It is simple to
create an array.
diff --git a/src/doc/it/faq/faq-usage.rst b/src/doc/it/faq/faq-usage.rst
index 37bef7b13c1..5d3183769f7 100644
--- a/src/doc/it/faq/faq-usage.rst
+++ b/src/doc/it/faq/faq-usage.rst
@@ -305,7 +305,7 @@ anziché Integer di Sage. Ad esempio::
sage: RealNumber = float; Integer = int
sage: from scipy import stats
sage: stats.ttest_ind([1,2,3,4,5], [2,3,4,5,.6])
- Ttest...Result(statistic=0.0767529..., pvalue=0.940704...)
+ Ttest...Result(statistic=...0.0767529..., pvalue=...0.940704...)
sage: stats.uniform(0,15).ppf([0.5,0.7])
array([ 7.5, 10.5])

1 change: 1 addition & 0 deletions sci-mathematics/sage-doc/sage-doc-10.4.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ RDEPEND="dev-libs/mathjax"
DEPEND="dev-libs/mathjax"

PATCHES=(
"${FILESDIR}"/numpy-2.0.patch
"${FILESDIR}"/${PN}-10.4-makefile.patch
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ DEPEND="
media-libs/libpng:0=
sci-mathematics/cliquer
sci-mathematics/eclib:=[flint]
sci-mathematics/flint:=[ntl]
>=sci-mathematics/flint-3.1.3:=[ntl]
>=sci-mathematics/gap-4.12.2
>=sci-mathematics/giac-1.9.0
>=sci-mathematics/glpk-5.0:0=[gmp]
Expand Down
2 changes: 1 addition & 1 deletion tools/package.keywords/sage-10.4
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sci-mathematics/cu2
sci-mathematics/cubex
sci-mathematics/dikcube
>sci-mathematics/giac-1.9.0.0
=sci-mathematics/flint-3.0*
=sci-mathematics/flint-3.1*
sci-mathematics/mcube
sci-mathematics/optimal
sci-mathematics/palp
Expand Down
2 changes: 1 addition & 1 deletion tools/package.keywords/sage-9999
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sci-mathematics/cu2
sci-mathematics/cubex
sci-mathematics/dikcube
>sci-mathematics/giac-1.9.0.0
=sci-mathematics/flint-3.0*
>=sci-mathematics/flint-3.1.3
sci-mathematics/mcube
sci-mathematics/optimal
sci-mathematics/palp
Expand Down

0 comments on commit 619e87a

Please sign in to comment.