Skip to content

Commit 9b4c61a

Browse files
author
Release Manager
committed
Trac #34443: less exclamation marks in error messages
URL: https://trac.sagemath.org/34443 Reported by: chapoton Ticket author(s): Frédéric Chapoton Reviewer(s): Kwankyu Lee
2 parents 27fc7d4 + 4c07a4d commit 9b4c61a

File tree

20 files changed

+42
-42
lines changed

20 files changed

+42
-42
lines changed

src/sage/categories/crystals.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,12 +1583,12 @@ def to_highest_weight(self, index_set=None):
15831583
sage: t.to_highest_weight()
15841584
Traceback (most recent call last):
15851585
...
1586-
ValueError: This is not a highest weight crystals!
1586+
ValueError: this is not a highest weight crystal
15871587
"""
15881588
from sage.categories.highest_weight_crystals import HighestWeightCrystals
15891589
if index_set is None:
15901590
if HighestWeightCrystals() not in self.parent().categories():
1591-
raise ValueError("This is not a highest weight crystals!")
1591+
raise ValueError("this is not a highest weight crystal")
15921592
index_set = self.index_set()
15931593
for i in index_set:
15941594
next = self.e(i)
@@ -1624,12 +1624,12 @@ def to_lowest_weight(self, index_set=None):
16241624
sage: t.to_lowest_weight()
16251625
Traceback (most recent call last):
16261626
...
1627-
ValueError: This is not a highest weight crystals!
1627+
ValueError: this is not a highest weight crystal
16281628
"""
16291629
from sage.categories.highest_weight_crystals import HighestWeightCrystals
16301630
if index_set is None:
16311631
if HighestWeightCrystals() not in self.parent().categories():
1632-
raise ValueError("This is not a highest weight crystals!")
1632+
raise ValueError("this is not a highest weight crystal")
16331633
index_set = self.index_set()
16341634
for i in index_set:
16351635
next = self.f(i)

src/sage/categories/finite_coxeter_groups.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from sage.categories.category_with_axiom import CategoryWithAxiom
1515
from sage.categories.coxeter_groups import CoxeterGroups
1616

17+
1718
class FiniteCoxeterGroups(CategoryWithAxiom):
1819
r"""
1920
The category of finite Coxeter groups.
@@ -828,11 +829,11 @@ def coxeter_knuth_neighbor(self, w):
828829
sage: w.coxeter_knuth_neighbor(word)
829830
Traceback (most recent call last):
830831
...
831-
NotImplementedError: This has only been implemented in finite type A so far!
832+
NotImplementedError: this has only been implemented in finite type A so far
832833
"""
833834
C = self.parent().cartan_type()
834835
if not C[0] == 'A':
835-
raise NotImplementedError("This has only been implemented in finite type A so far!")
836+
raise NotImplementedError("this has only been implemented in finite type A so far")
836837
d = []
837838
for i in range(2,len(w)):
838839
v = [j for j in w]
@@ -890,7 +891,7 @@ def coxeter_knuth_graph(self):
890891
sage: w.coxeter_knuth_graph()
891892
Traceback (most recent call last):
892893
...
893-
NotImplementedError: This has only been implemented in finite type A so far!
894+
NotImplementedError: this has only been implemented in finite type A so far
894895
"""
895896
from sage.graphs.graph import Graph
896897
R = [tuple(v) for v in self.reduced_words()]

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
@@ -1872,7 +1872,7 @@ def classical_invariant_form(self):
18721872
self._create_classical_realization()
18731873

18741874
if self._classical_invariant_form is None:
1875-
raise ValueError("no classical invariant form defined!")
1875+
raise ValueError("no classical invariant form defined")
18761876

18771877
return self._classical_invariant_form
18781878

src/sage/groups/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ def linear_relation(P, Q, operation='+', identity=None, inverse=None, op=None):
11401140
m1 * h)
11411141
except ValueError:
11421142
pass # to next h
1143-
raise ValueError("No solution found in linear_relation!")
1143+
raise ValueError("no solution found in linear_relation")
11441144

11451145
################################################################
11461146
#

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)