diff --git a/src/sage/algebras/weyl_algebra.py b/src/sage/algebras/weyl_algebra.py index dc7cbef3058..b5554d901f5 100644 --- a/src/sage/algebras/weyl_algebra.py +++ b/src/sage/algebras/weyl_algebra.py @@ -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 diff --git a/src/sage/categories/basic.py b/src/sage/categories/basic.py index cfc385513cb..30c4b0fa9e7 100644 --- a/src/sage/categories/basic.py +++ b/src/sage/categories/basic.py @@ -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 diff --git a/src/sage/coding/guruswami_sudan/gs_decoder.py b/src/sage/coding/guruswami_sudan/gs_decoder.py index e909c3a0bf3..3df7b5c1884 100644 --- a/src/sage/coding/guruswami_sudan/gs_decoder.py +++ b/src/sage/coding/guruswami_sudan/gs_decoder.py @@ -14,7 +14,7 @@ - David Lucas, ported the original implementation in Sage """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2015 David Lucas # 2015 Johan S. R. Nielsen # @@ -22,10 +22,9 @@ # 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 diff --git a/src/sage/modules/with_basis/representation.py b/src/sage/modules/with_basis/representation.py index 3bdcc165692..61e65409e21 100644 --- a/src/sage/modules/with_basis/representation.py +++ b/src/sage/modules/with_basis/representation.py @@ -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 diff --git a/src/sage/rings/finite_rings/integer_mod_ring.py b/src/sage/rings/finite_rings/integer_mod_ring.py index 893fde4e929..6d5b7c6b36c 100644 --- a/src/sage/rings/finite_rings/integer_mod_ring.py +++ b/src/sage/rings/finite_rings/integer_mod_ring.py @@ -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 @@ -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]) diff --git a/src/sage/rings/polynomial/polynomial_ring.py b/src/sage/rings/polynomial/polynomial_ring.py index ddb7537526a..82d8eae3361 100644 --- a/src/sage/rings/polynomial/polynomial_ring.py +++ b/src/sage/rings/polynomial/polynomial_ring.py @@ -230,7 +230,6 @@ def is_PolynomialRing(x): sage: type(R) """ - from sage.misc.superseded import deprecation deprecation(38266, "The function is_PolynomialRing is deprecated; " "use 'isinstance(..., PolynomialRing_generic)' instead.") diff --git a/src/sage/schemes/curves/affine_curve.py b/src/sage/schemes/curves/affine_curve.py index 0b647c8411b..127530a9bb7 100644 --- a/src/sage/schemes/curves/affine_curve.py +++ b/src/sage/schemes/curves/affine_curve.py @@ -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, diff --git a/src/sage/schemes/elliptic_curves/ell_point.py b/src/sage/schemes/elliptic_curves/ell_point.py index d05196240a1..9bac016fe3a 100644 --- a/src/sage/schemes/elliptic_curves/ell_point.py +++ b/src/sage/schemes/elliptic_curves/ell_point.py @@ -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 diff --git a/src/sage/symbolic/expression_conversions.py b/src/sage/symbolic/expression_conversions.py index 2d59c66293c..0a2b25d4a8a 100644 --- a/src/sage/symbolic/expression_conversions.py +++ b/src/sage/symbolic/expression_conversions.py @@ -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 @@ -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 @@ -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()]) diff --git a/src/tox.ini b/src/tox.ini index d99936f09a9..29dd3fcaa15 100644 --- a/src/tox.ini +++ b/src/tox.ini @@ -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 =