Skip to content

Commit 918dfcd

Browse files
committed
Merge branch 't/30448/public/30448' into t/34167/34167
2 parents b37c1de + 0677319 commit 918dfcd

File tree

67 files changed

+280
-203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+280
-203
lines changed

.github/workflows/lint.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,19 @@ jobs:
3636
run: pip install tox relint
3737
- name: Lint using relint
3838
run: tox -e relint src/sage/
39+
lint-rst:
40+
name: Validate docstring markup as RST
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v2
45+
- name: Set up Python
46+
uses: actions/setup-python@v2
47+
with:
48+
python-version: 3.8
49+
- name: Install tox
50+
run: pip install tox
51+
- name: Lint using tox -e rst
52+
run: tox -e rst
53+
# Until all errors are fixed:
54+
continue-on-error: true

src/sage/categories/category_with_axiom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2352,7 +2352,7 @@ def __reduce__(self):
23522352
additive magma is implemented as
23532353
``MagmasAndAdditiveMagmas.Distributive.AdditiveAssociative.AdditiveCommutative``
23542354
and not
2355-
``MagmasAndAdditiveMagmas.Distributive.AdditiveCommutative.AdditiveAssociative``::
2355+
``MagmasAndAdditiveMagmas.Distributive.AdditiveCommutative.AdditiveAssociative``.
23562356
23572357
EXAMPLES::
23582358

src/sage/categories/chain_complexes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def _apply_functor_to_morphism(self, f):
235235
r"""
236236
Apply ``self`` to a chain map.
237237
238-
TESTS:
238+
TESTS::
239239
240240
sage: E3 = EuclideanSpace(3) # optional - sage.symbolic
241241
sage: C = E3.de_rham_complex() # optional - sage.symbolic

src/sage/categories/enumerated_sets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def __iter__(self):
179179
180180
If none of these are provided, raise a ``NotImplementedError``.
181181
182-
EXAMPLES::
182+
EXAMPLES:
183183
184184
We start with an example where nothing is implemented::
185185

src/sage/categories/modules_with_basis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ def __call_on_basis__(self, **options):
21662166
sage: phi(x[1] + x[2] + x[3])
21672167
B[1] + 4*B[2] + 9*B[3]
21682168
2169-
TESTS::
2169+
TESTS:
21702170
21712171
As for usual homsets, the argument can be a Python function::
21722172

src/sage/categories/sets_cat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,10 +1471,10 @@ def construction(self):
14711471

14721472
def _test_construction(self, **options):
14731473
"""
1474-
Test that the construction returned by self really yields self.
1474+
Test that the construction returned by ``self`` really yields ``self``.
14751475
1476-
:meth:`construction` either returns None or a pair ``(F,O)``,
1477-
and if it returns the latter, then it is supposed that ``F(O)==self`.
1476+
:meth:`construction` either returns None or a pair ``(F, O)``,
1477+
and if it returns the latter, then it is supposed that ``F(O) == self``.
14781478
The test verifies this assumption.
14791479
14801480
EXAMPLES:

src/sage/coding/delsarte_bounds.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -678,29 +678,29 @@ def delsarte_bound_Q_matrix(q, d, return_data=False, solver="PPL", isinteger=Fal
678678
(ILP), rather that an LP solver. Can be very slow if set to
679679
``True``.
680680
681-
EXAMPLES:
681+
EXAMPLES:
682682
683-
The bound on dimension of linear `F_2`-codes of length 10 and minimal distance 6::
683+
The bound on dimension of linear `F_2`-codes of length 10 and minimal distance 6::
684684
685-
sage: q_matrix = Matrix([[codes.bounds.krawtchouk(10,2,i,j) for i in range(11)] for j in range(11)])
686-
sage: codes.bounds.delsarte_bound_Q_matrix(q_matrix, 6)
687-
2
685+
sage: q_matrix = Matrix([[codes.bounds.krawtchouk(10,2,i,j) for i in range(11)] for j in range(11)])
686+
sage: codes.bounds.delsarte_bound_Q_matrix(q_matrix, 6)
687+
2
688688
689-
sage: a,p,val = codes.bounds.delsarte_bound_Q_matrix(q_matrix, 6, return_data=True)
690-
sage: [j for i,j in p.get_values(a).items()]
691-
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
689+
sage: a,p,val = codes.bounds.delsarte_bound_Q_matrix(q_matrix, 6, return_data=True)
690+
sage: [j for i,j in p.get_values(a).items()]
691+
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
692692
693-
TESTS:
693+
TESTS:
694694
695-
cases for using Hamming scheme Q matrix::
695+
Cases for using Hamming scheme Q matrix::
696696
697-
sage: q_matrix = Matrix([[codes.bounds.krawtchouk(10,2,i,j) for i in range(11)] for j in range(11)])
698-
sage: codes.bounds.delsarte_bound_Q_matrix(q_matrix, 6)
699-
2
697+
sage: q_matrix = Matrix([[codes.bounds.krawtchouk(10,2,i,j) for i in range(11)] for j in range(11)])
698+
sage: codes.bounds.delsarte_bound_Q_matrix(q_matrix, 6)
699+
2
700700
701-
sage: a,p,val = codes.bounds.delsarte_bound_Q_matrix(q_matrix, 6, return_data=True)
702-
sage: [j for i,j in p.get_values(a).items()]
703-
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
701+
sage: a,p,val = codes.bounds.delsarte_bound_Q_matrix(q_matrix, 6, return_data=True)
702+
sage: [j for i,j in p.get_values(a).items()]
703+
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
704704
705705
"""
706706

src/sage/coding/gabidulin_code.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ class GabidulinCode(AbstractLinearRankMetricCode):
4545
4646
EXAMPLES:
4747
48-
A Gabidulin Code can be constructed in the following way:
48+
A Gabidulin Code can be constructed in the following way::
4949
50-
sage: Fqm = GF(16)
51-
sage: Fq = GF(4)
52-
sage: C = codes.GabidulinCode(Fqm, 2, 2, Fq)
53-
sage: C
54-
[2, 2, 1] linear Gabidulin code over GF(16)/GF(4)
50+
sage: Fqm = GF(16)
51+
sage: Fq = GF(4)
52+
sage: C = codes.GabidulinCode(Fqm, 2, 2, Fq)
53+
sage: C
54+
[2, 2, 1] linear Gabidulin code over GF(16)/GF(4)
5555
"""
5656
_registered_encoders = {}
5757
_registered_decoders = {}
@@ -113,7 +113,7 @@ def __init__(self, base_field, length, dimension, sub_field=None,
113113
ValueError: 'length' can be at most the degree of the extension, 3
114114
115115
If the number of evaluation points is not equal to the length
116-
of the code, an error is raised:
116+
of the code, an error is raised::
117117
118118
sage: Fqm = GF(5^20)
119119
sage: Fq = GF(5)
@@ -125,7 +125,7 @@ def __init__(self, base_field, length, dimension, sub_field=None,
125125
ValueError: the number of evaluation points should be equal to the length of the code
126126
127127
If evaluation points are not linearly independent over the ``base_field``,
128-
an error is raised:
128+
an error is raised::
129129
130130
sage: evals = [ aa*i for i in range(2) ]
131131
sage: C = codes.GabidulinCode(Fqm, 2, 2, Fq, None, evals)
@@ -134,7 +134,7 @@ def __init__(self, base_field, length, dimension, sub_field=None,
134134
ValueError: the evaluation points provided are not linearly independent
135135
136136
If an evaluation point does not belong to the ``base_field``, an error
137-
is raised:
137+
is raised::
138138
139139
sage: a = GF(3).gen()
140140
sage: evals = [ a*i for i in range(2) ]
@@ -146,7 +146,7 @@ def __init__(self, base_field, length, dimension, sub_field=None,
146146
Given that both ``sub_field`` and ``twisting_homomorphism`` are specified
147147
and ``twisting_homomorphism`` has a fixed field method. If the fixed
148148
field of ``twisting_homomorphism`` is not ``sub_field``, an error is
149-
raised:
149+
raised::
150150
151151
sage: Fqm = GF(64)
152152
sage: Fq = GF(8)
@@ -158,7 +158,7 @@ def __init__(self, base_field, length, dimension, sub_field=None,
158158
159159
If ``twisting_homomorphism`` is given, but ``sub_field`` is not. In case
160160
``twisting_homomorphism`` does not have a fixed field method, and error
161-
is raised:
161+
is raised::
162162
163163
sage: Fqm.<z6> = GF(64)
164164
sage: sigma = Hom(Fqm, Fqm)[1]; sigma
@@ -417,7 +417,7 @@ def __init__(self, code):
417417
418418
TESTS:
419419
420-
If the code is not a Gabidulin code, an error is raised:
420+
If the code is not a Gabidulin code, an error is raised::
421421
422422
sage: C = codes.HammingCode(GF(4), 2)
423423
sage: E = codes.encoders.GabidulinVectorEvaluationEncoder(C)
@@ -433,7 +433,7 @@ def _repr_(self):
433433
"""
434434
Return a string representation of ``self``.
435435
436-
EXAMPLES:
436+
EXAMPLES::
437437
438438
sage: Fqm = GF(5^20)
439439
sage: Fq = GF(5^4)
@@ -447,7 +447,7 @@ def _latex_(self):
447447
r"""
448448
Return a latex representation of ``self``.
449449
450-
EXAMPLES:
450+
EXAMPLES::
451451
452452
sage: Fqm = GF(5^20)
453453
sage: Fq = GF(5^4)
@@ -571,7 +571,7 @@ def __init__(self, code):
571571
572572
TESTS:
573573
574-
If the code is not a Gabidulin code, an error is raised:
574+
If the code is not a Gabidulin code, an error is raised::
575575
576576
sage: C = codes.HammingCode(GF(4), 2)
577577
sage: E = codes.encoders.GabidulinPolynomialEvaluationEncoder(C)
@@ -587,7 +587,7 @@ def _repr_(self):
587587
"""
588588
Return a string representation of ``self``.
589589
590-
EXAMPLES:
590+
EXAMPLES::
591591
592592
sage: Fqm = GF(5^20)
593593
sage: Fq = GF(5^4)
@@ -601,7 +601,7 @@ def _latex_(self):
601601
r"""
602602
Return a latex representation of ``self``.
603603
604-
EXAMPLES:
604+
EXAMPLES::
605605
606606
sage: Fqm = GF(5^20)
607607
sage: Fq = GF(5^4)
@@ -648,7 +648,7 @@ def message_space(self):
648648
r"""
649649
Return the message space of the associated code of ``self``.
650650
651-
EXAMPLES:
651+
EXAMPLES::
652652
653653
sage: Fqm = GF(5^20)
654654
sage: Fq = GF(5^4)
@@ -680,7 +680,7 @@ def encode(self, p, form="vector"):
680680
681681
- a codeword corresponding to `p` in vector or matrix form
682682
683-
EXAMPLES:
683+
EXAMPLES::
684684
685685
sage: Fqm = GF(2^9)
686686
sage: Fq = GF(2^3)
@@ -749,7 +749,7 @@ def unencode_nocheck(self, c):
749749
750750
- a skew polynomial of degree less than ``self.code().dimension()``
751751
752-
EXAMPLES:
752+
EXAMPLES::
753753
754754
sage: Fqm = GF(2^9)
755755
sage: Fq = GF(2^3)
@@ -800,7 +800,7 @@ def __init__(self, code):
800800
801801
TESTS:
802802
803-
If the code is not a Gabidulin code, an error is raised:
803+
If the code is not a Gabidulin code, an error is raised::
804804
805805
sage: C = codes.HammingCode(GF(4), 2)
806806
sage: D = codes.decoders.GabidulinGaoDecoder(C)
@@ -816,7 +816,7 @@ def _repr_(self):
816816
"""
817817
Return a string representation of ``self``.
818818
819-
EXAMPLES:
819+
EXAMPLES::
820820
821821
sage: Fqm = GF(5^20)
822822
sage: Fq = GF(5^4)
@@ -830,7 +830,7 @@ def _latex_(self):
830830
r"""
831831
Return a latex representation of ``self``.
832832
833-
EXAMPLES:
833+
EXAMPLES::
834834
835835
sage: Fqm = GF(5^20)
836836
sage: Fq = GF(5^4)
@@ -894,7 +894,7 @@ def _partial_xgcd(self, a, b, d_stop):
894894
895895
- ``u_c`` -- right linearized quotient of `a` and `b`
896896
897-
EXAMPLES:
897+
EXAMPLES::
898898
899899
sage: Fqm = GF(2^9)
900900
sage: Fq = GF(2^3)
@@ -942,7 +942,7 @@ def _decode_to_code_and_message(self, r):
942942
- the decoded codeword and decoded message corresponding to
943943
the received codeword `r`
944944
945-
EXAMPLES:
945+
EXAMPLES::
946946
947947
sage: Fqm = GF(2^9)
948948
sage: Fq = GF(2^3)
@@ -993,7 +993,7 @@ def decode_to_code(self, r):
993993
994994
- the decoded codeword corresponding to the received codeword
995995
996-
EXAMPLES:
996+
EXAMPLES::
997997
998998
sage: Fqm = GF(3^20)
999999
sage: Fq = GF(3)
@@ -1026,7 +1026,7 @@ def decode_to_message(self, r):
10261026
10271027
- the message corresponding to the received codeword
10281028
1029-
EXAMPLES:
1029+
EXAMPLES::
10301030
10311031
sage: Fqm = GF(2^9)
10321032
sage: Fq = GF(2^3)
@@ -1047,7 +1047,7 @@ def decoding_radius(self):
10471047
"""
10481048
Return the decoding radius of the Gabidulin Gao Decoder.
10491049
1050-
EXAMPLES:
1050+
EXAMPLES::
10511051
10521052
sage: Fqm = GF(5^20)
10531053
sage: Fq = GF(5)

src/sage/coding/linear_code.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,9 +2274,10 @@ def __init__(self, generator, d=None):
22742274
sage: C.minimum_distance()
22752275
3
22762276
2277-
We can construct a linear code directly from a vector space
2278-
sage: VS = matrix(GF(2), [[1,0,1],\
2279-
[1,0,1]]).row_space()
2277+
We can construct a linear code directly from a vector space::
2278+
2279+
sage: VS = matrix(GF(2), [[1,0,1],
2280+
....: [1,0,1]]).row_space()
22802281
sage: C = LinearCode(VS); C
22812282
[3, 1] linear code over GF(2)
22822283

src/sage/cpython/_py2_random.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ def gammavariate(self, alpha, beta):
471471
472472
Conditions on the parameters are alpha > 0 and beta > 0.
473473
474-
The probability distribution function is:
474+
The probability distribution function is::
475475
476476
x ** (alpha - 1) * math.exp(-x / beta)
477477
pdf(x) = --------------------------------------

0 commit comments

Comments
 (0)