Skip to content

Commit a9215d0

Browse files
committed
Lint fixes
1 parent 6d14958 commit a9215d0

File tree

5 files changed

+6
-39
lines changed

5 files changed

+6
-39
lines changed

src/flint/types/fmpq.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ cdef class fmpq(flint_scalar):
441441
if sys.version_info < (3, 12):
442442
return hash(Fraction(int(self.p), int(self.q), _normalize=False)) # pragma: no cover
443443
else:
444-
return hash(Fraction._from_coprime_ints(int(self.p), int(self.q))) # pragma: no cover
444+
return hash(Fraction._from_coprime_ints(int(self.p), int(self.q))) # pragma: no cover
445445

446446
def height_bits(self, bint signed=False):
447447
"""

src/flint/types/fmpz_mod_poly.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,7 @@ cdef class fmpz_mod_poly(flint_poly):
14371437
cdef bint is_one
14381438

14391439
if n < 1:
1440-
raise ValueError(f"{n = } must be positive")
1440+
raise ValueError(f"n = {n} must be positive")
14411441

14421442
if self.constant_coefficient() == 0:
14431443
raise ZeroDivisionError("fmpz_mod_poly inverse_series_trunc: zero constant term")

src/flint/types/fq_default_poly.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ cdef class fq_default_poly(flint_poly):
12411241
cdef fq_default_poly res
12421242

12431243
if n < 1:
1244-
raise ValueError(f"{n = } must be positive")
1244+
raise ValueError(f"n = {n} must be positive")
12451245

12461246
if self.constant_coefficient().is_zero():
12471247
raise ZeroDivisionError("constant coefficient must be invertible")

src/flint/types/nmod_mat.pyx

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -179,39 +179,6 @@ cdef class nmod_mat_ctx:
179179
"""
180180
return self._is_prime
181181

182-
#def zero(self, slong m, slong n):
183-
# """Return the zero ``nmod_mat``.
184-
#
185-
# >>> ctx = nmod_mat_ctx.new(17)
186-
# >>> ctx.zero(2, 3)
187-
# [0, 0, 0]
188-
# [0, 0, 0]
189-
190-
# """
191-
# cdef nmod_mat r = self.new_nmod_mat()
192-
# nmod_mat_zero(r.val)
193-
# return r
194-
195-
#def one(self, slong m, slong n=-1):
196-
# """Return the one ``nmod_mat``.
197-
198-
# >>> ctx = nmod_mat_ctx.new(17)
199-
# >>> ctx.one(2)
200-
# [1, 0]
201-
# [0, 1]
202-
# >>> ctx.one(2, 3)
203-
# [1, 0, 0]
204-
# [0, 1, 0]
205-
206-
# """
207-
# cdef nmod_mat r = self.new_nmod_mat()
208-
# if n == -1:
209-
# n = m
210-
# n = min(m, n)
211-
# for i from 0 <= i < n:
212-
# nmod_mat_set_entry(r.val, i, i, 1)
213-
# return r
214-
215182
def __str__(self):
216183
return f"Context for nmod_mat with modulus: {self.mod.n}"
217184

@@ -421,7 +388,7 @@ cdef class nmod_mat(flint_mat):
421388
return t
422389
tv = &(<nmod_mat>t).val[0]
423390
if sv.mod.n != tv.mod.n:
424-
raise ValueError("cannot add nmod_mats with different moduli") # pragma: no cover
391+
raise ValueError("cannot add nmod_mats with different moduli") # pragma: no cover
425392
if sv.r != tv.r or sv.c != tv.c:
426393
raise ValueError("incompatible shapes for matrix addition")
427394
r = s.ctx.new_nmod_mat(sv.r, sv.c)
@@ -455,7 +422,7 @@ cdef class nmod_mat(flint_mat):
455422
return t
456423
tv = &(<nmod_mat>t).val[0]
457424
if sv.mod.n != tv.mod.n:
458-
raise ValueError("cannot subtract nmod_mats with different moduli") # pragma: no cover
425+
raise ValueError("cannot subtract nmod_mats with different moduli") # pragma: no cover
459426
if sv.r != tv.r or sv.c != tv.c:
460427
raise ValueError("incompatible shapes for matrix subtraction")
461428
r = s.ctx.new_nmod_mat(sv.r, sv.c)

src/flint/types/nmod_poly.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ cdef class nmod_poly(flint_poly):
389389
"""
390390
if n <= 0:
391391
raise ValueError(f"n = {n} must be positive")
392-
392+
393393
if nmod_poly_get_coeff_ui(self.val, 0) == 0:
394394
raise ZeroDivisionError("nmod_poly inverse_series_trunc: leading coefficient is zero")
395395

0 commit comments

Comments
 (0)