Skip to content

Commit 0e1d9e4

Browse files
committed
less enthusiasm in error messages
1 parent 12be2d9 commit 0e1d9e4

File tree

20 files changed

+40
-41
lines changed

20 files changed

+40
-41
lines changed

src/sage/categories/crystals.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,12 +1582,12 @@ def to_highest_weight(self, index_set = None):
15821582
sage: t.to_highest_weight()
15831583
Traceback (most recent call last):
15841584
...
1585-
ValueError: This is not a highest weight crystals!
1585+
ValueError: this is not a highest weight crystal
15861586
"""
15871587
from sage.categories.highest_weight_crystals import HighestWeightCrystals
15881588
if index_set is None:
15891589
if HighestWeightCrystals() not in self.parent().categories():
1590-
raise ValueError("This is not a highest weight crystals!")
1590+
raise ValueError("this is not a highest weight crystal")
15911591
index_set = self.index_set()
15921592
for i in index_set:
15931593
next = self.e(i)
@@ -1623,12 +1623,12 @@ def to_lowest_weight(self, index_set = None):
16231623
sage: t.to_lowest_weight()
16241624
Traceback (most recent call last):
16251625
...
1626-
ValueError: This is not a highest weight crystals!
1626+
ValueError: this is not a highest weight crystal
16271627
"""
16281628
from sage.categories.highest_weight_crystals import HighestWeightCrystals
16291629
if index_set is None:
16301630
if HighestWeightCrystals() not in self.parent().categories():
1631-
raise ValueError("This is not a highest weight crystals!")
1631+
raise ValueError("this is not a highest weight crystal")
16321632
index_set = self.index_set()
16331633
for i in index_set:
16341634
next = self.f(i)

src/sage/categories/finite_coxeter_groups.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -827,11 +827,11 @@ def coxeter_knuth_neighbor(self, w):
827827
sage: w.coxeter_knuth_neighbor(word)
828828
Traceback (most recent call last):
829829
...
830-
NotImplementedError: This has only been implemented in finite type A so far!
830+
NotImplementedError: this has only been implemented in finite type A so far
831831
"""
832832
C = self.parent().cartan_type()
833833
if not C[0] == 'A':
834-
raise NotImplementedError("This has only been implemented in finite type A so far!")
834+
raise NotImplementedError("this has only been implemented in finite type A so far")
835835
d = []
836836
for i in range(2,len(w)):
837837
v = [j for j in w]

src/sage/categories/finite_groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def cayley_graph_disabled(self, connecting_set=None):
134134
else:
135135
for g in connecting_set:
136136
if g not in self:
137-
raise RuntimeError("Each element of the connecting set must be in the group!")
137+
raise RuntimeError("each element of the connecting set must be in the group")
138138
connecting_set = [self(g) for g in connecting_set]
139139
from sage.graphs.digraph import DiGraph
140140
arrows = {}

src/sage/coding/binary_code.pyx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,8 @@ cdef class BinaryCode:
777777
self.nwords = 2 * other_nwords
778778
nrows = self.nrows
779779
nwords = self.nwords
780-
else: raise NotImplementedError("!")
780+
else:
781+
raise NotImplementedError
781782

782783
if self.nrows >= self.radix or self.ncols > self.radix:
783784
raise NotImplementedError("Columns and rows are stored as ints. This code is too big.")

src/sage/combinat/designs/incidence_structures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ def relabel(self, perm=None, inplace=True):
13831383
raise ValueError("perm argument must be None, a list or a dictionary")
13841384

13851385
if len(set(perm.values())) != len(perm):
1386-
raise ValueError("Two points are getting relabelled with the same name !")
1386+
raise ValueError("two points are getting relabelled with the same name")
13871387

13881388
self._points = [perm[x] for x in self._points]
13891389
if self._points == list(range(self.num_points())):

src/sage/combinat/designs/steiner_quadruple_systems.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,10 +741,10 @@ def steiner_quadruple_system(n, check = False):
741741
nn = (n+10) // 12
742742
sqs = twelve_n_minus_ten(steiner_quadruple_system(nn, check = False))
743743
else:
744-
raise ValueError("This shouldn't happen !")
744+
raise ValueError("this should never happen")
745745

746746
if check and not sqs.is_t_design(3,n,4,1):
747-
raise RuntimeError("Something is very very wrong.")
747+
raise RuntimeError("something is very very wrong")
748748

749749
return sqs
750750

src/sage/databases/sql_db.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,8 +1254,7 @@ def get_skeleton(self, check=False):
12541254
d = construct_skeleton(self)
12551255
if d == self.__skeleton__:
12561256
return d
1257-
else:
1258-
raise RuntimeError("Skeleton structure is out of whack!")
1257+
raise RuntimeError("skeleton structure is out of whack")
12591258
return self.__skeleton__
12601259

12611260
def query(self, *args, **kwds):

src/sage/groups/cubic_braid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ def classical_invariant_form(self):
19011901
self._create_classical_realization()
19021902

19031903
if self._classical_invariant_form is None:
1904-
raise ValueError("no classical invariant form defined!")
1904+
raise ValueError("no classical invariant form defined")
19051905

19061906
return self._classical_invariant_form
19071907

src/sage/groups/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ def linear_relation(P, Q, operation='+', identity=None, inverse=None, op=None):
10331033
m1 * h)
10341034
except ValueError:
10351035
pass # to next h
1036-
raise ValueError("No solution found in linear_relation!")
1036+
raise ValueError("no solution found in linear_relation")
10371037

10381038
################################################################
10391039
#

src/sage/libs/glpk/error.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ class GLPKError(MIPSolverException):
2929
EXAMPLES::
3030
3131
sage: from sage.libs.glpk.error import GLPKError
32-
sage: raise GLPKError("trouble!")
32+
sage: raise GLPKError("trouble")
3333
Traceback (most recent call last):
3434
...
35-
GLPKError: trouble!
35+
GLPKError: trouble
3636
"""
3737
pass
3838

0 commit comments

Comments
 (0)