@@ -135,9 +135,9 @@ cdef class flint_mpoly_context(flint_elem):
135
135
136
136
def __init__ (self , int nvars , names ):
137
137
if nvars < 0 :
138
- raise ValueError (" Cannot have a negative amount of variables" )
138
+ raise ValueError (" cannot have a negative amount of variables" )
139
139
elif len (names) != nvars:
140
- raise ValueError (" Number of variables must match number of variable names" )
140
+ raise ValueError (" number of variables must match number of variable names" )
141
141
self .py_names = tuple (name.encode(" ascii" ) if not isinstance (name, bytes) else name for name in names)
142
142
self .c_names = < const char ** > libc.stdlib.malloc(nvars * sizeof(const char * ))
143
143
for i in range (nvars):
@@ -155,7 +155,7 @@ cdef class flint_mpoly_context(flint_elem):
155
155
156
156
def name (self , long i ):
157
157
if not 0 <= i < len (self .py_names):
158
- raise IndexError (" Variable name index out of range" )
158
+ raise IndexError (" variable name index out of range" )
159
159
return self .py_names[i].decode(" ascii" )
160
160
161
161
def names (self ):
@@ -170,13 +170,13 @@ cdef class flint_mpoly_context(flint_elem):
170
170
try :
171
171
i = self .names().index(var)
172
172
except ValueError :
173
- raise ValueError (" Variable not in context" )
173
+ raise ValueError (" variable not in context" )
174
174
elif isinstance (var, int ):
175
175
if not 0 <= var < self .nvars():
176
- raise IndexError (" Generator index out of range" )
176
+ raise IndexError (" generator index out of range" )
177
177
i = var
178
178
else :
179
- raise TypeError (" Invalid variable type" )
179
+ raise TypeError (" invalid variable type" )
180
180
181
181
return i
182
182
@@ -196,7 +196,7 @@ cdef class flint_mpoly_context(flint_elem):
196
196
if len (nametup) == 1 :
197
197
nametup = tuple (nametup[0 ] + str (i) for i in range (nvars))
198
198
else :
199
- raise ValueError (" Number of variables does not equal number of names" )
199
+ raise ValueError (" number of variables does not equal number of names" )
200
200
return nametup
201
201
202
202
@classmethod
@@ -216,7 +216,7 @@ cdef class flint_mpoly_context(flint_elem):
216
216
elif nametup is None and names is not None :
217
217
key = nvars, ordering, cls .create_variable_names(nvars, names)
218
218
else :
219
- raise ValueError (" Must provide either `names` or `nametup`" )
219
+ raise ValueError (" must provide either `names` or `nametup`" )
220
220
221
221
ctx = cls ._ctx_cache.get(key)
222
222
if ctx is None :
@@ -366,4 +366,4 @@ cdef ordering_c_to_py(ordering_t ordering):
366
366
elif ordering == ordering_t.ORD_DEGREVLEX:
367
367
return Ordering.degrevlex
368
368
else :
369
- raise ValueError (" Unimplemented term order %d " % ordering)
369
+ raise ValueError (" unimplemented term order %d " % ordering)
0 commit comments