Skip to content

Commit c0c0517

Browse files
committed
fixup! Remove unused imports, use lower case to start exception message
1 parent c8782c5 commit c0c0517

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/flint/flint_base/flint_base.pyx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ cdef class flint_mpoly_context(flint_elem):
135135

136136
def __init__(self, int nvars, names):
137137
if nvars < 0:
138-
raise ValueError("Cannot have a negative amount of variables")
138+
raise ValueError("cannot have a negative amount of variables")
139139
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")
141141
self.py_names = tuple(name.encode("ascii") if not isinstance(name, bytes) else name for name in names)
142142
self.c_names = <const char**> libc.stdlib.malloc(nvars * sizeof(const char *))
143143
for i in range(nvars):
@@ -155,7 +155,7 @@ cdef class flint_mpoly_context(flint_elem):
155155

156156
def name(self, long i):
157157
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")
159159
return self.py_names[i].decode("ascii")
160160

161161
def names(self):
@@ -170,13 +170,13 @@ cdef class flint_mpoly_context(flint_elem):
170170
try:
171171
i = self.names().index(var)
172172
except ValueError:
173-
raise ValueError("Variable not in context")
173+
raise ValueError("variable not in context")
174174
elif isinstance(var, int):
175175
if not 0 <= var < self.nvars():
176-
raise IndexError("Generator index out of range")
176+
raise IndexError("generator index out of range")
177177
i = var
178178
else:
179-
raise TypeError("Invalid variable type")
179+
raise TypeError("invalid variable type")
180180

181181
return i
182182

@@ -196,7 +196,7 @@ cdef class flint_mpoly_context(flint_elem):
196196
if len(nametup) == 1:
197197
nametup = tuple(nametup[0] + str(i) for i in range(nvars))
198198
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")
200200
return nametup
201201

202202
@classmethod
@@ -216,7 +216,7 @@ cdef class flint_mpoly_context(flint_elem):
216216
elif nametup is None and names is not None:
217217
key = nvars, ordering, cls.create_variable_names(nvars, names)
218218
else:
219-
raise ValueError("Must provide either `names` or `nametup`")
219+
raise ValueError("must provide either `names` or `nametup`")
220220

221221
ctx = cls._ctx_cache.get(key)
222222
if ctx is None:
@@ -366,4 +366,4 @@ cdef ordering_c_to_py(ordering_t ordering):
366366
elif ordering == ordering_t.ORD_DEGREVLEX:
367367
return Ordering.degrevlex
368368
else:
369-
raise ValueError("Unimplemented term order %d" % ordering)
369+
raise ValueError("unimplemented term order %d" % ordering)

0 commit comments

Comments
 (0)