Skip to content

Commit 9c83f60

Browse files
author
Release Manager
committed
gh-35721: cython-lint for imports in rings (mostly in padics) <!-- Please provide a concise, informative and self-explanatory title. --> <!-- Don't put issue numbers in the title. Put it in the Description below. --> <!-- For example, instead of "Fixes #12345", use "Add a new method to multiply two integers" --> ### 📚 Description fix remaining cython-lint warnings about unused imports in `rings` <!-- Describe your changes here in detail. --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x ]`. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #35721 Reported by: Frédéric Chapoton Reviewer(s): Matthias Köppe
2 parents 5c9ee29 + f1546c0 commit 9c83f60

13 files changed

+34
-76
lines changed

src/sage/rings/finite_rings/element_ntl_gf2e.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ AUTHORS:
1515
- Martin Albrecht <malb@informatik.uni-bremen.de> (2007-10)
1616
"""
1717

18-
#*****************************************************************************
18+
# ****************************************************************************
1919
# Copyright (C) 2007 Martin Albrecht <[email protected]>
2020
#
2121
# This program is free software: you can redistribute it and/or modify
2222
# it under the terms of the GNU General Public License as published by
2323
# the Free Software Foundation, either version 2 of the License, or
2424
# (at your option) any later version.
25-
# http://www.gnu.org/licenses/
26-
#*****************************************************************************
25+
# https://www.gnu.org/licenses/
26+
# ****************************************************************************
2727

2828
from cysignals.memory cimport check_malloc, sig_free
29-
from cysignals.signals cimport sig_on, sig_off
29+
from cysignals.signals cimport sig_on
3030
from sage.ext.cplusplus cimport ccrepr, ccreadstr
3131

3232
include "sage/libs/ntl/decl.pxi"

src/sage/rings/padics/local_generic_element.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AUTHORS:
2323
# ****************************************************************************
2424

2525
from sage.rings.infinity import infinity
26-
from sage.structure.element cimport ModuleElement, RingElement, CommutativeRingElement
26+
from sage.structure.element cimport CommutativeRingElement
2727
from sage.structure.element import coerce_binop
2828
from itertools import islice
2929

src/sage/rings/padics/morphism.pyx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,27 @@
11
"""
22
Frobenius endomorphisms on p-adic fields
33
"""
4-
5-
#*****************************************************************************
4+
# ****************************************************************************
65
# Copyright (C) 2013 Xavier Caruso <[email protected]>
76
#
87
# This program is free software: you can redistribute it and/or modify
98
# it under the terms of the GNU General Public License as published by
109
# the Free Software Foundation, either version 2 of the License, or
1110
# (at your option) any later version.
12-
# http://www.gnu.org/licenses/
13-
#*****************************************************************************
11+
# https://www.gnu.org/licenses/
12+
# ****************************************************************************
1413

1514
from sage.rings.integer cimport Integer
1615
from sage.rings.infinity import Infinity
1716

18-
from sage.rings.ring import CommutativeRing
1917
from sage.categories.homset import Hom
2018
from sage.structure.element cimport Element
2119
from sage.structure.richcmp cimport (richcmp, rich_to_bool,
22-
richcmp_not_equal)
20+
richcmp_not_equal)
2321

2422
from sage.rings.morphism cimport RingHomomorphism
2523
from .padic_generic import pAdicGeneric
2624

27-
from sage.categories.morphism cimport Morphism
28-
2925

3026
cdef class FrobeniusEndomorphism_padics(RingHomomorphism):
3127
"""

src/sage/rings/padics/padic_ZZ_pX_CA_element.pyx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ from sage.libs.ntl.ntl_ZZX cimport ntl_ZZX
175175
from sage.libs.ntl.ntl_ZZ cimport ntl_ZZ
176176
from sage.libs.ntl.ntl_ZZ_p cimport ntl_ZZ_p
177177
from sage.libs.ntl.ntl_ZZ_pContext cimport ntl_ZZ_pContext_class
178-
from sage.libs.ntl.ntl_ZZ_pContext import ntl_ZZ_pContext
179178
from sage.rings.padics.padic_generic_element cimport pAdicGenericElement
180179
from sage.libs.pari.all import pari_gen
181180
from sage.interfaces.abc import GpElement
@@ -184,10 +183,6 @@ from sage.rings.finite_rings.integer_mod_ring import IntegerModRing
184183
from sage.rings.padics.padic_ext_element cimport pAdicExtElement
185184
from sage.rings.padics.precision_error import PrecisionError
186185

187-
from sage.rings.padics.pow_computer_ext cimport PowComputer_ZZ_pX
188-
from sage.rings.padics.pow_computer_ext cimport PowComputer_ZZ_pX_small_Eis
189-
from sage.rings.padics.pow_computer_ext cimport PowComputer_ZZ_pX_big_Eis
190-
191186
cdef object infinity
192187
from sage.rings.infinity import infinity
193188

src/sage/rings/padics/padic_ZZ_pX_CR_element.pyx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ AUTHORS:
176176
- Julian Rueth (2014-05-09): enable caching through ``_cache_key``
177177
178178
"""
179-
180-
#*****************************************************************************
179+
# ****************************************************************************
181180
# Copyright (C) 2008 David Roe <[email protected]>
182181
# William Stein <[email protected]>
183182
# 2014 Julian Rueth <[email protected]>
@@ -186,8 +185,8 @@ AUTHORS:
186185
# as published by the Free Software Foundation; either version 2 of
187186
# the License, or (at your option) any later version.
188187
#
189-
# http://www.gnu.org/licenses/
190-
#*****************************************************************************
188+
# https://www.gnu.org/licenses/
189+
# ****************************************************************************
191190

192191
from cysignals.signals cimport sig_on, sig_off
193192
from sage.ext.stdsage cimport PY_NEW
@@ -201,21 +200,16 @@ from sage.libs.ntl.ntl_ZZX cimport ntl_ZZX
201200
from sage.libs.ntl.ntl_ZZ cimport ntl_ZZ
202201
from sage.libs.ntl.ntl_ZZ_p cimport ntl_ZZ_p
203202
from sage.libs.ntl.ntl_ZZ_pContext cimport ntl_ZZ_pContext_class
204-
from sage.libs.ntl.ntl_ZZ_pContext import ntl_ZZ_pContext
205203
from sage.rings.padics.padic_generic_element cimport pAdicGenericElement
206204
from sage.libs.pari.all import pari_gen
207205
from sage.interfaces.abc import GpElement
208206
from sage.rings.finite_rings.integer_mod import is_IntegerMod
209207
from sage.rings.padics.padic_ext_element cimport pAdicExtElement
210208
from sage.rings.padics.precision_error import PrecisionError
211209

212-
from sage.rings.padics.pow_computer_ext cimport PowComputer_ZZ_pX
213210
from sage.rings.padics.pow_computer_ext cimport PowComputer_ZZ_pX_small_Eis
214211
from sage.rings.padics.pow_computer_ext cimport PowComputer_ZZ_pX_big_Eis
215212
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing
216-
from sage.rings.padics.unramified_extension_generic import UnramifiedExtensionGeneric
217-
218-
from sage.rings.real_double cimport RealDoubleElement
219213

220214
cdef object infinity
221215
from sage.rings.infinity import infinity

src/sage/rings/padics/padic_ZZ_pX_FM_element.pyx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,27 +113,22 @@ AUTHORS:
113113
114114
- David Roe (2008-01-01) initial version
115115
"""
116-
117-
#*****************************************************************************
116+
# ****************************************************************************
118117
# Copyright (C) 2008 David Roe <[email protected]>
119118
# William Stein <[email protected]>
120119
#
121120
# Distributed under the terms of the GNU General Public License (GPL)
122121
# as published by the Free Software Foundation; either version 2 of
123122
# the License, or (at your option) any later version.
124123
#
125-
# http://www.gnu.org/licenses/
126-
#*****************************************************************************
124+
# https://www.gnu.org/licenses/
125+
# ****************************************************************************
127126

128127
from cysignals.signals cimport sig_on, sig_off
129128

130129
include "sage/libs/ntl/decl.pxi"
131130

132131
from sage.structure.richcmp cimport rich_to_bool
133-
from sage.structure.element cimport Element
134-
from sage.rings.padics.padic_printing cimport pAdicPrinter_class
135-
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
136-
from sage.rings.integer_ring import ZZ
137132
from sage.rings.integer cimport Integer
138133
from sage.rings.padics.padic_generic_element cimport pAdicGenericElement
139134
from sage.rings.padics.padic_ext_element cimport pAdicExtElement
@@ -144,13 +139,11 @@ from sage.libs.ntl.ntl_ZZX cimport ntl_ZZX
144139
from sage.libs.ntl.ntl_ZZ cimport ntl_ZZ
145140
from sage.libs.ntl.ntl_ZZ_p cimport ntl_ZZ_p
146141
from sage.libs.ntl.ntl_ZZ_pContext cimport ntl_ZZ_pContext_class
147-
from sage.libs.ntl.ntl_ZZ_pContext import ntl_ZZ_pContext
148142
from sage.rings.rational cimport Rational
149143
from sage.libs.pari.all import pari_gen
150144
from sage.interfaces.abc import GpElement
151145
from sage.rings.finite_rings.integer_mod import is_IntegerMod
152146
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing
153-
from sage.rings.padics.pow_computer_ext cimport PowComputer_ZZ_pX_FM_Eis
154147

155148

156149
cdef class pAdicZZpXFMElement(pAdicZZpXElement):

src/sage/rings/padics/padic_ext_element.pyx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,18 @@ AUTHORS:
1616
1717
- Julian Rueth (2012-10-18): added residue
1818
"""
19-
20-
#*****************************************************************************
19+
# ****************************************************************************
2120
# Copyright (C) 2007-2010 David Roe <[email protected]>
2221
# 2012 Julian Rueth <[email protected]>
2322
#
2423
# Distributed under the terms of the GNU General Public License (GPL)
2524
# as published by the Free Software Foundation; either version 2 of
2625
# the License, or (at your option) any later version.
2726
#
28-
# http://www.gnu.org/licenses/
29-
#*****************************************************************************
27+
# https://www.gnu.org/licenses/
28+
# ****************************************************************************
3029

3130
from sage.rings.padics.pow_computer cimport PowComputer_class
32-
from sage.rings.integer import Integer
3331
from sage.libs.ntl.ntl_ZZ_p cimport ntl_ZZ_p
3432

3533
cdef class pAdicExtElement(pAdicGenericElement):

src/sage/rings/padics/padic_generic_element.pyx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ AUTHORS:
1414
- Julian Rueth: fixes for exp() and log(), implemented gcd, xgcd
1515
1616
"""
17-
18-
#*****************************************************************************
17+
# ****************************************************************************
1918
# Copyright (C) 2007-2013 David Roe <[email protected]>
2019
# 2007 William Stein <[email protected]>
2120
# 2013-2014 Julian Rueth <[email protected]>
@@ -24,11 +23,10 @@ AUTHORS:
2423
# as published by the Free Software Foundation; either version 2 of
2524
# the License, or (at your option) any later version.
2625
#
27-
# http://www.gnu.org/licenses/
28-
#*****************************************************************************
26+
# https://www.gnu.org/licenses/
27+
# ****************************************************************************
2928

3029
from sage.ext.stdsage cimport PY_NEW
31-
from cysignals.memory cimport sig_malloc, sig_free
3230

3331
cimport sage.rings.padics.local_generic_element
3432
from sage.libs.gmp.mpz cimport mpz_set_si

src/sage/rings/padics/pow_computer_ext.pyx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,16 @@ AUTHORS:
4242
4343
- David Roe (2008-01-01) initial version
4444
"""
45-
46-
#*****************************************************************************
45+
# ****************************************************************************
4746
# Copyright (C) 2008 David Roe <[email protected]>
4847
# William Stein <[email protected]>
4948
#
5049
# Distributed under the terms of the GNU General Public License (GPL)
5150
# as published by the Free Software Foundation; either version 2 of
5251
# the License, or (at your option) any later version.
5352
#
54-
# http://www.gnu.org/licenses/
55-
#*****************************************************************************
53+
# https://www.gnu.org/licenses/
54+
# ****************************************************************************
5655

5756
from cpython.list cimport *
5857
from cpython.dict cimport *
@@ -61,9 +60,7 @@ from cysignals.signals cimport sig_on, sig_off
6160

6261
include "sage/libs/ntl/decl.pxi"
6362

64-
import weakref
6563
from sage.misc.misc import cputime
66-
from sage.rings.infinity import infinity
6764
from sage.libs.gmp.mpz cimport *
6865
from sage.libs.ntl.ntl_ZZ_pContext cimport ntl_ZZ_pContext_factory
6966
from sage.libs.ntl.ntl_ZZ_pContext import ZZ_pContext_factory

src/sage/rings/padics/pow_computer_relative.pyx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,21 @@ AUTHORS:
1717
- David Roe, Julian Rüth (2017-06-11): initial version
1818
1919
"""
20-
#*****************************************************************************
20+
# ****************************************************************************
2121
# Copyright (C) 2017 David Roe <[email protected]>
2222
# 2017 Julian Rüth <[email protected]>
2323
#
2424
# Distributed under the terms of the GNU General Public License (GPL)
2525
# as published by the Free Software Foundation; either version 2 of
2626
# the License, or (at your option) any later version.
2727
#
28-
# http://www.gnu.org/licenses/
29-
#*****************************************************************************
28+
# https://www.gnu.org/licenses/
29+
# ****************************************************************************
3030

31-
from cysignals.memory cimport sig_malloc, sig_free
32-
from cysignals.signals cimport sig_on, sig_off
33-
34-
from sage.libs.gmp.mpz cimport mpz_init, mpz_clear, mpz_pow_ui
35-
36-
from cpython.object cimport Py_EQ, Py_NE
3731
from sage.rings.integer cimport Integer
38-
from sage.rings.integer_ring import ZZ
3932
from sage.misc.cachefunc import cached_method
4033

34+
4135
cdef class PowComputer_relative(PowComputer_class):
4236
r"""
4337
Base class for a ``PowComputer`` for use in `p`-adics implemented by Sage

0 commit comments

Comments
 (0)