Skip to content

Commit c29b465

Browse files
committed
various details fixed in coding (ruff, pep8, links in the doc)
1 parent e2e0f8d commit c29b465

File tree

9 files changed

+93
-123
lines changed

9 files changed

+93
-123
lines changed

src/sage/coding/abstract_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ def list(self):
512512
(1, 0, 1, 0, 1, 0, 1)
513513
True
514514
"""
515-
return [x for x in self]
515+
return list(self)
516516

517517
def length(self):
518518
r"""

src/sage/coding/ag_code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def designed_distance(self):
332332
"""
333333
Return the designed distance of the AG code.
334334
335-
If the code is of dimension zero, then a ``ValueError`` is raised.
335+
If the code is of dimension zero, then a :class:`ValueError` is raised.
336336
337337
EXAMPLES::
338338
@@ -576,7 +576,7 @@ def designed_distance(self):
576576
"""
577577
Return the designed distance of the differential AG code.
578578
579-
If the code is of dimension zero, then a ``ValueError`` is raised.
579+
If the code is of dimension zero, then a :class:`ValueError` is raised.
580580
581581
EXAMPLES::
582582

src/sage/coding/code_bounds.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,10 @@ def _check_n_q_d(n, q, d, field_based=True):
192192
Check that the length `n`, alphabet size `q` and minimum distance `d` type
193193
check and make sense for a code over a field.
194194
195-
More precisely, checks that the parameters are positive integers, that `q`
196-
is a prime power for codes over a field, or, more generally, that
197-
`q` is of size at least 2, and that `n >= d`. Raises a ``ValueError``
198-
otherwise.
195+
More precisely, this checks that the parameters are positive
196+
integers, that `q` is a prime power for codes over a field, or,
197+
more generally, that `q` is of size at least 2, and that `n >= d`.
198+
This raises a :class:`ValueError` otherwise.
199199
200200
TESTS::
201201

src/sage/coding/code_constructions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ def _is_a_splitting(S1, S2, n, return_automorphism=False):
155155
This is a special case of Theorem 6.4.3 in [HP2003]_.
156156
"""
157157
R = IntegerModRing(n)
158-
S1 = set(R(x) for x in S1)
159-
S2 = set(R(x) for x in S2)
158+
S1 = {R(x) for x in S1}
159+
S2 = {R(x) for x in S2}
160160

161161
# we first check whether (S1,S2) is a partition of R - {0}
162162
if (len(S1) + len(S2) != n-1 or len(S1) != len(S2) or

src/sage/coding/databases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def best_linear_code_in_codetables_dot_de(n, k, F, verbose=False):
174174
i = s.find("<PRE>")
175175
j = s.find("</PRE>")
176176
if i == -1 or j == -1:
177-
raise IOError("Error parsing data (missing pre tags).")
177+
raise OSError("Error parsing data (missing pre tags).")
178178
return s[i+5:j].strip()
179179

180180

0 commit comments

Comments
 (0)