Skip to content

Commit

Permalink
fix and activate the ruff check for F811
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Jan 4, 2025
1 parent 1be0a58 commit 56cbf63
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/sage/algebras/weyl_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from sage.misc.latex import latex, LatexExpr
from sage.misc.lazy_attribute import lazy_attribute
from sage.misc.misc_c import prod
from sage.structure.element import Element
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.action import Action
Expand Down
1 change: 0 additions & 1 deletion src/sage/categories/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
from sage.categories.principal_ideal_domains import PrincipalIdealDomains
from sage.categories.euclidean_domains import EuclideanDomains
from sage.categories.unique_factorization_domains import UniqueFactorizationDomains
from sage.categories.complete_discrete_valuation import CompleteDiscreteValuationRings

from sage.categories.fields import Fields
from sage.categories.quotient_fields import QuotientFields
Expand Down
7 changes: 3 additions & 4 deletions src/sage/coding/guruswami_sudan/gs_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@
- David Lucas, ported the original implementation in Sage
"""

#*****************************************************************************
# ****************************************************************************
# Copyright (C) 2015 David Lucas <david.lucas@inria.fr>
# 2015 Johan S. R. Nielsen <jsrn@jsrn.dk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# http://www.gnu.org/licenses/
#*****************************************************************************
# https://www.gnu.org/licenses/
# ****************************************************************************

from sage.arith.misc import integer_floor as floor
from sage.coding.grs_code import GeneralizedReedSolomonCode
from sage.rings.integer_ring import ZZ
from sage.coding.decoder import Decoder
Expand Down
1 change: 0 additions & 1 deletion src/sage/modules/with_basis/representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from sage.misc.cachefunc import cached_method
from sage.structure.element import Element
from sage.combinat.free_module import CombinatorialFreeModule, CombinatorialFreeModule_Tensor
from sage.modules.with_basis.subquotient import SubmoduleWithBasis
from sage.categories.modules import Modules
from sage.matrix.constructor import matrix
from sage.modules.free_module_element import vector
Expand Down
3 changes: 1 addition & 2 deletions src/sage/rings/finite_rings/integer_mod_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
from sage.arith.misc import CRT_basis
from sage.rings.ring import Field, CommutativeRing
from sage.misc.mrange import cartesian_product_iterator
import sage.rings.ring as ring
import sage.rings.abc
from sage.rings.finite_rings import integer_mod
import sage.rings.integer as integer
Expand Down Expand Up @@ -2030,7 +2029,7 @@ def crt(v):
1027
"""
if len(v) == 0:
return IntegerModRing(1)(1)
return IntegerModRing(1).one()
x = v[0]
for i in range(1, len(v)):
x = x.crt(v[i])
Expand Down
1 change: 0 additions & 1 deletion src/sage/rings/polynomial/polynomial_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ def is_PolynomialRing(x):
sage: type(R)
<class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular'>
"""
from sage.misc.superseded import deprecation
deprecation(38266,
"The function is_PolynomialRing is deprecated; "
"use 'isinstance(..., PolynomialRing_generic)' instead.")
Expand Down
1 change: 0 additions & 1 deletion src/sage/schemes/curves/affine_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@
from sage.rings.polynomial.multi_polynomial_element import degree_lowest_rational_function
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.rational_field import RationalField
from sage.rings.infinity import infinity

from sage.schemes.affine.affine_space import AffineSpace, AffineSpace_generic
from sage.schemes.affine.affine_subscheme import (AlgebraicScheme_subscheme_affine,
Expand Down
2 changes: 0 additions & 2 deletions src/sage/schemes/elliptic_curves/ell_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,8 @@
from sage.rings.integer_ring import ZZ
from sage.rings.padics.precision_error import PrecisionError
from sage.rings.rational_field import QQ
from sage.rings.finite_rings.integer_mod import Mod
from sage.rings.real_mpfr import RealField, RR
from sage.rings.quotient_ring import QuotientRing_generic
import sage.groups.generic as generic

from sage.structure.element import AdditiveGroupElement
from sage.structure.sequence import Sequence
Expand Down
4 changes: 1 addition & 3 deletions src/sage/symbolic/expression_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from sage.misc.lazy_import import lazy_import
from sage.symbolic.ring import SR
from sage.structure.element import Expression
from sage.functions.all import exp
from sage.functions.log import exp
from sage.symbolic.operators import arithmetic_operators, relation_operators, FDerivativeOperator, add_vararg, mul_vararg
from sage.rings.number_field.number_field_element_base import NumberFieldElement_base
from sage.rings.universal_cyclotomic_field import UniversalCyclotomicField
Expand Down Expand Up @@ -1651,7 +1651,6 @@ class Exponentialize(ExpressionTreeWalker):
# the same canned results dictionary at each call.
from sage.calculus.var import function
from sage.functions.hyperbolic import sinh, cosh, sech, csch, tanh, coth
from sage.functions.log import exp
from sage.functions.trig import sin, cos, sec, csc, tan, cot
from sage.rings.integer import Integer
from sage.symbolic.constants import e, I
Expand Down Expand Up @@ -1749,7 +1748,6 @@ def composition(self, ex, op):
sage: s.composition(q, q.operator())
(cos(b) + I*sin(b))*e^a
"""
from sage.functions.log import exp
if op is not exp:
# return super().composition(ex, op)
return op(*[self(oper) for oper in ex.operands()])
Expand Down
2 changes: 1 addition & 1 deletion src/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ passenv = RUFF_OUTPUT_FORMAT
# 1 F402 [ ] Import `factor` from line 259 shadowed by loop variable
# 1 PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
#
commands = ruff check --ignore E402,E721,E731,E741,E742,E743,F401,F402,F403,F405,F811,F821,F841,I001,PLC0206,PLC0208,PLC2401,PLC3002,PLE0302,PLR0124,PLR0402,PLR0911,PLR0912,PLR0913,PLR0915,PLR1704,PLR1711,PLR1714,PLR1736,PLR2004,PLR5501,PLW0120,PLW0127,PLW0211,PLW0602,PLW0603,PLW0642,PLW1508,PLW1510,PLW2901,PLW3301 {posargs:{toxinidir}/sage/}
commands = ruff check --ignore E402,E721,E731,E741,E742,E743,F401,F402,F403,F405,F821,F841,I001,PLC0206,PLC0208,PLC2401,PLC3002,PLE0302,PLR0124,PLR0402,PLR0911,PLR0912,PLR0913,PLR0915,PLR1704,PLR1711,PLR1714,PLR1736,PLR2004,PLR5501,PLW0120,PLW0127,PLW0211,PLW0602,PLW0603,PLW0642,PLW1508,PLW1510,PLW2901,PLW3301 {posargs:{toxinidir}/sage/}

[flake8]
rst-roles =
Expand Down

0 comments on commit 56cbf63

Please sign in to comment.