Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sage.{algebras,combinat,matroids}: Replace imports from sage.*.all for namespace packages #35090

Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sage/algebras/affine_nil_temperley_lieb.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Distributed under the terms of the GNU General Public License (GPL)
# https://www.gnu.org/licenses/
# ****************************************************************************
from sage.categories.all import AlgebrasWithBasis
from sage.categories.algebras_with_basis import AlgebrasWithBasis
from sage.combinat.root_system.cartan_type import CartanType
from sage.combinat.root_system.weyl_group import WeylGroup
from sage.rings.ring import Ring
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/cluster_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@

from copy import copy

from sage.arith.all import binomial
from sage.arith.misc import binomial
from sage.categories.homset import Hom
from sage.categories.morphism import SetMorphism
from sage.categories.rings import Rings
Expand Down
4 changes: 2 additions & 2 deletions src/sage/algebras/free_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@

from sage.structure.factory import UniqueFactory
from sage.misc.cachefunc import cached_method
from sage.all import PolynomialRing
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.ring import Algebra
from sage.categories.algebras_with_basis import AlgebrasWithBasis
from sage.combinat.free_module import CombinatorialFreeModule
Expand Down Expand Up @@ -282,7 +282,7 @@ def create_key(self, base_ring, arg1=None, arg2=None,
PolRing = PolynomialRing(base_ring, *args, **kwds)
if degrees is None:
return (PolRing,)
from sage.all import TermOrder
from sage.rings.polynomial.term_order import TermOrder
T = TermOrder(PolRing.term_order(), PolRing.ngens() + 1)
varnames = list(PolRing.variable_names())
newname = 'x'
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/free_algebra_quotient.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def hamilton_quatalg(R):
"""
n = 3
from sage.algebras.free_algebra import FreeAlgebra
from sage.matrix.all import MatrixSpace
from sage.matrix.matrix_space import MatrixSpace
A = FreeAlgebra(R, n, 'i')
F = A.monoid()
i, j, k = F.gens()
Expand Down
4 changes: 2 additions & 2 deletions src/sage/algebras/group_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
# http://www.gnu.org/licenses/
#*****************************************************************************

from sage.rings.all import IntegerRing
from sage.categories.all import Rings
from sage.rings.integer_ring import IntegerRing
from sage.categories.rings import Rings
from sage.categories.magmas import Magmas
from sage.categories.additive_magmas import AdditiveMagmas
from sage.categories.sets_cat import Sets
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/hecke_algebras/ariki_koike_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def dimension(self):
sage: LT.dimension()
29160
"""
from sage.arith.all import factorial
from sage.arith.misc import factorial
return self._r**self._n * factorial(self._n)

def some_elements(self):
Expand Down
6 changes: 4 additions & 2 deletions src/sage/algebras/iwahori_hecke_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.realizations import Realizations, Category_realization_of_parent
from sage.categories.all import AlgebrasWithBasis, FiniteDimensionalAlgebrasWithBasis, CoxeterGroups
from sage.categories.algebras_with_basis import AlgebrasWithBasis
from sage.categories.finite_dimensional_algebras_with_basis import FiniteDimensionalAlgebrasWithBasis
from sage.categories.coxeter_groups import CoxeterGroups
from sage.rings.integer_ring import ZZ
from sage.rings.polynomial.laurent_polynomial_ring import LaurentPolynomialRing
from sage.arith.all import is_square
from sage.arith.misc import is_square
from sage.combinat.root_system.coxeter_group import CoxeterGroup
from sage.sets.family import Family
from sage.combinat.free_module import CombinatorialFreeModule
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/lie_algebras/bch.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from sage.arith.misc import bernoulli
from sage.categories.lie_algebras import LieAlgebras
from sage.combinat.integer_vector import IntegerListsLex
from sage.arith.all import factorial
from sage.arith.misc import factorial
from sage.rings.rational_field import QQ
from sage.structure.element import canonical_coercion

Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/lie_algebras/free_lie_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def graded_dimension(self, k):
"""
if k == 0:
return 0
from sage.arith.all import moebius
from sage.arith.misc import moebius
s = len(self.lie_algebra_generators())
k = ZZ(k) # Make sure we have something that is in ZZ
return sum(moebius(d) * s**(k // d) for d in k.divisors()) // k
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# (at your option) any later version.
# https://www.gnu.org/licenses/
# ****************************************************************************
from sage.arith.all import factorial
from sage.arith.misc import factorial
from sage.misc.misc_c import prod
from sage.misc.repr import repr_lincomb
from sage.misc.latex import latex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# https://www.gnu.org/licenses/
# ****************************************************************************

from sage.arith.all import binomial
from sage.arith.misc import binomial
from sage.sets.family import Family
from .lie_conformal_algebra_element import LCAStructureCoefficientsElement
from sage.categories.lie_conformal_algebras import LieConformalAlgebras
Expand Down
11 changes: 8 additions & 3 deletions src/sage/algebras/quatalg/quaternion_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@
# https://www.gnu.org/licenses/
# ****************************************************************************

from sage.arith.all import (hilbert_conductor_inverse, hilbert_conductor,
factor, gcd, kronecker_symbol, valuation)
from sage.rings.all import RR, Integer
from sage.arith.misc import (hilbert_conductor_inverse,
hilbert_conductor,
factor,
GCD as gcd,
kronecker as kronecker_symbol,
valuation)
from sage.rings.real_mpfr import RR
from sage.rings.integer import Integer
from sage.rings.integer_ring import ZZ
from sage.rings.rational import Rational
from sage.rings.finite_rings.finite_field_constructor import GF
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/schur_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from sage.combinat.sf.sf import SymmetricFunctions
from sage.combinat.symmetric_group_algebra import SymmetricGroupAlgebra
from sage.combinat.tableau import SemistandardTableaux
from sage.arith.all import binomial
from sage.arith.misc import binomial
from sage.matrix.constructor import Matrix
from sage.misc.cachefunc import cached_method
from sage.misc.flatten import flatten
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/shuffle_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ def expansion_on_basis(self, w):
sage: S.expansion_on_basis(Word('abab'))
2*B[aabb] + B[abab]
"""
from sage.arith.all import factorial
from sage.arith.misc import factorial
if not w:
return self._alg.one()
if len(w) == 1:
Expand Down
6 changes: 4 additions & 2 deletions src/sage/algebras/steenrod/steenrod_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,9 @@
from sage.combinat.free_module import CombinatorialFreeModule
from sage.misc.lazy_attribute import lazy_attribute
from sage.misc.cachefunc import cached_method
from sage.categories.all import ModulesWithBasis, tensor, Hom
from sage.categories.modules_with_basis import ModulesWithBasis
from sage.categories.tensor import tensor
from sage.categories.homset import Hom

######################################################
# the main class
Expand Down Expand Up @@ -584,7 +586,7 @@ def __init__(self, p=2, basis='milnor', **kwds):
sage: A1 == SteenrodAlgebra(2, profile=[2,1], basis='pst')
False
"""
from sage.arith.all import is_prime
from sage.arith.misc import is_prime
from sage.categories.super_hopf_algebras_with_basis import SuperHopfAlgebrasWithBasis
from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets
from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
Expand Down
5 changes: 3 additions & 2 deletions src/sage/algebras/steenrod/steenrod_algebra_mult.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,9 @@ def multinomial_odd(list,p):
sage: multinomial_odd([1,2,4], 107)
105
"""
from sage.rings.all import GF, Integer
from sage.arith.all import binomial
from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF
from sage.rings.integer import Integer
from sage.arith.misc import binomial
n = sum(list)
answer = 1
F = GF(p)
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/affine_permutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from sage.rings.integer_ring import ZZ

from sage.groups.perm_gps.permgroup_named import SymmetricGroup
from sage.arith.all import binomial
from sage.arith.misc import binomial
from sage.combinat.root_system.cartan_type import CartanType
from sage.combinat.root_system.weyl_group import WeylGroup
from sage.combinat.composition import Composition
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/alternating_sign_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from sage.modules.free_module_element import zero_vector
from sage.misc.cachefunc import cached_method
from sage.rings.integer_ring import ZZ
from sage.arith.all import factorial
from sage.arith.misc import factorial
from sage.rings.integer import Integer
from sage.combinat.posets.lattices import LatticePoset
from sage.combinat.gelfand_tsetlin_patterns import GelfandTsetlinPatternsTopRow
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/baxter_permutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def cardinality(self):
"""
if self._n == 0:
return 1
from sage.arith.all import binomial
from sage.arith.misc import binomial
return sum((binomial(self._n + 1, k) *
binomial(self._n + 1, k + 1) *
binomial(self._n + 1, k + 2)) //
Expand Down
3 changes: 2 additions & 1 deletion src/sage/combinat/binary_recurrence_sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
from sage.rings.finite_rings.integer_mod_ring import Integers
from sage.rings.finite_rings.finite_field_constructor import GF
from sage.rings.integer import Integer
from sage.arith.all import lcm, next_prime, is_prime, next_prime_power, legendre_symbol
from sage.arith.functions import lcm
from sage.arith.misc import is_prime, next_prime, next_prime_power, legendre_symbol
from sage.functions.log import log
from sage.misc.functional import sqrt

Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/blob_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass
from sage.misc.cachefunc import cached_method
from sage.misc.misc import powerset
from sage.arith.all import binomial
from sage.arith.misc import binomial
from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
from sage.categories.algebras import Algebras
from sage.combinat.diagram_algebras import (TemperleyLiebDiagrams, diagram_latex,
Expand Down
8 changes: 4 additions & 4 deletions src/sage/combinat/cluster_algebra_quiver/cluster_seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
from sage.rings.fraction_field import FractionField
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.fraction_field_element import FractionFieldElement
from sage.sets.all import Set
from sage.sets.set import Set
from sage.graphs.digraph import DiGraph
from sage.combinat.cluster_algebra_quiver.quiver_mutation_type import QuiverMutationType_Irreducible, QuiverMutationType_Reducible
from sage.combinat.cluster_algebra_quiver.mutation_type import is_mutation_finite
from random import randint
from sage.misc.misc_c import prod
from sage.matrix.all import identity_matrix
from sage.matrix.special import identity_matrix
from sage.matrix.constructor import matrix
from sage.combinat.cluster_algebra_quiver.quiver import ClusterQuiver
from sage.rings.integer import Integer
Expand Down Expand Up @@ -3111,7 +3111,7 @@ def principal_extension(self):
sage: T2 == T
True
"""
from sage.matrix.all import identity_matrix
from sage.matrix.special import identity_matrix
if self._m != 0:
raise ValueError("the b-matrix is not square")
M = self._M.stack(identity_matrix(self._n))
Expand Down Expand Up @@ -4600,7 +4600,7 @@ def _bino(n, k):
0
"""
if n >= 0:
from sage.arith.all import binomial
from sage.arith.misc import binomial
return binomial(n, k)
else:
return 0
Expand Down
3 changes: 2 additions & 1 deletion src/sage/combinat/cluster_algebra_quiver/quiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,8 @@ def plot(self, circular=True, center=(0, 0), directed=True, mark=None,
"""
from sage.plot.colors import rainbow
from sage.graphs.graph_generators import GraphGenerators
from sage.all import e, pi, I
from sage.symbolic.constants import e, pi
from sage.rings.imaginary_unit import I
graphs = GraphGenerators()
# returns positions for graph vertices on two concentric cycles with radius 1 and 2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from sage.rings.infinity import infinity
from sage.graphs.digraph import DiGraph
from sage.graphs.graph import Graph
from sage.arith.all import binomial, euler_phi
from sage.arith.misc import binomial, euler_phi
from sage.misc.misc_c import prod
from sage.matrix.constructor import matrix

Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/combinat.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@
from __future__ import annotations
from typing import Iterator

from sage.arith.misc import bernoulli, factorial
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.rings.integer import Integer
from sage.rings.infinity import infinity
from sage.arith.all import bernoulli, factorial
from sage.rings.polynomial.polynomial_element import Polynomial
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.libs.pari.all import pari
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/combination.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

from sage.rings.integer import Integer
from sage.rings.integer_ring import ZZ
from sage.arith.all import binomial
from sage.arith.misc import binomial
from .integer_vector import IntegerVectors
from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
from sage.structure.parent import Parent
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/composition_signed.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from sage.rings.integer_ring import ZZ
from .composition import Compositions_n, Composition
from sage.rings.integer import Integer
from sage.arith.all import binomial
from sage.arith.misc import binomial


class SignedCompositions(Compositions_n):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/crystals/alcove_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from sage.graphs.digraph import DiGraph
from sage.combinat.root_system.cartan_type import CartanType
from sage.combinat.root_system.root_system import RootSystem
from sage.all import vector
from sage.modules.free_module_element import free_module_element as vector
from sage.rings.integer import Integer
from sage.combinat.root_system.weyl_group import WeylGroup
from sage.misc.misc_c import prod
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/cyclic_sieving_phenomenon.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# ****************************************************************************
from __future__ import annotations
from sage.rings.integer_ring import ZZ
from sage.arith.all import lcm
from sage.arith.functions import lcm
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing


Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/decorated_permutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.parent import Parent
from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
from sage.arith.all import factorial
from sage.arith.misc import factorial
from sage.rings.integer import Integer
from sage.combinat.permutation import Permutations
from sage.combinat.subset import Subsets
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/descent_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.algebras import Algebras
from sage.categories.realizations import Realizations, Category_realization_of_parent
from sage.categories.all import FiniteDimensionalAlgebrasWithBasis
from sage.categories.finite_dimensional_algebras_with_basis import FiniteDimensionalAlgebrasWithBasis
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.arith.misc import factorial
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/designs/bibd.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
from sage.categories.sets_cat import EmptySetError
from sage.misc.unknown import Unknown
from .design_catalog import transversal_design # type:ignore
from sage.arith.all import binomial, is_prime_power
from sage.arith.misc import binomial, is_prime_power
from .group_divisible_designs import GroupDivisibleDesign
from .designs_pyx import is_pairwise_balanced_design

Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/designs/block_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@
# (at your option) any later version.
# https://www.gnu.org/licenses/
#*****************************************************************************
from sage.arith.misc import binomial, integer_floor, is_prime_power
from sage.categories.sets_cat import EmptySetError
from sage.modules.free_module import VectorSpace
from sage.rings.integer import Integer
from sage.rings.integer_ring import ZZ
from sage.arith.all import binomial, integer_floor, is_prime_power
from .incidence_structures import IncidenceStructure
from sage.rings.finite_rings.finite_field_constructor import FiniteField
from sage.categories.sets_cat import EmptySetError
from sage.misc.unknown import Unknown
from sage.matrix.matrix_space import MatrixSpace
from sage.libs.gap.libgap import libgap
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/designs/covering_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
from sage.misc.sage_eval import sage_eval
from sage.structure.sage_object import SageObject
from sage.rings.rational import Rational
from sage.arith.all import binomial
from sage.arith.misc import binomial
from sage.combinat.combination import Combinations
from sage.combinat.designs.incidence_structures import IncidenceStructure
from sage.cpython.string import bytes_to_str
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/designs/difference_matrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
---------
"""

from sage.arith.misc import divisors, is_prime_power
from sage.misc.unknown import Unknown
from sage.misc.cachefunc import cached_function
from sage.categories.sets_cat import EmptySetError
from sage.rings.finite_rings.finite_field_constructor import FiniteField
from sage.arith.all import is_prime_power, divisors
from .designs_pyx import is_difference_matrix
from .database import DM as DM_constructions

Expand Down
Loading