Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

various details fixed in coding (ruff, pep8, links in the doc) #36880

Merged
merged 3 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sage/coding/abstract_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ def list(self):
(1, 0, 1, 0, 1, 0, 1)
True
"""
return [x for x in self]
return list(self)

def length(self):
r"""
Expand Down
4 changes: 2 additions & 2 deletions src/sage/coding/ag_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def designed_distance(self):
"""
Return the designed distance of the AG code.

If the code is of dimension zero, then a ``ValueError`` is raised.
If the code is of dimension zero, then a :class:`ValueError` is raised.

EXAMPLES::

Expand Down Expand Up @@ -576,7 +576,7 @@ def designed_distance(self):
"""
Return the designed distance of the differential AG code.

If the code is of dimension zero, then a ``ValueError`` is raised.
If the code is of dimension zero, then a :class:`ValueError` is raised.

EXAMPLES::

Expand Down
8 changes: 4 additions & 4 deletions src/sage/coding/code_bounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ def _check_n_q_d(n, q, d, field_based=True):
Check that the length `n`, alphabet size `q` and minimum distance `d` type
check and make sense for a code over a field.

More precisely, checks that the parameters are positive integers, that `q`
is a prime power for codes over a field, or, more generally, that
`q` is of size at least 2, and that `n >= d`. Raises a ``ValueError``
otherwise.
More precisely, this checks that the parameters are positive
integers, that `q` is a prime power for codes over a field, or,
more generally, that `q` is of size at least 2, and that `n >= d`.
This raises a :class:`ValueError` otherwise.

TESTS::

Expand Down
4 changes: 2 additions & 2 deletions src/sage/coding/code_constructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ def _is_a_splitting(S1, S2, n, return_automorphism=False):
This is a special case of Theorem 6.4.3 in [HP2003]_.
"""
R = IntegerModRing(n)
S1 = set(R(x) for x in S1)
S2 = set(R(x) for x in S2)
S1 = {R(x) for x in S1}
S2 = {R(x) for x in S2}

# we first check whether (S1,S2) is a partition of R - {0}
if (len(S1) + len(S2) != n-1 or len(S1) != len(S2) or
Expand Down
2 changes: 1 addition & 1 deletion src/sage/coding/databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
i = s.find("<PRE>")
j = s.find("</PRE>")
if i == -1 or j == -1:
raise IOError("Error parsing data (missing pre tags).")
raise OSError("Error parsing data (missing pre tags).")

Check warning on line 177 in src/sage/coding/databases.py

View check run for this annotation

Codecov / codecov/patch

src/sage/coding/databases.py#L177

Added line #L177 was not covered by tests
return s[i+5:j].strip()


Expand Down