Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #21992.7+8: rephrase exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
cheuberg committed Jan 2, 2017
1 parent d7e519a commit 7db28fe
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/sage/matrix/compute_J_ideal.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def lifting(p, t, A, G):
sage: lifting(5, 10, A, G1)
Traceback (most recent call last):
...
ValueError: A*G is not zero mod 5^9
ValueError: A*G not zero mod 5^9
ALGORITHM:
Expand All @@ -184,7 +184,7 @@ def lifting(p, t, A, G):
Traceback (most recent call last):
...
ValueError: [ 1 X|]
[ X X^2|] does not have full rank
[ X X^2|] does not have full rank.
"""
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing

Expand All @@ -200,7 +200,7 @@ def lifting(p, t, A, G):

if not (A*G % p**(t-1)).is_zero():
raise ValueError(
"A*G is not zero mod %s^%s" % (p, t-1))
"A*G not zero mod %s^%s" % (p, t-1))


R = A*G/p**(t-1)
Expand All @@ -219,7 +219,7 @@ def lifting(p, t, A, G):

r = Db.rank()
if r != c:
raise ValueError("{} does not have full rank".format(ARb))
raise ValueError("{} does not have full rank.".format(ARb))

T = Tb.change_ring(DX)

Expand Down Expand Up @@ -320,13 +320,13 @@ def __init__(self, B):
sage: ComputeMinimalPolynomials(matrix([[1, 2]]))
Traceback (most recent call last):
...
TypeError: square matrix required.
TypeError: square matrix required
"""
from sage.rings.polynomial.polynomial_ring import polygen

super(ComputeMinimalPolynomials, self).__init__()
if not B.is_square():
raise TypeError("square matrix required.")
raise TypeError("square matrix required")

self._B = B
self._D = B.base_ring()
Expand Down Expand Up @@ -378,11 +378,11 @@ def find_monic_replacements(self, p, t, pt_generators, prev_nu):
sage: C.find_monic_replacements(2, 3, generators_4, nu_1)
Traceback (most recent call last):
...
ValueError: [2*x^2 + 2*x, x^2 + 3*x + 2] are not in N_{(2^3)}(B)
ValueError: [2*x^2 + 2*x, x^2 + 3*x + 2] not in N_{(2^3)}(B)
sage: C.find_monic_replacements(2, 2, generators_4, x^2)
Traceback (most recent call last):
...
ValueError: x^2 is not in N_{(2^1)}(B)
ValueError: x^2 not in N_{(2^1)}(B)
ALGORITHM:
Expand All @@ -392,11 +392,11 @@ def find_monic_replacements(self, p, t, pt_generators, prev_nu):

if not all((g(self._B) % p**t).is_zero()
for g in pt_generators):
raise ValueError("%s are not in N_{(%s^%s)}(B)" %
raise ValueError("%s not in N_{(%s^%s)}(B)" %
(pt_generators, p, t))

if not (prev_nu(self._B) % p**(t-1)).is_zero():
raise ValueError("%s is not in N_{(%s^%s)}(B)" % (prev_nu, p, t-1))
raise ValueError("%s not in N_{(%s^%s)}(B)" % (prev_nu, p, t-1))

(X,) = self._DX.gens()

Expand Down Expand Up @@ -461,11 +461,11 @@ def current_nu(self, p, t, pt_generators, prev_nu):
sage: C.current_nu(2, 3, generators_4, nu_1)
Traceback (most recent call last):
...
ValueError: [2*x^2 + 2*x, x^2 + 3*x + 2] are not in N_{(2^3)}(B)
ValueError: [2*x^2 + 2*x, x^2 + 3*x + 2] not in N_{(2^3)}(B)
sage: C.current_nu(2, 2, generators_4, x^2)
Traceback (most recent call last):
...
ValueError: x^2 is not in N_{(2^1)}(B)
ValueError: x^2 not in N_{(2^1)}(B)
"""
import heapq

Expand All @@ -474,11 +474,11 @@ def current_nu(self, p, t, pt_generators, prev_nu):

if not all((g(self._B) % p**t).is_zero()
for g in pt_generators):
raise ValueError("%s are not in N_{(%s^%s)}(B)" %
raise ValueError("%s not in N_{(%s^%s)}(B)" %
(pt_generators, p, t))

if not (prev_nu(self._B) % p**(t-1)).is_zero():
raise ValueError("%s is not in N_{(%s^%s)}(B)" % (prev_nu, p, t-1))
raise ValueError("%s not in N_{(%s^%s)}(B)" % (prev_nu, p, t-1))

generators = self.find_monic_replacements(p, t, pt_generators, prev_nu)

Expand Down Expand Up @@ -562,7 +562,7 @@ def mccoy_column(self, p, t, nu):
for b in self._A[:, 0].list()])

assert (self._A * column % p**t).is_zero(),\
"McCoy column is not correct"
"McCoy column incorrect"

return column

Expand Down

0 comments on commit 7db28fe

Please sign in to comment.