Skip to content

Commit 686e933

Browse files
author
Release Manager
committed
gh-37484: Support flint 3.1 in sagelib
Drop uses of deprecated API - `fmpq_get_mpz_frac/fmpq_init_set_mpz_frac_readonly`, replace by verbatim code from the removed functions - `arb_version` was only used by the obsolete `arb216` and `arb218` doctest tags, remove it URL: #37484 Reported by: Antonio Rojas Reviewer(s): Dima Pasechnik, Gonzalo Tornaría, Marc Mezzarobba
2 parents 344b06d + 6e904cf commit 686e933

File tree

12 files changed

+14
-64
lines changed

12 files changed

+14
-64
lines changed

build/pkgs/configure/checksums.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=a3fc8c3bf9198d28a8f2d5a08cffdcf519150b77
3-
md5=32f4f1763765232dc7e7431d5e48e129
4-
cksum=708121316
2+
sha1=ebe07f8b9c90595aae4f92d51ad510bc533f3a37
3+
md5=032461abc5cf4561d30156cafb8afae0
4+
cksum=3521715274
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0fb793fa91a0b46de452036b521cbbaeee878340
1+
c25d6e998d4a3b23a1b13ae9e47d6fec59cea382

src/.relint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@
7171
magic doctest comments should appear on the "sage:" line, not "....:" lines
7272
# see optional_regex in src/sage/doctest/parsing.py
7373
# "indirect doctest" is from src/bin/sage-coverage
74-
pattern: '^[ ]*[.][.][.][.]:.*#.*(arb216|arb218|py2|py3|long time|not implemented|not tested|known bug|optional|indirect doctest)'
74+
pattern: '^[ ]*[.][.][.][.]:.*#.*(py2|py3|long time|not implemented|not tested|known bug|optional|indirect doctest)'

src/sage/doctest/control.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,6 @@
5858

5959
auto_optional_tags = set()
6060

61-
try:
62-
from sage.libs.arb.arb_version import version as arb_vers
63-
arb_tag = 'arb2' + arb_vers().split('.')[1]
64-
auto_optional_tags.add(arb_tag)
65-
except ImportError:
66-
pass
67-
68-
6961
class DocTestDefaults(SageObject):
7062
"""
7163
This class is used for doctesting the Sage doctest module.

src/sage/doctest/parsing.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def fake_RIFtol(*args):
9595
ansi_escape_sequence = re.compile(r"(\x1b[@-Z\\-~]|\x1b\[.*?[@-~]|\x9b.*?[@-~])")
9696

9797
special_optional_regex = (
98-
"arb216|arb218|py2|long time|not implemented|not tested|optional|needs|known bug"
98+
"py2|long time|not implemented|not tested|optional|needs|known bug"
9999
)
100100
tag_with_explanation_regex = r"((?:\w|[.])*)\s*(?:\((?P<cmd_explanation>.*?)\))?"
101101
optional_regex = re.compile(
@@ -136,8 +136,6 @@ def parse_optional_tags(
136136
- ``'not tested'``
137137
- ``'known bug'`` (possible values are ``None``, ``linux`` and ``macos``)
138138
- ``'py2'``
139-
- ``'arb216'``
140-
- ``'arb218'``
141139
- ``'optional - FEATURE...'`` or ``'needs FEATURE...'`` --
142140
the dictionary will just have the key ``'FEATURE'``
143141

src/sage/libs/arb/arb_version.pyx

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/sage/libs/flint/flint_wrap.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@
136136
#include <flint/hypgeom.h>
137137
#include <flint/long_extras.h>
138138
#include <flint/mag.h>
139-
#include <flint/mpf_mat.h>
140-
#include <flint/mpf_vec.h>
141139
#include <flint/mpfr_mat.h>
142140
#include <flint/mpfr_vec.h>
143141
#include <flint/mpn_extras.h>

src/sage/libs/flint/fmpq.pxd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,12 @@ cdef extern from "flint_wrap.h":
4141
void fmpq_height(fmpz_t height, const fmpq_t x) noexcept
4242
flint_bitcnt_t fmpq_height_bits(const fmpq_t x) noexcept
4343
void fmpq_set_fmpz_frac(fmpq_t res, const fmpz_t p, const fmpz_t q) noexcept
44-
void fmpq_get_mpz_frac(mpz_t a, mpz_t b, fmpq_t c) noexcept
4544
void fmpq_set_si(fmpq_t res, slong p, ulong q) noexcept
4645
void _fmpq_set_si(fmpz_t rnum, fmpz_t rden, slong p, ulong q) noexcept
4746
void fmpq_set_ui(fmpq_t res, ulong p, ulong q) noexcept
4847
void _fmpq_set_ui(fmpz_t rnum, fmpz_t rden, ulong p, ulong q) noexcept
4948
void fmpq_set_mpq(fmpq_t dest, const mpq_t src) noexcept
5049
int fmpq_set_str(fmpq_t dest, const char * s, int base) noexcept
51-
void fmpq_init_set_mpz_frac_readonly(fmpq_t z, const mpz_t p, const mpz_t q) noexcept
5250
double fmpq_get_d(const fmpq_t f) noexcept
5351
void fmpq_get_mpq(mpq_t dest, const fmpq_t src) noexcept
5452
int fmpq_get_mpfr(mpfr_t dest, const fmpq_t src, mpfr_rnd_t rnd) noexcept

src/sage/rings/complex_arb.pyx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4792,18 +4792,14 @@ cdef class ComplexBall(RingElement):
47924792
47934793
sage: n = CBF(1,1)
47944794
sage: m = CBF(-2/3, 3/5)
4795-
sage: n.elliptic_pi_inc(CBF.pi()/2, m) # arb216
4796-
[0.8934793755173 +/- ...e-14] + [0.95707868710750 +/- ...e-15]*I
4797-
sage: n.elliptic_pi_inc(CBF.pi()/2, m) # arb218 - this is a regression, see :trac:28623
4795+
sage: n.elliptic_pi_inc(CBF.pi()/2, m) # this is a regression, see :trac:28623
47984796
nan + nan*I
47994797
sage: n.elliptic_pi(m)
48004798
[0.8934793755173...] + [0.957078687107...]*I
48014799
48024800
sage: n = CBF(2, 3/7)
48034801
sage: m = CBF(-1/3, 2/9)
4804-
sage: n.elliptic_pi_inc(CBF.pi()/2, m) # arb216
4805-
[0.2969588746419 +/- ...e-14] + [1.3188795332738 +/- ...e-14]*I
4806-
sage: n.elliptic_pi_inc(CBF.pi()/2, m) # arb218 - this is a regression, see :trac:28623
4802+
sage: n.elliptic_pi_inc(CBF.pi()/2, m) # this is a regression, see :trac:28623
48074803
nan + nan*I
48084804
sage: n.elliptic_pi(m)
48094805
[0.296958874641...] + [1.318879533273...]*I

src/sage/rings/real_arb.pyx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,7 @@ cdef int arb_to_mpfi(mpfi_t target, arb_t source, const long precision) except -
294294
295295
EXAMPLES::
296296
297-
sage: RIF(RBF(2)**(2**100)) # arb216 # indirect doctest
298-
Traceback (most recent call last):
299-
...
300-
ArithmeticError: Error converting arb to mpfi. Overflow?
301-
sage: RIF(RBF(2)**(2**100)) # arb218 # indirect doctest
297+
sage: RIF(RBF(2)**(2**100))
302298
[5.8756537891115869e1388255822130839282 .. +infinity] # 64-bit
303299
[2.098... .. +infinity] # 32-bit
304300
@@ -1729,11 +1725,7 @@ cdef class RealBall(RingElement):
17291725
::
17301726
17311727
sage: b = RBF(2)^(2^1000)
1732-
sage: b.mid() # arb216
1733-
Traceback (most recent call last):
1734-
...
1735-
RuntimeError: unable to convert to MPFR (exponent out of range?)
1736-
sage: b.mid() # arb218
1728+
sage: b.mid()
17371729
+infinity
17381730
17391731
.. SEEALSO:: :meth:`rad`, :meth:`squash`

0 commit comments

Comments
 (0)