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

Issue #34949: sage.{categories,matrix,structure}: Replace imports from sage.*.all for namespace packages #35012

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
3 changes: 2 additions & 1 deletion src/sage/categories/bialgebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
# *****************************************************************************

from sage.categories.category_types import Category_over_base_ring
from sage.categories.all import Algebras, Coalgebras
from sage.categories.algebras import Algebras
from sage.categories.coalgebras import Coalgebras
from sage.categories.super_modules import SuperModulesCategory
from sage.misc.lazy_import import LazyImport

Expand Down
4 changes: 2 additions & 2 deletions src/sage/categories/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class Category(UniqueRepresentation, SageObject):

This is achieved as follows::

sage: from sage.categories.all import Category
sage: from sage.categories.category import Category
sage: class EuclideanDomains(Category):
....: # operations on the category itself
....: def super_categories(self):
Expand Down Expand Up @@ -201,7 +201,7 @@ class inheritance from ``C.parent_class``.

::

sage: from sage.categories.all import Category
sage: from sage.categories.category import Category
sage: from sage.misc.lazy_attribute import lazy_attribute
sage: class As (Category):
....: def super_categories(self):
Expand Down
4 changes: 3 additions & 1 deletion src/sage/categories/chain_complexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def super_categories(self):
[Category of modules over Ring of integers modulo 9]

"""
from sage.categories.all import Fields, Modules, VectorSpaces
from sage.categories.fields import Fields
from sage.categories.modules import Modules
from sage.categories.vector_spaces import VectorSpaces
base_ring = self.base_ring()
if base_ring in Fields():
return [VectorSpaces(base_ring)]
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/coalgebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# *****************************************************************************

from .category_types import Category_over_base_ring
from sage.categories.all import Modules
from sage.categories.modules import Modules
from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring
from sage.categories.tensor import TensorProductsCategory
from sage.categories.dual import DualObjectsCategory
Expand Down
4 changes: 3 additions & 1 deletion src/sage/categories/coalgebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
from sage.misc.lazy_attribute import lazy_attribute
from sage.misc.lazy_import import LazyImport
from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring
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
from sage.categories.super_modules import SuperModulesCategory
from sage.categories.filtered_modules import FilteredModulesCategory

Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/examples/algebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from sage.misc.cachefunc import cached_method
from sage.sets.family import Family
from sage.categories.all import AlgebrasWithBasis
from sage.categories.algebras_with_basis import AlgebrasWithBasis
from sage.combinat.free_module import CombinatorialFreeModule
from sage.combinat.words.words import Words

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from sage.misc.cachefunc import cached_method
from sage.structure.parent import Parent
from sage.categories.all import CommutativeAdditiveMonoids
from sage.categories.commutative_additive_monoids import CommutativeAdditiveMonoids
from .commutative_additive_semigroups import FreeCommutativeAdditiveSemigroup

class FreeCommutativeAdditiveMonoid(FreeCommutativeAdditiveSemigroup):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from sage.structure.parent import Parent
from sage.structure.element_wrapper import ElementWrapper
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.all import CommutativeAdditiveSemigroups
from sage.categories.commutative_additive_semigroups import CommutativeAdditiveSemigroups
from sage.sets.family import Family

class FreeCommutativeAdditiveSemigroup(UniqueRepresentation, Parent):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/examples/finite_coxeter_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from sage.misc.cachefunc import cached_method
from sage.structure.parent import Parent
from sage.structure.element_wrapper import ElementWrapper
from sage.categories.all import FiniteCoxeterGroups
from sage.categories.finite_coxeter_groups import FiniteCoxeterGroups
from sage.structure.unique_representation import UniqueRepresentation
from sage.misc.functional import is_odd, is_even
from sage.combinat.root_system.coxeter_matrix import CoxeterMatrix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#*****************************************************************************

from sage.misc.cachefunc import cached_method
from sage.categories.all import FiniteDimensionalAlgebrasWithBasis
from sage.categories.finite_dimensional_algebras_with_basis import FiniteDimensionalAlgebrasWithBasis
from sage.combinat.free_module import CombinatorialFreeModule


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from sage.misc.cachefunc import cached_method
from sage.sets.family import Family
from sage.categories.all import LieAlgebras
from sage.categories.lie_algebras import LieAlgebras
from sage.modules.free_module import FreeModule
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/examples/finite_monoids.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element_wrapper import ElementWrapper
from sage.categories.all import Monoids
from sage.categories.monoids import Monoids
from sage.rings.integer import Integer
from sage.rings.integer_ring import ZZ

Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/examples/finite_weyl_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from sage.misc.cachefunc import cached_method
from sage.structure.parent import Parent
from sage.structure.element_wrapper import ElementWrapper
from sage.categories.all import FiniteWeylGroups
from sage.categories.finite_weyl_groups import FiniteWeylGroups
from sage.structure.unique_representation import UniqueRepresentation

class SymmetricGroup(UniqueRepresentation, Parent):
Expand Down
4 changes: 2 additions & 2 deletions src/sage/categories/examples/hopf_algebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

from sage.misc.cachefunc import cached_method
from sage.sets.family import Family
from sage.categories.all import HopfAlgebrasWithBasis
from sage.categories.hopf_algebras_with_basis import HopfAlgebrasWithBasis
from sage.combinat.free_module import CombinatorialFreeModule
from sage.categories.all import tensor
from sage.categories.tensor import tensor

class MyGroupAlgebra(CombinatorialFreeModule):
r"""
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/examples/lie_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#from sage.misc.cachefunc import cached_method
from sage.sets.family import Family
from sage.categories.all import LieAlgebras
from sage.categories.lie_algebras import LieAlgebras
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element_wrapper import ElementWrapper
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/examples/magmas.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element_wrapper import ElementWrapper
from sage.categories.all import Magmas
from sage.categories.magmas import Magmas
from sage.sets.family import Family


Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/examples/monoids.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from sage.misc.cachefunc import cached_method
from sage.structure.parent import Parent
from sage.structure.element_wrapper import ElementWrapper
from sage.categories.all import Monoids
from sage.categories.monoids import Monoids
from .semigroups import FreeSemigroup
from sage.sets.family import Family

Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/examples/posets.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.all import Posets
from sage.categories.posets import Posets
from sage.structure.element_wrapper import ElementWrapper
from sage.sets.set import Set, Set_object_enumerated
from sage.sets.positive_integers import PositiveIntegers
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/examples/semigroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element_wrapper import ElementWrapper
from sage.categories.all import Semigroups
from sage.categories.semigroups import Semigroups
from sage.sets.family import Family

class LeftZeroSemigroup(UniqueRepresentation, Parent):
Expand Down
3 changes: 2 additions & 1 deletion src/sage/categories/examples/semigroups_cython.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Examples of semigroups in cython

from sage.structure.parent cimport Parent
from sage.structure.element cimport Element
from sage.categories.all import Category, Semigroups
from sage.categories.category import Category
from sage.categories.semigroups import Semigroups
from sage.categories.examples.semigroups import LeftZeroSemigroup as LeftZeroSemigroupPython
from cpython.object cimport PyObject_RichCompare

Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/examples/sets_cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from sage.categories.sets_cat import Sets
from sage.rings.integer import Integer, IntegerWrapper
from sage.rings.integer_ring import IntegerRing
from sage.arith.all import is_prime
from sage.arith.misc import is_prime
from sage.structure.unique_representation import UniqueRepresentation


Expand Down
4 changes: 3 additions & 1 deletion src/sage/categories/examples/with_realizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

from sage.misc.cachefunc import cached_method
from sage.misc.bindable_class import BindableClass
from sage.categories.all import Rings, Algebras, AlgebrasWithBasis
from sage.categories.rings import Rings
from sage.categories.algebras import Algebras
from sage.categories.algebras_with_basis import AlgebrasWithBasis
from sage.categories.realizations import Category_realization_of_parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.parent import Parent
Expand Down
4 changes: 2 additions & 2 deletions src/sage/categories/finite_complex_reflection_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ def base_change_matrix(self):
[ 1 0]
[E(4) 1]
"""
from sage.matrix.all import Matrix
from sage.matrix.constructor import Matrix
return Matrix(list(self.independent_roots())).inverse()

class ElementMethods:
Expand Down Expand Up @@ -1187,7 +1187,7 @@ def rational_catalan_number(self, p, polynomial=False):
sage: W.rational_catalan_number(3, polynomial=True)
q^6 + q^4 + q^3 + q^2 + 1
"""
from sage.arith.all import gcd
from sage.arith.misc import GCD as gcd
from sage.combinat.q_analogues import q_int

h = self.coxeter_number()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ def FiniteDimensionalBialgebrasWithBasis(base_ring):

sage: TestSuite(C).run()
"""
from sage.categories.all import BialgebrasWithBasis
from sage.categories.bialgebras_with_basis import BialgebrasWithBasis
return BialgebrasWithBasis(base_ring).FiniteDimensional()
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ def FiniteDimensionalCoalgebrasWithBasis(base_ring):

sage: TestSuite(C).run()
"""
from sage.categories.all import CoalgebrasWithBasis
from sage.categories.coalgebras_with_basis import CoalgebrasWithBasis
return CoalgebrasWithBasis(base_ring).FiniteDimensional()
2 changes: 1 addition & 1 deletion src/sage/categories/graded_bialgebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ def GradedBialgebras(base_ring):

sage: TestSuite(C).run()
"""
from sage.categories.all import Bialgebras
from sage.categories.bialgebras import Bialgebras
return Bialgebras(base_ring).Graded()
2 changes: 1 addition & 1 deletion src/sage/categories/graded_bialgebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ def GradedBialgebrasWithBasis(base_ring):

sage: TestSuite(C).run()
"""
from sage.categories.all import BialgebrasWithBasis
from sage.categories.bialgebras_with_basis import BialgebrasWithBasis
return BialgebrasWithBasis(base_ring).Graded()
2 changes: 1 addition & 1 deletion src/sage/categories/graded_hopf_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ def GradedHopfAlgebras(base_ring):
:class:`super Hopf algebras
<sage.categories.hopf_algebras.HopfAlgebras.Super>`.
"""
from sage.categories.all import HopfAlgebras
from sage.categories.hopf_algebras import HopfAlgebras
return HopfAlgebras(base_ring).Graded()
2 changes: 1 addition & 1 deletion src/sage/categories/map.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ cdef class Section(Map):
To: Multivariate Polynomial Ring in x, y over Rational Field
"""
from sage.categories.homset import Hom
from sage.categories.all import SetsWithPartialMaps
from sage.categories.sets_with_partial_maps import SetsWithPartialMaps
Map.__init__(self, Hom(map.codomain(), map.domain(), SetsWithPartialMaps()))
self._inverse = map # TODO: Use this attribute somewhere!

Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/monoid_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ def MonoidAlgebras(base_ring):

sage: TestSuite(MonoidAlgebras(ZZ)).run()
"""
from sage.categories.all import Monoids
from sage.categories.monoids import Monoids
return Monoids().Algebras(base_ring)
2 changes: 1 addition & 1 deletion src/sage/categories/schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _call_(self, x):
from sage.categories.commutative_rings import CommutativeRings
from sage.schemes.generic.spec import Spec
from sage.categories.map import Map
from sage.categories.all import Rings
from sage.categories.rings import Rings
if x in CommutativeRings():
return Spec(x)
elif isinstance(x, Map) and x.category_for().is_subcategory(Rings()):
Expand Down
5 changes: 3 additions & 2 deletions src/sage/matrix/matrix2.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ from sage.structure.coerce cimport coercion_model
from sage.structure.element import is_Vector
from sage.structure.element cimport have_same_parent
from sage.misc.verbose import verbose, get_verbose
from sage.categories.all import Fields, IntegralDomains
from sage.categories.fields import Fields
from sage.categories.integral_domains import IntegralDomains
from sage.rings.ring import is_Ring
from sage.rings.number_field.number_field_base import is_NumberField
from sage.rings.integer_ring import ZZ, is_IntegerRing
Expand Down Expand Up @@ -16820,7 +16821,7 @@ cdef class Matrix(Matrix1):
...
ValueError: 'subdivide' keyword must be True or False, not garbage
"""
from sage.arith.all import gcd
from sage.arith.misc import GCD as gcd
import sage.rings.polynomial.polynomial_ring_constructor
from sage.matrix.constructor import (block_diagonal_matrix,
companion_matrix)
Expand Down
2 changes: 1 addition & 1 deletion src/sage/matrix/matrix_cdv.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cpdef hessenbergize_cdvf(Matrix_generic_dense H):
a complete discrete valuation field.

The pivot on each column is always chosen
with maximal relative precision, which ensures
with maximal relative precision, which ensures
the numerical stability of the algorithm.

TESTS::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/matrix/matrix_complex_ball_dense.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ cdef class Matrix_complex_ball_dense(Matrix_dense):
EXAMPLES::

sage: from sage.matrix.benchmark import hilbert_matrix
sage: mat = hilbert_matrix(3).change_ring(CBF)
sage: mat = hilbert_matrix(3).change_ring(CBF)
sage: eigval, eigvec, _ = mat.eigenvectors_right_approx()[0]
doctest:...: FutureWarning: This class/method/function is marked as experimental.
...
Expand Down Expand Up @@ -834,7 +834,7 @@ cdef class Matrix_complex_ball_dense(Matrix_dense):
EXAMPLES::

sage: from sage.matrix.benchmark import hilbert_matrix
sage: mat = hilbert_matrix(3).change_ring(CBF)
sage: mat = hilbert_matrix(3).change_ring(CBF)
sage: eigval, eigvec, _ = mat.eigenvectors_right()[0]
doctest:...: FutureWarning: This class/method/function is marked as experimental.
...
Expand Down
2 changes: 1 addition & 1 deletion src/sage/matrix/matrix_cyclo_dense.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ from .matrix_integer_dense cimport _lift_crt
from sage.structure.element cimport Matrix as baseMatrix
from .misc import matrix_integer_dense_rational_reconstruction

from sage.arith.misc import binomial, previous_prime
from sage.rings.rational_field import QQ
from sage.rings.integer_ring import ZZ
from sage.arith.all import previous_prime, binomial
from sage.rings.real_mpfr import create_RealNumber as RealNumber
from sage.rings.integer cimport Integer
from sage.rings.rational cimport Rational
Expand Down
2 changes: 1 addition & 1 deletion src/sage/matrix/matrix_integer_dense.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ from sage.modules.vector_integer_dense cimport Vector_integer_dense
from sage.misc.misc import cputime
from sage.misc.verbose import verbose, get_verbose

from sage.arith.all import previous_prime
from sage.arith.misc import previous_prime
from sage.arith.long cimport integer_check_long_py
from sage.arith.power cimport generic_power
from sage.structure.element cimport Element
Expand Down
8 changes: 4 additions & 4 deletions src/sage/matrix/matrix_integer_dense_hnf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

from copy import copy

from sage.arith.misc import CRT_list, previous_prime
from sage.misc.misc import cputime
from sage.misc.verbose import verbose
from sage.matrix.constructor import (random_matrix, matrix, identity_matrix)

from sage.rings.integer import Integer
from sage.rings.integer_ring import ZZ
from sage.rings.real_mpfr import RR
from sage.rings.integer import Integer
from sage.arith.all import previous_prime, CRT_list

from .constructor import identity_matrix, matrix, random_matrix


def max_det_prime(n):
Expand Down
Loading