Skip to content

Commit ca14688

Browse files
committed
cython-lint : removed many unused imports in rings/
1 parent 3202f65 commit ca14688

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+78
-183
lines changed

src/sage/rings/complex_arb.pyx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ import sage.categories.fields
153153
cimport sage.rings.abc
154154
cimport sage.rings.rational
155155

156-
from cpython.float cimport PyFloat_AS_DOUBLE
157156
from cpython.int cimport PyInt_AS_LONG
158157
from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
159158
from cpython.complex cimport PyComplex_FromDoubles
@@ -169,13 +168,13 @@ from sage.libs.arb.acb_hypgeom cimport *
169168
from sage.libs.arb.acb_elliptic cimport *
170169
from sage.libs.arb.acb_modular cimport *
171170
from sage.libs.arb.acb_poly cimport *
172-
from sage.libs.arb.arf cimport arf_init, arf_get_d, arf_get_mpfr, arf_set_mpfr, arf_clear, arf_set_mag, arf_set, arf_is_nan
173-
from sage.libs.arb.mag cimport (mag_init, mag_clear, mag_add, mag_set_d,
174-
MAG_BITS, mag_is_inf, mag_is_finite, mag_zero, mag_set_ui_2exp_si,
171+
from sage.libs.arb.arf cimport arf_init, arf_get_d, arf_get_mpfr, arf_clear, arf_set, arf_is_nan
172+
from sage.libs.arb.mag cimport (mag_init, mag_clear, mag_set_d,
173+
MAG_BITS, mag_zero, mag_set_ui_2exp_si,
175174
mag_mul_2exp_si)
176-
from sage.libs.flint.fmpz cimport fmpz_t, fmpz_init, fmpz_get_mpz, fmpz_set_mpz, fmpz_clear, fmpz_abs
175+
from sage.libs.flint.fmpz cimport fmpz_t, fmpz_init, fmpz_get_mpz, fmpz_set_mpz, fmpz_clear
177176
from sage.libs.flint.fmpq cimport fmpq_t, fmpq_init, fmpq_set_mpq, fmpq_clear
178-
from sage.libs.gmp.mpz cimport mpz_fits_ulong_p, mpz_fits_slong_p, mpz_get_ui, mpz_get_si, mpz_sgn
177+
from sage.libs.gmp.mpz cimport mpz_fits_slong_p, mpz_get_si
179178
from sage.libs.gsl.complex cimport gsl_complex_rect
180179
from sage.rings.real_double cimport RealDoubleElement
181180
from sage.rings.complex_double cimport ComplexDoubleElement
@@ -186,13 +185,12 @@ from sage.rings.real_arb import RealBallField
186185
from sage.rings.real_mpfi cimport RealIntervalField_class
187186
from sage.rings.real_mpfr cimport RealField_class, RealField, RealNumber
188187
from sage.rings.ring import Field
189-
from sage.structure.element cimport Element, ModuleElement
188+
from sage.structure.element cimport Element
190189
from sage.structure.unique_representation import UniqueRepresentation
191190
from sage.arith.long cimport is_small_python_int
192191

193192
from sage.misc.lazy_string import lazy_string
194193
from sage.misc.superseded import deprecated_function_alias
195-
from sage.rings.complex_mpfr import ComplexField
196194
from sage.rings.complex_interval_field import ComplexIntervalField, ComplexIntervalField_class
197195
from sage.rings.integer_ring import ZZ
198196

src/sage/rings/complex_double.pyx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ AUTHORS:
6868
# https://www.gnu.org/licenses/
6969
# ****************************************************************************
7070

71-
import operator
7271
from cpython.object cimport Py_NE
7372

7473
from sage.misc.randstate cimport randstate, current_randstate
@@ -83,7 +82,7 @@ import sage.rings.abc
8382
cimport sage.rings.ring
8483
cimport sage.rings.integer
8584

86-
from sage.structure.element cimport RingElement, Element, ModuleElement, FieldElement
85+
from sage.structure.element cimport Element, FieldElement
8786
from sage.structure.parent cimport Parent
8887
from sage.structure.parent_gens import ParentWithGens
8988
from sage.structure.richcmp cimport rich_to_bool

src/sage/rings/complex_interval.pyx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,12 @@ from sage.libs.flint.fmpz cimport *
6464
from sage.libs.mpfr cimport MPFR_RNDU, MPFR_RNDD
6565
from sage.arith.constants cimport LOG_TEN_TWO_PLUS_EPSILON
6666

67-
from sage.structure.element cimport FieldElement, RingElement, Element, ModuleElement
67+
from sage.structure.element cimport FieldElement
6868
from sage.structure.parent cimport Parent
6969
from .complex_mpfr cimport ComplexNumber
70-
from .complex_mpfr import ComplexField
7170
from sage.rings.integer cimport Integer
7271
cimport sage.rings.real_mpfi as real_mpfi
73-
from .real_mpfr cimport RealNumber, RealField
72+
from .real_mpfr cimport RealNumber
7473
from .convert.mpfi cimport mpfi_set_sage
7574
from .infinity import infinity
7675

@@ -90,7 +89,7 @@ def is_ComplexIntervalFieldElement(x):
9089
return isinstance(x, ComplexIntervalFieldElement)
9190

9291

93-
cdef class ComplexIntervalFieldElement(sage.structure.element.FieldElement):
92+
cdef class ComplexIntervalFieldElement(FieldElement):
9493
"""
9594
A complex interval.
9695

src/sage/rings/complex_mpc.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ from sage.libs.mpfr cimport *
6969
from sage.libs.mpc cimport *
7070
from sage.structure.parent cimport Parent
7171
from sage.structure.parent_gens cimport ParentWithGens
72-
from sage.structure.element cimport RingElement, Element, ModuleElement
72+
from sage.structure.element cimport Element
7373
from sage.structure.richcmp cimport rich_to_bool
7474
from sage.categories.map cimport Map
7575
from sage.libs.pari.all import pari
@@ -2578,5 +2578,5 @@ cdef class CCtoMPC(Map):
25782578

25792579

25802580
# Support Python's numbers abstract base class
2581-
import numbers
2581+
# import numbers
25822582
from sage.rings.complex_mpc import MPComplexNumber

src/sage/rings/complex_mpfr.pyx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,13 @@ AUTHORS:
3030
# https://www.gnu.org/licenses/
3131
# ****************************************************************************
3232

33-
import math
34-
import operator
3533
import weakref
3634

3735
import sage.misc.misc
3836

3937
from sage.libs.mpfr cimport *
4038

41-
from sage.structure.element cimport FieldElement, RingElement, Element, ModuleElement
39+
from sage.structure.element cimport RingElement, Element
4240
from sage.structure.richcmp cimport rich_to_bool
4341
from sage.categories.map cimport Map
4442
from sage.structure.parent import Parent
@@ -48,7 +46,7 @@ from sage.misc.sage_eval import sage_eval
4846

4947
import sage.rings.abc
5048
from sage.arith.constants cimport LOG_TEN_TWO_PLUS_EPSILON
51-
from . import ring, infinity
49+
from . import infinity
5250
from .integer cimport Integer
5351

5452
from .complex_double cimport ComplexDoubleElement

src/sage/rings/factorint.pyx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AUTHORS:
88
99
"""
1010

11-
#*****************************************************************************
11+
# ****************************************************************************
1212
# Copyright (C) 2010-2011 André Apitzsch <[email protected]>
1313
# 2012 Nils Bruin
1414
# 2014 David Roe
@@ -17,16 +17,14 @@ AUTHORS:
1717
# Distributed under the terms of the GNU General Public License (GPL)
1818
# as published by the Free Software Foundation; either version 2 of
1919
# the License, or (at your option) any later version.
20-
# http://www.gnu.org/licenses/
21-
#*****************************************************************************
20+
# https://www.gnu.org/licenses/
21+
# ****************************************************************************
2222

2323
from sage.ext.stdsage cimport PY_NEW
2424
from sage.libs.gmp.mpz cimport *
2525

2626
from sage.rings.integer cimport Integer
27-
from sage.rings.fast_arith import prime_range
2827
from sage.structure.factorization_integer import IntegerFactorization
29-
from math import floor
3028
from sage.misc.misc_c import prod
3129

3230
cdef extern from "limits.h":

src/sage/rings/finite_rings/element_base.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,6 @@ cdef class FinitePolyExtElement(FiniteRingElement):
505505
"""
506506
if var is None:
507507
var = self.parent().variable_name()
508-
from sage.libs.pari.all import pari
509508
ffgen = self._parent.modulus()._pari_with_name(var).ffgen()
510509
polypari = self.polynomial()._pari_with_name()
511510
# Add ffgen - ffgen to ensure that we really get an FFELT

src/sage/rings/finite_rings/element_givaro.pyx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,16 @@ from cysignals.signals cimport sig_on, sig_off
5656

5757
from cypari2.paridecl cimport *
5858

59-
from sage.misc.randstate cimport randstate, current_randstate
60-
from sage.rings.finite_rings.finite_field_base cimport FiniteField
61-
from sage.rings.ring cimport Ring
59+
from sage.misc.randstate cimport current_randstate
6260
from .element_pari_ffelt cimport FiniteFieldElement_pari_ffelt
6361
from sage.structure.richcmp cimport richcmp
64-
from sage.structure.element cimport Element, ModuleElement, RingElement
65-
import operator
6662
import sage.arith.all
67-
import sage.rings.finite_rings.finite_field_constructor as finite_field
6863

69-
from sage.libs.pari.all import pari
7064
from cypari2.gen cimport Gen
7165
from cypari2.stack cimport clear_stack
7266

7367
from sage.structure.parent cimport Parent
7468

75-
7669
from sage.interfaces.abc import GapElement
7770

7871
cdef object is_IntegerMod
@@ -1579,7 +1572,6 @@ cdef class FiniteField_givaroElement(FinitePolyExtElement):
15791572
"""
15801573
# TODO -- I'm sure this can be made vastly faster
15811574
# using how elements are represented as a power of the generator ??
1582-
import sage.arith.all
15831575

15841576
if self._multiplicative_order is not None:
15851577
return self._multiplicative_order

src/sage/rings/finite_rings/element_ntl_gf2e.pyx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,18 @@ from cypari2.paridecl cimport *
3434

3535
from sage.structure.richcmp cimport (richcmp,
3636
richcmp_not_equal, rich_to_bool)
37-
from sage.structure.element cimport Element, ModuleElement, RingElement
3837

3938
from sage.structure.parent cimport Parent
4039

41-
from sage.rings.ring cimport Ring
42-
4340
from sage.rings.finite_rings.finite_field_base cimport FiniteField
4441

4542
from sage.libs.pari.all import pari
4643
from cypari2.gen cimport Gen
4744
from cypari2.stack cimport clear_stack
4845

49-
from sage.misc.randstate import current_randstate
50-
from sage.arith.long cimport pyobject_to_long
51-
5246
from .element_pari_ffelt import FiniteFieldElement_pari_ffelt
5347
from .finite_field_ntl_gf2e import FiniteField_ntl_gf2e
5448

55-
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
56-
5749
from sage.interfaces.abc import GapElement
5850

5951

src/sage/rings/finite_rings/element_pari_ffelt.pyx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ AUTHORS:
1616
# https://www.gnu.org/licenses/
1717
# ****************************************************************************
1818

19-
from cysignals.memory cimport sig_free
2019
from cysignals.signals cimport sig_on, sig_off
2120

2221
from cypari2.paridecl cimport *
@@ -34,7 +33,6 @@ from sage.rings.integer cimport Integer
3433
from sage.rings.polynomial.polynomial_element import Polynomial
3534
from sage.rings.polynomial.multi_polynomial_element import MPolynomial
3635
from sage.rings.rational import Rational
37-
from sage.structure.element cimport Element, ModuleElement, RingElement
3836
from sage.structure.richcmp cimport rich_to_bool
3937

4038

0 commit comments

Comments
 (0)