Skip to content

Commit

Permalink
Run './sage -fiximports'
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Mar 28, 2023
1 parent ac0f3a9 commit 4f7d0db
Show file tree
Hide file tree
Showing 60 changed files with 83 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ AUTHOR:
# https://www.gnu.org/licenses/
# ****************************************************************************

from sage.groups.perm_gps.all import CyclicPermutationGroup
from sage.groups.perm_gps.permgroup_named import CyclicPermutationGroup
from sage.libs.singular.function import lib, singular_function
from sage.misc.repr import repr_lincomb
from sage.rings.polynomial.multi_polynomial_ideal import MPolynomialIdeal
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/letterplace/free_algebra_letterplace.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ cdef class FreeAlgebra_letterplace(Algebra):
ngens = self.__ngens
degbound = self._degbound
cdef list G = [C(x._poly) for x in g]
from sage.groups.perm_gps.all import CyclicPermutationGroup
from sage.groups.perm_gps.permgroup_named import CyclicPermutationGroup
CG = CyclicPermutationGroup(C.ngens())
for y in G:
out.extend([y] + [y * CG[ngens * (n + 1)]
Expand Down
3 changes: 2 additions & 1 deletion src/sage/categories/finite_complex_reflection_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,8 @@ def noncrossing_partition_lattice(self, c=None, L=None,
sage: sorted( w.reduced_word() for w in W.noncrossing_partition_lattice(W.from_reduced_word([2])) ) # optional - gap3
[[], [2]]
"""
from sage.combinat.posets.all import Poset, LatticePoset
from sage.combinat.posets.posets import Poset
from sage.combinat.posets.lattices import LatticePoset

R = self.reflections()
if L is None:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/coding/ag_code_decoders.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ AUTHORS:
cimport cython

from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.function_field.all import FunctionField
from sage.rings.function_field.constructor import FunctionField

from sage.modules.free_module_element import vector
from sage.matrix.constructor import matrix
Expand Down
2 changes: 1 addition & 1 deletion src/sage/coding/linear_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class should inherit from this class. Also ``AbstractLinearCode`` should never
from sage.combinat.subset import Subsets
from sage.cpython.string import bytes_to_str
from sage.features.gap import GapPackage
from sage.groups.all import SymmetricGroup
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
from sage.groups.perm_gps.permgroup import PermutationGroup
from sage.interfaces.gap import gap
from sage.matrix.matrix_space import MatrixSpace
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/root_system/reflection_group_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ def discriminant(self):
sage: W.discriminant() # optional - gap3
x0^6*x1^2 - 6*x0^5*x1^3 + 13*x0^4*x1^4 - 12*x0^3*x1^5 + 4*x0^2*x1^6
"""
from sage.rings.polynomial.all import PolynomialRing
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
n = self.rank()
P = PolynomialRing(QQ, 'x', n)
x = P.gens()
Expand Down Expand Up @@ -1416,7 +1416,7 @@ def fundamental_invariants(self):
(x0^3 + x1^3, x0^3*x1^3)
"""
import re
from sage.rings.polynomial.all import PolynomialRing
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing

if not self.is_irreducible():
return sum([W.fundamental_invariants() for W in self.irreducible_components() ],tuple())
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/species/characteristic_species.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def automorphism_group(self):
sage: a.automorphism_group()
Symmetric group of order 3! as a permutation group
"""
from sage.groups.all import SymmetricGroup
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
return SymmetricGroup(len(self._labels))


Expand Down
5 changes: 3 additions & 2 deletions src/sage/combinat/species/cycle_species.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def permutation_group_element(self):
sage: a.permutation_group_element()
(1,2,3)
"""
from sage.groups.all import PermutationGroupElement
from sage.groups.perm_gps.constructor import PermutationGroupElement
return PermutationGroupElement(tuple(self._list))

def transport(self, perm):
Expand Down Expand Up @@ -96,7 +96,8 @@ def automorphism_group(self):
sage: [a.transport(perm) for perm in a.automorphism_group()]
[(1, 2, 3, 4), (1, 2, 3, 4), (1, 2, 3, 4), (1, 2, 3, 4)]
"""
from sage.groups.all import SymmetricGroup, PermutationGroup
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
from sage.groups.perm_gps.permgroup import PermutationGroup
S = SymmetricGroup(len(self._labels))
p = self.permutation_group_element()
return PermutationGroup(S.centralizer(p).gens())
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/species/linear_order_species.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def automorphism_group(self):
sage: a.automorphism_group()
Symmetric group of order 1! as a permutation group
"""
from sage.groups.all import SymmetricGroup
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
return SymmetricGroup(1)


Expand Down
5 changes: 4 additions & 1 deletion src/sage/combinat/species/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
# http://www.gnu.org/licenses/
#*****************************************************************************

from sage.groups.all import PermutationGroup, PermutationGroup_generic, PermutationGroupElement, SymmetricGroup
from sage.groups.perm_gps.permgroup import PermutationGroup
from sage.groups.perm_gps.permgroup import PermutationGroup_generic
from sage.groups.perm_gps.constructor import PermutationGroupElement
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
from sage.misc.misc_c import prod
from functools import wraps

Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/species/partition_species.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def automorphism_group(self):
sage: a.automorphism_group()
Permutation Group with generators [(1,2)]
"""
from sage.groups.all import SymmetricGroup
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
return reduce(lambda a,b: a.direct_product(b, maps=False),
[SymmetricGroup(block._list) for block in self._list])

Expand Down
3 changes: 2 additions & 1 deletion src/sage/combinat/species/permutation_species.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def automorphism_group(self):
['a', 'c', 'b', 'd'],
['a', 'c', 'b', 'd']]
"""
from sage.groups.all import SymmetricGroup, PermutationGroup
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
from sage.groups.perm_gps.permgroup import PermutationGroup
S = SymmetricGroup(len(self._labels))
p = self.permutation_group_element()
return PermutationGroup(S.centralizer(p).gens())
Expand Down
3 changes: 2 additions & 1 deletion src/sage/combinat/species/product_species.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ def automorphism_group(self):
sage: [a.transport(g) for g in a.automorphism_group()]
[{2, 3}*{1, 4}, {2, 3}*{1, 4}, {2, 3}*{1, 4}, {2, 3}*{1, 4}]
"""
from sage.groups.all import PermutationGroupElement, PermutationGroup
from sage.groups.perm_gps.constructor import PermutationGroupElement
from sage.groups.perm_gps.permgroup import PermutationGroup
from sage.combinat.species.misc import change_support

left, right = self._list
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/species/set_species.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def automorphism_group(self):
sage: a.automorphism_group()
Symmetric group of order 3! as a permutation group
"""
from sage.groups.all import SymmetricGroup
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
return SymmetricGroup(max(1,len(self._labels)))


Expand Down
3 changes: 2 additions & 1 deletion src/sage/combinat/species/subset_species.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def automorphism_group(self):
sage: [a.transport(g) for g in a.automorphism_group()]
[{1, 3}, {1, 3}, {1, 3}, {1, 3}]
"""
from sage.groups.all import SymmetricGroup, PermutationGroup
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
from sage.groups.perm_gps.permgroup import PermutationGroup
a = SymmetricGroup(self._list)
b = SymmetricGroup(self.complement()._list)
return PermutationGroup(a.gens() + b.gens())
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/words/word_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ def _fibonacci_tile(self, n, q_0=None, q_1=3):
[BmBGL09]_
"""
from sage.combinat.words.all import WordMorphism
from sage.combinat.words.morphism import WordMorphism
W = FiniteWords([0,1,2,3])
bar = WordMorphism({0:0,1:3,3:1,2:2},codomain=W)
if n==0:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/doctest/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def RIFtol(*args):
if _RIFtol is None:
try:
# We need to import from sage.all to avoid circular imports.
from sage.all import RealIntervalField
from sage.rings.real_mpfi import RealIntervalField
except ImportError:
from warnings import warn
warn("RealIntervalField not available, ignoring all tolerance specifications in doctests")
Expand Down
2 changes: 1 addition & 1 deletion src/sage/dynamics/arithmetic_dynamics/projective_ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class initialization directly.
from sage.rings.polynomial.flatten import FlatteningMorphism, UnflatteningMorphism
from sage.rings.morphism import RingHomomorphism_im_gens
from sage.rings.number_field.number_field_ideal import NumberFieldFractionalIdeal
from sage.rings.padics.all import Qp
from sage.rings.padics.factory import Qp
from sage.rings.polynomial.multi_polynomial_ring_base import is_MPolynomialRing
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.polynomial.polynomial_ring import is_PolynomialRing
Expand Down
2 changes: 1 addition & 1 deletion src/sage/geometry/hyperplane_arrangement/arrangement.py
Original file line number Diff line number Diff line change
Expand Up @@ -1726,7 +1726,7 @@ def vertices(self, exclude_sandwiched=False):
((0, 0), (0, 8), (8, 0), (8, 8))
"""
import itertools
from sage.matroids.all import Matroid
from sage.matroids.constructor import Matroid
R = self.parent().base_ring()
parallels = self._parallel_hyperplanes()
A_list = [parallel[0][1] for parallel in parallels]
Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/graph_coloring.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1643,7 +1643,7 @@ def _vizing_edge_coloring(g):
e_colors[frozenset((fan_center, fan[-1]))] = d

matchings = dict()
for edge, c in e_colors.items():
for edge, c in e_colors.items():
matchings[c] = matchings.get(c, []) + [tuple(edge)]
classes = list(matchings.values())

Expand Down
2 changes: 1 addition & 1 deletion src/sage/groups/affine_gps/affine_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from sage.groups.matrix_gps.linear import GL
from sage.categories.rings import Rings
from sage.matrix.matrix_space import MatrixSpace
from sage.modules.all import FreeModule
from sage.modules.free_module import FreeModule
from sage.structure.unique_representation import UniqueRepresentation
from sage.misc.cachefunc import cached_method

Expand Down
3 changes: 2 additions & 1 deletion src/sage/interfaces/chomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def __call__(self, program, complex, subcomplex=None, **kwds):
from subprocess import Popen, PIPE
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.modules.all import VectorSpace, vector
from sage.modules.free_module import VectorSpace
from sage.modules.free_module_element import free_module_element as vector
from sage.combinat.free_module import CombinatorialFreeModule

deprecation(33777, "the CHomP interface is deprecated")
Expand Down
2 changes: 1 addition & 1 deletion src/sage/interfaces/macaulay2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@ def _sage_(self):
elif cls_str == "String":
return str(repr_str)
elif cls_str == "Module":
from sage.modules.all import FreeModule
from sage.modules.free_module import FreeModule
if self.isFreeModule()._sage_():
ring = self.ring()._sage_()
rank = self.rank()._sage_()
Expand Down
2 changes: 1 addition & 1 deletion src/sage/libs/singular/function.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ cdef class SingularFunction(SageObject):
ring = self.common_ring(args, ring)
if ring is None:
if dummy_ring is None:
from sage.rings.polynomial.all import PolynomialRing
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.rational_field import QQ
dummy_ring = PolynomialRing(QQ, "dummy", implementation="singular") # seems a reasonable default
ring = dummy_ring
Expand Down
2 changes: 1 addition & 1 deletion src/sage/matrix/matrix_symbolic_dense.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Check that :trac:`12778` is fixed::
Full MatrixSpace of 3 by 4 dense matrices over Symbolic Ring
"""

from sage.rings.polynomial.all import PolynomialRing
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.structure.element cimport ModuleElement, RingElement, Element
from sage.structure.factorization import Factorization

Expand Down
2 changes: 1 addition & 1 deletion src/sage/matroids/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

from sage.rings.integer_ring import ZZ
from sage.rings.finite_rings.finite_field_constructor import GF
from sage.schemes.all import ProjectiveSpace
from sage.schemes.projective.projective_space import ProjectiveSpace

import sage.matroids.matroid
import sage.matroids.basis_exchange_matroid
Expand Down
4 changes: 2 additions & 2 deletions src/sage/misc/cachefunc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ By :trac:`11115`, even if a parent does not allow attribute
assignment, it can inherit a cached method from the parent class of a
category (previously, the cache would have been broken)::
sage: cython_code = ["from sage.misc.cachefunc import cached_method",
sage: cython_code = ["from sage.misc.cachefunc import cached_method",
....: "from sage.misc.cachefunc import cached_in_parent_method",
....: "from sage.categories.category import Category",
....: "from sage.categories.category import Category",
....: "from sage.categories.objects import Objects",
....: "class MyCategory(Category):",
....: " @cached_method",
Expand Down
2 changes: 1 addition & 1 deletion src/sage/modular/arithgroup/congroup_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
################################################################################

from sage.arith.misc import gcd
from sage.groups.matrix_gps.all import MatrixGroup
from sage.groups.matrix_gps.finitely_generated import MatrixGroup
from sage.matrix.matrix_space import MatrixSpace
from sage.misc.misc_c import prod
from sage.rings.finite_rings.integer_mod_ring import Zmod
Expand Down
2 changes: 1 addition & 1 deletion src/sage/modular/local_comp/type_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def _rho_unramified(self, g):
True
"""
f = self.prime() ** self.u()
from sage.groups.matrix_gps.all import SL
from sage.groups.matrix_gps.linear import SL
G = SL(2, Zmod(f))
gg = G(g)
s = G([1,1,0,1])
Expand Down
2 changes: 1 addition & 1 deletion src/sage/modular/modform/numerical.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from sage.misc.prandom import randint
from sage.modular.arithgroup.all import Gamma0
from sage.modular.modsym.all import ModularSymbols
from sage.modules.all import vector
from sage.modules.free_module_element import free_module_element as vector
from sage.rings.complex_double import CDF
from sage.rings.integer import Integer
from sage.rings.rational_field import QQ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
from sage.arith.misc import gcd
from sage.combinat.root_system.cartan_matrix import CartanMatrix
from sage.misc.cachefunc import cached_method
from sage.quadratic_forms.all import QuadraticForm
from sage.quadratic_forms.quadratic_form import QuadraticForm

###############################################################################
#
Expand Down
3 changes: 2 additions & 1 deletion src/sage/numerical/interactive_simplex_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@
from sage.misc.prandom import randint, random
from sage.misc.html import HtmlFragment
from sage.misc.misc import get_main_globals
from sage.modules.all import random_vector, vector
from sage.modules.free_module_element import random_vector
from sage.modules.free_module_element import free_module_element as vector
from sage.misc.lazy_import import lazy_import
lazy_import("sage.plot.all", ["Graphics", "arrow", "line", "point", "rainbow", "text"])
from sage.rings.infinity import Infinity
Expand Down
3 changes: 2 additions & 1 deletion src/sage/quadratic_forms/genera/genus.py
Original file line number Diff line number Diff line change
Expand Up @@ -2940,7 +2940,8 @@ def rational_representative(self):
[0 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 2]
"""
from sage.quadratic_forms.all import QuadraticForm, quadratic_form_from_invariants
from sage.quadratic_forms.quadratic_form import QuadraticForm
from sage.quadratic_forms.quadratic_form import quadratic_form_from_invariants
sminus = self.signature_pair_of_matrix()[1]
det = self.determinant()
m = self.rank()
Expand Down
2 changes: 1 addition & 1 deletion src/sage/quadratic_forms/quadratic_form__automorphisms.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from sage.matrix.constructor import Matrix
from sage.rings.integer_ring import ZZ

from sage.modules.all import FreeModule
from sage.modules.free_module import FreeModule
from sage.modules.free_module_element import vector
from sage.arith.misc import GCD

Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/finite_rings/finite_field_base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ cdef class FiniteField(Field):
sage: all(to_V(h(c) * e) == c * to_V(e) for e in E for c in F)
True
"""
from sage.modules.all import VectorSpace
from sage.modules.free_module import VectorSpace
from sage.categories.morphism import is_Morphism
if subfield is not None:
if base is not None:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/finite_rings/integer_mod.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,7 @@ cdef class IntegerMod_abstract(FiniteRingElement):
return [K(a.lift()*p**(pval // n) + p**(k - (pval - pval//n)) * b) for a in mod(upart, p**(k-pval)).nth_root(n, all=True, algorithm=algorithm) for b in range(p**(pval - pval//n))]
else:
return K(p**(pval // n) * mod(upart, p**(k-pval)).nth_root(n, algorithm=algorithm).lift())
from sage.rings.padics.all import ZpFM
from sage.rings.padics.factory import ZpFM
R = ZpFM(p,k)
self_orig = self
if p == 2:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/multi_power_series_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@


from sage.rings.ring import CommutativeRing
from sage.rings.polynomial.all import PolynomialRing
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.polynomial.polynomial_ring import is_PolynomialRing
from sage.rings.polynomial.multi_polynomial_ring import is_MPolynomialRing
from sage.rings.polynomial.term_order import TermOrder
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/number_field/number_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -12153,7 +12153,7 @@ def hilbert_class_polynomial(self, name='x'):
if D > 0:
raise NotImplementedError("Hilbert class polynomial is not implemented for real quadratic fields.")

from sage.schemes.elliptic_curves.all import hilbert_class_polynomial as HCP
from sage.schemes.elliptic_curves.cm import hilbert_class_polynomial as HCP
return QQ[name](HCP(D))

def number_of_roots_of_unity(self):
Expand Down
4 changes: 2 additions & 2 deletions src/sage/rings/number_field/splitting_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

from sage.rings.integer import Integer
from sage.arith.misc import factorial
from sage.rings.number_field.all import NumberField
from sage.rings.polynomial.all import PolynomialRing
from sage.rings.number_field.number_field import NumberField
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.rational_field import RationalField, is_RationalField
from sage.libs.pari.all import pari, PariError

Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/padics/padic_capped_relative_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ def base_p_list(Integer n, bint pos, PowComputer_class prime_pow):
raise ValueError("n must be nonnegative")
cdef expansion_mode mode = simple_mode if pos else smallest_mode
# We need a p-adic element to feed to ExpansionIter before resetting its curvalue
from sage.rings.padics.all import Zp
from sage.rings.padics.factory import Zp
p = prime_pow.prime
dummy = Zp(p)(0)
cdef ExpansionIter expansion = ExpansionIter(dummy, n.exact_log(p) + 2, mode)
Expand Down
Loading

0 comments on commit 4f7d0db

Please sign in to comment.