Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 3590a19

Browse files
alexchandler100Matthias Koeppe
authored and
Matthias Koeppe
committed
sage -fiximports src/sage/{coding,groups}
1 parent 047281e commit 3590a19

22 files changed

+53
-38
lines changed

src/sage/coding/bch_code.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
from sage.modules.free_module_element import vector
2828
from sage.misc.misc_c import prod
2929
from sage.categories.fields import Fields
30-
from sage.arith.all import gcd
31-
from sage.rings.all import Zmod
30+
from sage.arith.misc import GCD as gcd
31+
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Zmod
3232

3333
from .cyclic_code import CyclicCode
3434
from .grs_code import GeneralizedReedSolomonCode

src/sage/coding/binary_code.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4103,7 +4103,7 @@ cdef class BinaryCodeClassifier:
41034103
m = BinaryCode(matrix(ZZ, rs))
41044104

41054105
m_aut_gp_gens, m_labeling, m_size, m_base = self._aut_gp_and_can_label(m)
4106-
from sage.arith.all import factorial
4106+
from sage.arith.misc import factorial
41074107
if True: # size*factorial(n-B.ncols) == m_size:
41084108

41094109
if len(m_aut_gp_gens) == 0:

src/sage/coding/code_bounds.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,12 @@
174174
# ****************************************************************************
175175

176176
from sage.libs.gap.libgap import libgap
177-
from sage.rings.all import QQ, RR, ZZ, RDF
177+
from sage.rings.rational_field import Q as QQ
178+
from sage.rings.real_mpfr import RR
179+
from sage.rings.integer_ring import Z as ZZ
180+
from sage.rings.real_double import RDF
178181
from sage.arith.misc import is_prime_power
179-
from sage.arith.all import binomial
182+
from sage.arith.misc import binomial
180183
from sage.misc.functional import sqrt, log
181184
from .delsarte_bounds import (delsarte_bound_hamming_space,
182185
delsarte_bound_additive_hamming_space)

src/sage/coding/code_constructions.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
# ****************************************************************************
4242

4343
from sage.misc.misc_c import prod
44-
from sage.arith.all import quadratic_residues, gcd
44+
from sage.arith.misc import quadratic_residues
45+
from sage.arith.misc import GCD as gcd
4546

4647
from sage.structure.sequence import Sequence, Sequence_generic
4748

@@ -748,7 +749,7 @@ def ToricCode(P,F):
748749
749750
- David Joyner (07-2006)
750751
"""
751-
from sage.combinat.all import Tuples
752+
from sage.combinat.tuple import Tuples
752753
mset = [x for x in F if x != 0]
753754
d = len(P[0])
754755
pts = Tuples(mset, d).list()

src/sage/coding/cyclic_code.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
from copy import copy
4242
from sage.rings.integer import Integer
4343
from sage.categories.homset import Hom
44-
from sage.arith.all import gcd
44+
from sage.arith.misc import GCD as gcd
4545
from sage.modules.free_module_element import vector
4646
from sage.matrix.constructor import matrix
4747
from sage.misc.cachefunc import cached_method
48-
from sage.rings.all import Zmod
48+
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Zmod
4949

5050

5151
def find_generator_polynomial(code, check=True):

src/sage/coding/delsarte_bounds.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def krawtchouk(n, q, l, x, check=True):
102102
...
103103
TypeError: no conversion of this rational to integer
104104
"""
105-
from sage.arith.all import binomial
105+
from sage.arith.misc import binomial
106106
from sage.arith.srange import srange
107107
# Use the expression in equation (55) of MacWilliams & Sloane, pg 151
108108
# We write jth term = some_factor * (j-1)th term
@@ -171,7 +171,7 @@ def eberlein(n, w, k, u, check=True):
171171
TypeError: either m or x-m must be an integer
172172
173173
"""
174-
from sage.arith.all import binomial
174+
from sage.arith.misc import binomial
175175
from sage.arith.srange import srange
176176

177177
if 2*w > n:
@@ -275,7 +275,7 @@ def _delsarte_cwc_LP_building(n, d, w, solver, isinteger):
275275
276276
"""
277277
from sage.numerical.mip import MixedIntegerLinearProgram
278-
from sage.arith.all import binomial
278+
from sage.arith.misc import binomial
279279

280280
p = MixedIntegerLinearProgram(maximization=True, solver=solver)
281281
A = p.new_variable(integer=isinteger, nonnegative=True)

src/sage/coding/information_set_decoder.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@
4040
# http://www.gnu.org/licenses/
4141
#******************************************************************************
4242

43-
from sage.all import ZZ, Integer, vector, SageObject, binomial
43+
from sage.rings.integer_ring import Z as ZZ
44+
from sage.rings.integer import Integer
45+
from sage.modules.free_module_element import free_module_element as vector
46+
from sage.structure.sage_object import SageObject
47+
from sage.functions.other import binomial
4448
from .decoder import Decoder
4549

4650

src/sage/coding/linear_code.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ class should inherit from this class. Also ``AbstractLinearCode`` should never
215215
from sage.matrix.matrix_space import MatrixSpace
216216
from sage.modules.free_module import VectorSpace
217217
from sage.modules.free_module_element import vector
218-
from sage.arith.all import GCD, binomial
218+
from sage.arith.misc import GCD
219+
from sage.arith.misc import binomial
219220
from sage.groups.all import SymmetricGroup
220221
from sage.groups.perm_gps.permgroup import PermutationGroup
221222
from sage.rings.rational_field import QQ

src/sage/groups/abelian_gps/abelian_group.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@
207207
from sage.structure.category_object import normalize_names
208208
from sage.structure.unique_representation import UniqueRepresentation
209209
from sage.rings.infinity import infinity
210-
from sage.arith.all import divisors, gcd, lcm
210+
from sage.arith.misc import divisors
211+
from sage.arith.misc import GCD as gcd
212+
from sage.arith.functions import lcm
211213
from sage.groups.abelian_gps.abelian_group_element import AbelianGroupElement
212214
from sage.misc.cachefunc import cached_method
213215
from sage.misc.misc_c import prod

src/sage/groups/abelian_gps/dual_abelian_group_element.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
# (at your option) any later version.
5353
# https://www.gnu.org/licenses/
5454
# ****************************************************************************
55-
from sage.arith.all import LCM
55+
from sage.arith.functions import lcm as LCM
5656
from sage.groups.abelian_gps.element_base import AbelianGroupElementBase
5757

5858

src/sage/groups/abelian_gps/element_base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020

2121
from sage.structure.element import MultiplicativeGroupElement
2222
from sage.misc.cachefunc import cached_method
23-
from sage.arith.all import GCD, LCM
23+
from sage.arith.misc import GCD
24+
from sage.arith.functions import lcm as LCM
2425
from sage.rings.integer import Integer
2526
from sage.rings.integer_ring import ZZ
2627
from sage.rings.infinity import infinity

src/sage/groups/affine_gps/affine_group.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from sage.categories.groups import Groups
2222
from sage.groups.matrix_gps.linear import GL
2323
from sage.categories.rings import Rings
24-
from sage.matrix.all import MatrixSpace
24+
from sage.matrix.matrix_space import MatrixSpace
2525
from sage.modules.all import FreeModule
2626
from sage.structure.unique_representation import UniqueRepresentation
2727
from sage.misc.cachefunc import cached_method

src/sage/groups/class_function.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from sage.structure.richcmp import richcmp, richcmp_method
2828
from sage.interfaces.gap import gap
2929
from sage.rings.integer import Integer
30-
from sage.rings.all import CyclotomicField
30+
from sage.rings.number_field.number_field import CyclotomicField
3131
from sage.libs.gap.element import GapElement
3232
from sage.libs.gap.libgap import libgap
3333
from sage.libs.gap.element import GapElement as LibGapElement

src/sage/groups/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ def discrete_log(a, base, ord=None, bounds=None, operation='*', identity=None, i
935935
if running_mod > bound:
936936
break # we have log%running_mod. if we know that log<running_mod, then we have the value of log.
937937
l = l[:i + 1]
938-
from sage.arith.all import CRT_list
938+
from sage.arith.misc import CRT_list
939939
return (CRT_list(l, mods) + offset) % ord
940940
except ValueError:
941941
raise ValueError("no discrete log of %s found to base %s" % (a, base))

src/sage/groups/libgap_mixin.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -563,13 +563,13 @@ def character_table(self):
563563
irrG = G.Irr()
564564
ct = [[irrG[i][j] for j in range(n)] for i in range(n)]
565565

566-
from sage.rings.all import CyclotomicField
566+
from sage.rings.number_field.number_field import CyclotomicField
567567
e = irrG.Flat().Conductor()
568568
K = CyclotomicField(e)
569569
ct = [[K(x) for x in v] for v in ct]
570570

571571
# Finally return the result as a matrix.
572-
from sage.matrix.all import MatrixSpace
572+
from sage.matrix.matrix_space import MatrixSpace
573573
MS = MatrixSpace(K, n)
574574
return MS(ct)
575575

src/sage/groups/matrix_gps/finitely_generated.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
##############################################################################
6464

6565
from sage.rings.integer_ring import ZZ
66-
from sage.rings.all import QQbar
66+
from sage.rings.qqbar import QQbar
6767
from sage.structure.element import is_Matrix
6868
from sage.matrix.matrix_space import MatrixSpace, is_MatrixSpace
6969
from sage.matrix.constructor import matrix
@@ -792,7 +792,7 @@ def invariant_generators(self):
792792
PR = PolynomialRing(F, n, [VarStr+str(i) for i in range(1,n+1)])
793793

794794
if q == 0 or (q > 0 and self.cardinality() % q):
795-
from sage.all import Matrix
795+
from sage.matrix.constructor import Matrix
796796
try:
797797
elements = [g.matrix() for g in self.list()]
798798
except (TypeError, ValueError):

src/sage/groups/matrix_gps/group_element.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ cdef class MatrixGroupElement_gap(ElementLibGAP):
687687
return order.sage()
688688
else:
689689
assert order.IsInfinity()
690-
from sage.rings.all import Infinity
690+
from sage.rings.infinity import Infinity
691691
return Infinity
692692

693693
def word_problem(self, gens=None):

src/sage/groups/perm_gps/partn_ref/data_structures.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ def SC_test_list_perms(list L, int n, int limit, bint gap, bint limit_complain,
14111411
if SC_is_giant(n, len(L), perm, 0.9, giant_support):
14121412
giant = True
14131413
m = bitset_len(giant_support)
1414-
from sage.arith.all import factorial
1414+
from sage.arith.misc import factorial
14151415
if not (order == factorial(m) or order == factorial(m)/2):
14161416
print("SC_is_giant failed: %s %s"%(str(L), order))
14171417
raise AssertionError
@@ -1530,7 +1530,7 @@ def SC_test_list_perms(list L, int n, int limit, bint gap, bint limit_complain,
15301530
perm[n*j + i] = Lperm[i]
15311531
j += 1
15321532
if SC_is_giant(n, len(L), perm, 0.9, giant_support):
1533-
from sage.arith.all import factorial
1533+
from sage.arith.misc import factorial
15341534
m = bitset_len(giant_support)
15351535
if order != factorial(m) and order != factorial(m)/2:
15361536
print("SC_is_giant failed: %s %s"%(str(L), order))

src/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def random_tests(n=10, nrows_max=50, ncols_max=50, nsymbols_max=10, perms_per_ma
337337
from sage.combinat.permutation import Permutations
338338
from sage.matrix.constructor import random_matrix, matrix
339339
from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF
340-
from sage.arith.all import next_prime
340+
from sage.arith.misc import next_prime
341341
cdef int h, i, j, nrows, k, num_tests = 0, num_matrices = 0
342342
cdef MatrixStruct M, N
343343
for m in range(n):

src/sage/groups/perm_gps/permgroup.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@
141141
from sage.misc.randstate import current_randstate
142142
from sage.groups.group import FiniteGroup
143143

144-
from sage.rings.all import QQ, Integer
144+
from sage.rings.rational_field import Q as QQ
145+
from sage.rings.integer import Integer
145146
from sage.interfaces.abc import ExpectElement, GapElement
146147
from sage.libs.gap.libgap import libgap
147148
from sage.libs.gap.element import GapElement as LibGapElement
@@ -151,7 +152,7 @@
151152
from sage.misc.cachefunc import cached_method
152153
from sage.groups.class_function import ClassFunction_libgap
153154
from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
154-
from sage.categories.all import FiniteEnumeratedSets
155+
from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
155156
from sage.groups.conjugacy_classes import ConjugacyClassGAP
156157
from sage.structure.richcmp import (richcmp_method,
157158
richcmp, rich_to_bool, op_EQ, op_NE)
@@ -195,7 +196,7 @@ def hap_decorator(f):
195196
@wraps(f)
196197
def wrapped(self, n, p=0):
197198
load_hap()
198-
from sage.arith.all import is_prime
199+
from sage.arith.misc import is_prime
199200
if not (p == 0 or is_prime(p)):
200201
raise ValueError("p must be 0 or prime")
201202

@@ -3421,13 +3422,13 @@ def character_table(self):
34213422
irrG = G.Irr()
34223423
ct = [[irrG[i, j] for j in range(n)] for i in range(n)]
34233424

3424-
from sage.rings.all import CyclotomicField
3425+
from sage.rings.number_field.number_field import CyclotomicField
34253426
e = irrG.Flat().Conductor()
34263427
K = CyclotomicField(e)
34273428
ct = [[K(x) for x in v] for v in ct]
34283429

34293430
# Finally return the result as a matrix.
3430-
from sage.matrix.all import MatrixSpace
3431+
from sage.matrix.matrix_space import MatrixSpace
34313432
MS = MatrixSpace(K, n)
34323433
return MS(ct)
34333434

@@ -4742,7 +4743,7 @@ def poincare_series(self, p=2, n=10):
47424743
47434744
"""
47444745
load_hap()
4745-
from sage.arith.all import is_prime
4746+
from sage.arith.misc import is_prime
47464747
if not (p == 0 or is_prime(p)):
47474748
raise ValueError("p must be 0 or prime")
47484749

src/sage/groups/perm_gps/permgroup_element.pyx

+3-2
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,12 @@ from cpython.list cimport *
113113
from cypari2.gen cimport Gen
114114

115115
from sage.ext.stdsage cimport HAS_DICTIONARY
116-
from sage.rings.all import ZZ, Integer
116+
from sage.rings.integer_ring import Z as ZZ
117+
from sage.rings.integer import Integer
117118
from sage.rings.polynomial.polynomial_element import is_Polynomial
118119
from sage.rings.polynomial.multi_polynomial import is_MPolynomial
119120
from sage.structure.element import is_Matrix
120-
from sage.matrix.all import MatrixSpace
121+
from sage.matrix.matrix_space import MatrixSpace
121122
from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
122123
import sage.structure.coerce as coerce
123124
from sage.structure.richcmp cimport richcmp_not_equal, rich_to_bool

src/sage/groups/perm_gps/permgroup_named.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@
8686
# ****************************************************************************
8787
from pathlib import Path
8888

89-
from sage.rings.all import Integer
89+
from sage.rings.integer import Integer
9090
from sage.libs.gap.libgap import libgap
9191
from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF
92-
from sage.arith.all import factor, valuation
92+
from sage.arith.misc import factor
93+
from sage.arith.misc import valuation
9394
from sage.groups.abelian_gps.abelian_group import AbelianGroup
9495
from sage.misc.functional import is_even
9596
from sage.misc.cachefunc import cached_method, weak_cached_function

0 commit comments

Comments
 (0)