Skip to content

Commit 4216934

Browse files
committed
fix invalid escape seqs in doc strings
1 parent 603ca13 commit 4216934

File tree

6 files changed

+45
-44
lines changed

6 files changed

+45
-44
lines changed

src/flint/types/acb.pyx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ cdef class acb(flint_scalar):
655655
return u
656656

657657
def gamma(s):
658-
"""
658+
r"""
659659
Gamma function `\Gamma(s)`.
660660
661661
>>> from flint import showgood
@@ -667,7 +667,7 @@ cdef class acb(flint_scalar):
667667
return u
668668

669669
def rgamma(s):
670-
"""
670+
r"""
671671
Reciprocal gamma function `1/\Gamma(s)`, avoiding
672672
division by zero at the poles of the gamma function.
673673
@@ -684,7 +684,7 @@ cdef class acb(flint_scalar):
684684
return u
685685

686686
def lgamma(s):
687-
"""
687+
r"""
688688
Logarithmic gamma function `\log \Gamma(s)`.
689689
The function is defined to be continuous away from the
690690
negative half-axis and thus differs from `\log(\Gamma(s))` in general.
@@ -701,7 +701,7 @@ cdef class acb(flint_scalar):
701701
return u
702702

703703
def digamma(s):
704-
"""
704+
r"""
705705
Digamma function `\psi(s)`.
706706
707707
>>> from flint import showgood
@@ -713,7 +713,7 @@ cdef class acb(flint_scalar):
713713
return u
714714

715715
def zeta(s, a=None):
716-
"""
716+
r"""
717717
Riemann zeta function `\zeta(s)`, or the Hurwitz
718718
zeta function `\zeta(s,a)` if a second parameter is passed.
719719
@@ -734,7 +734,7 @@ cdef class acb(flint_scalar):
734734
return u
735735

736736
def lerch_phi(z, s, a):
737-
"""
737+
r"""
738738
Lerch transcendent `\Phi(z,s,a)`.
739739
740740
>>> from flint import showgood
@@ -759,7 +759,7 @@ cdef class acb(flint_scalar):
759759

760760
@staticmethod
761761
def pi():
762-
"""
762+
r"""
763763
Returns the constant `\pi` as an *acb*.
764764
765765
>>> from flint import showgood
@@ -1134,7 +1134,7 @@ cdef class acb(flint_scalar):
11341134
return u, v
11351135

11361136
def polylog(self, s):
1137-
"""
1137+
r"""
11381138
Computes the polylogarithm `\operatorname{Li}_s(z)` where
11391139
the argument *z* is given by *self* and the order *s* is given
11401140
as an extra parameter.

src/flint/types/arb.pyx

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ cdef class arb(flint_scalar):
304304
return x
305305

306306
def lower(self):
307-
"""
307+
r"""
308308
Lower bound for *self* (towards `-\infty`).
309309
The output is an *arb* holding an exact floating-point number
310310
that has been rounded down to the current precision.
@@ -317,7 +317,7 @@ cdef class arb(flint_scalar):
317317
return x
318318

319319
def upper(self):
320-
"""
320+
r"""
321321
Upper bound for *self* (towards `+\infty`).
322322
The output is an *arb* holding an exact floating-point number
323323
that has been rounded up to the current precision.
@@ -330,7 +330,7 @@ cdef class arb(flint_scalar):
330330
return x
331331

332332
def mid_rad_10exp(self, long n=0):
333-
"""
333+
r"""
334334
Returns an *fmpz* triple (*mid*, *rad*, *exp*) where the larger of *mid*
335335
and *rad* has *n* digits plus a few digits (*n* defaults to the current
336336
precision), such that *self* is contained in
@@ -670,7 +670,7 @@ cdef class arb(flint_scalar):
670670
return u
671671

672672
def floor(s):
673-
ur"""
673+
r"""
674674
Floor function `\lfloor s \rfloor`.
675675
676676
>>> print(arb.pi().floor())
@@ -683,7 +683,7 @@ cdef class arb(flint_scalar):
683683
return u
684684

685685
def ceil(s):
686-
ur"""
686+
r"""
687687
Ceiling function `\lceil s \rceil`.
688688
689689
>>> print(arb.pi().ceil())
@@ -986,7 +986,7 @@ cdef class arb(flint_scalar):
986986
return u, v
987987

988988
def sec(s):
989-
"""
989+
r"""
990990
Secant function `\operatorname{sec}(s)`.
991991
992992
>>> from flint import showgood
@@ -998,7 +998,7 @@ cdef class arb(flint_scalar):
998998
return u
999999

10001000
def csc(s):
1001-
"""
1001+
r"""
10021002
Cosecant function `\operatorname{csc}(s)`.
10031003
10041004
>>> from flint import showgood
@@ -1208,7 +1208,7 @@ cdef class arb(flint_scalar):
12081208
return u
12091209

12101210
def gamma(s):
1211-
"""
1211+
r"""
12121212
Gamma function `\Gamma(s)`.
12131213
12141214
>>> from flint import showgood
@@ -1229,7 +1229,7 @@ cdef class arb(flint_scalar):
12291229

12301230
@staticmethod
12311231
def gamma_fmpq(fmpq s):
1232-
"""
1232+
r"""
12331233
Computes the gamma function `\Gamma(s)` of a given *fmpq* *s*,
12341234
exploiting the fact that *s* is an exact rational number to
12351235
improve performance.
@@ -1244,7 +1244,7 @@ cdef class arb(flint_scalar):
12441244
return u
12451245

12461246
def rgamma(s):
1247-
ur"""
1247+
r"""
12481248
Reciprocal gamma function `1/\Gamma(s)`, avoiding
12491249
division by zero at the poles of the gamma function.
12501250
@@ -1263,7 +1263,7 @@ cdef class arb(flint_scalar):
12631263
return u
12641264

12651265
def lgamma(s):
1266-
"""
1266+
r"""
12671267
Logarithmic gamma function `\log \Gamma(s)`.
12681268
12691269
>>> from flint import showgood
@@ -1278,7 +1278,7 @@ cdef class arb(flint_scalar):
12781278
return u
12791279

12801280
def digamma(s):
1281-
"""
1281+
r"""
12821282
Digamma function `\psi(s)`.
12831283
12841284
>>> from flint import showgood
@@ -1326,6 +1326,7 @@ cdef class arb(flint_scalar):
13261326
"""
13271327
Computes the rising factorial `(s)_n` where *n* is an unsigned
13281328
integer, along with the first derivative with respect to `(s)_n`.
1329+
13291330
The current implementation does not use the gamma function,
13301331
so *n* should be moderate.
13311332
@@ -1340,7 +1341,7 @@ cdef class arb(flint_scalar):
13401341
return u, v
13411342

13421343
def zeta(s, a=None):
1343-
"""
1344+
r"""
13441345
Riemann zeta function `\zeta(s)` or the Hurwitz
13451346
zeta function `\zeta(s,a)` if a second parameter is passed.
13461347
@@ -1488,7 +1489,7 @@ cdef class arb(flint_scalar):
14881489
return u
14891490

14901491
def bin(s, ulong k):
1491-
"""
1492+
r"""
14921493
Binomial coefficient `{s \choose k}`. Currently *k* is limited
14931494
to an integer; this restriction will be removed in the future
14941495
by using the gamma function.
@@ -1505,7 +1506,7 @@ cdef class arb(flint_scalar):
15051506

15061507
@staticmethod
15071508
def bin_uiui(ulong n, ulong k):
1508-
"""
1509+
r"""
15091510
Binomial coefficient `{n \choose k}`.
15101511
15111512
>>> print(arb.bin_uiui(10, 5))
@@ -1533,7 +1534,7 @@ cdef class arb(flint_scalar):
15331534
return u
15341535

15351536
def polylog(self, s):
1536-
"""
1537+
r"""
15371538
Polylogarithm `\operatorname{Li}_s(z)` where
15381539
the argument *z* is given by *self* and the order *s* is given
15391540
as an extra parameter.
@@ -2261,7 +2262,7 @@ cdef class arb(flint_scalar):
22612262

22622263
@staticmethod
22632264
def pi():
2264-
"""
2265+
r"""
22652266
Returns the constant `\pi` as an *arb*.
22662267
22672268
>>> from flint import showgood
@@ -2274,7 +2275,7 @@ cdef class arb(flint_scalar):
22742275

22752276
@staticmethod
22762277
def const_sqrt_pi():
2277-
"""
2278+
r"""
22782279
The constant `\sqrt{\pi}`.
22792280
22802281
>>> from flint import showgood
@@ -2287,7 +2288,7 @@ cdef class arb(flint_scalar):
22872288

22882289
@staticmethod
22892290
def const_log2():
2290-
"""
2291+
r"""
22912292
The constant `\log(2)`.
22922293
22932294
>>> from flint import showgood
@@ -2300,7 +2301,7 @@ cdef class arb(flint_scalar):
23002301

23012302
@staticmethod
23022303
def const_log10():
2303-
"""
2304+
r"""
23042305
The constant `\log(10)`.
23052306
23062307
>>> from flint import showgood
@@ -2313,7 +2314,7 @@ cdef class arb(flint_scalar):
23132314

23142315
@staticmethod
23152316
def const_euler():
2316-
"""
2317+
r"""
23172318
Euler's constant `\gamma`.
23182319
23192320
>>> from flint import showgood

src/flint/types/fmpz_mod.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ cdef class fmpz_mod(flint_scalar):
328328
return res
329329

330330
def discrete_log(self, a):
331-
"""
331+
r"""
332332
Solve the discrete logarithm problem, using `self = g` as a base.
333333
Assumes a solution, :math:`a = g^x \pmod p` exists.
334334

src/flint/types/fmpz_mod_poly.pyx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ cdef class fmpz_mod_poly(flint_poly):
807807
return res
808808

809809
def compose_mod(self, other, modulus):
810-
"""
810+
r"""
811811
Returns the composition of two polynomials modulo a third.
812812
813813
To be precise about the order of composition, given ``self``, and ``other``
@@ -1047,7 +1047,7 @@ cdef class fmpz_mod_poly(flint_poly):
10471047
cdef fmpz_mod_poly res
10481048
cdef fmpz_t f
10491049

1050-
res = self.ctx.new_ctype_poly()
1050+
res = self.ctx.new_ctype_poly()
10511051
if not check:
10521052
fmpz_mod_poly_make_monic(
10531053
res.val, self.val, self.ctx.mod.val
@@ -1142,7 +1142,7 @@ cdef class fmpz_mod_poly(flint_poly):
11421142
return res
11431143

11441144
def pow_mod(self, e, modulus, mod_rev_inv=None):
1145-
"""
1145+
r"""
11461146
Returns ``self`` raised to the power ``e`` modulo ``modulus``:
11471147
:math:`f^e \mod g`/
11481148
@@ -1655,7 +1655,7 @@ cdef class fmpz_mod_poly(flint_poly):
16551655
return res
16561656

16571657
def pow_trunc(self, slong e, slong n):
1658-
"""
1658+
r"""
16591659
Returns ``self`` raised to the power ``e`` modulo `x^n`:
16601660
:math:`f^e \mod x^n`/
16611661
@@ -1885,14 +1885,14 @@ cdef class fmpz_mod_poly(flint_poly):
18851885
return res
18861886

18871887
def real_roots(self):
1888-
"""
1888+
r"""
18891889
This method is not implemented for polynomials in
18901890
:math:`(\mathbb{Z}/N\mathbb{Z})[X]`
18911891
"""
18921892
raise DomainError("Cannot compute real roots for polynomials over integers modulo N")
18931893

18941894
def complex_roots(self):
1895-
"""
1895+
r"""
18961896
This method is not implemented for polynomials in
18971897
:math:`(\mathbb{Z}/N\mathbb{Z})[X]`
18981898
"""

src/flint/types/fq_default_poly.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ cdef class fq_default_poly(flint_poly):
406406
return res
407407

408408
def truncate(self, slong n):
409-
"""
409+
r"""
410410
Notionally truncate the polynomial to have length ``n``. If
411411
``n`` is larger than the length of the input, then ``self`` is
412412
returned. If ``n`` is not positive, then the zero polynomial
@@ -655,7 +655,7 @@ cdef class fq_default_poly(flint_poly):
655655
return res
656656

657657
def pow_mod(self, e, modulus):
658-
"""
658+
r"""
659659
Returns ``self`` raised to the power ``e`` modulo ``modulus``:
660660
:math:`f^e \mod g`/
661661
@@ -1135,7 +1135,7 @@ cdef class fq_default_poly(flint_poly):
11351135
return res
11361136

11371137
def pow_trunc(self, slong e, slong n):
1138-
"""
1138+
r"""
11391139
Returns ``self`` raised to the power ``e`` modulo `x^n`:
11401140
:math:`f^e \mod x^n`/
11411141
@@ -1434,7 +1434,7 @@ cdef class fq_default_poly(flint_poly):
14341434
return res
14351435

14361436
def compose_mod(self, other, modulus):
1437-
"""
1437+
r"""
14381438
Returns the composition of two polynomials modulo a third.
14391439
14401440
To be precise about the order of composition, given ``self``, and ``other``

0 commit comments

Comments
 (0)