Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez authored Oct 30, 2023
1 parent 9eab458 commit bac9d7c
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 15 deletions.
91 changes: 86 additions & 5 deletions src/sage/categories/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,49 +25,130 @@
"""
# install the docstring of this module to the containing package
from sage.misc.namespace_package import install_doc

install_doc(__package__, __doc__)

from sage.categories import primer

from sage.misc.lazy_import import lazy_import

from sage.categories.all__sagemath_objects import *

from sage.categories.basic import *

from sage.categories.chain_complexes import ChainComplexes, HomologyFunctor

from sage.categories.simplicial_complexes import SimplicialComplexes

from sage.categories.tensor import tensor
from sage.categories.signed_tensor import tensor_signed

from sage.categories.g_sets import GSets
from sage.categories.pointed_sets import PointedSets

from sage.categories.sets_with_grading import SetsWithGrading

from sage.categories.groupoid import Groupoid
from sage.categories.permutation_groups import PermutationGroups

# enumerated sets
from sage.categories.finite_sets import FiniteSets
from sage.categories.enumerated_sets import EnumeratedSets
from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets

# posets
from sage.categories.posets import Posets
from sage.categories.finite_posets import FinitePosets
from sage.categories.lattice_posets import LatticePosets
from sage.categories.finite_lattice_posets import FiniteLatticePosets

# finite groups/...
from sage.categories.finite_semigroups import FiniteSemigroups
from sage.categories.finite_monoids import FiniteMonoids
from sage.categories.finite_groups import FiniteGroups
from sage.categories.finite_permutation_groups import FinitePermutationGroups

# fields
from sage.categories.number_fields import NumberFields
from sage.categories.function_fields import FunctionFields

# modules
from sage.categories.modules import Modules
from sage.misc.lazy_import import lazy_import
from sage.categories.left_modules import LeftModules
from sage.categories.right_modules import RightModules
from sage.categories.bimodules import Bimodules

from sage.categories.modules import Modules
RingModules = Modules
from sage.categories.vector_spaces import VectorSpaces

# (hopf) algebra structures
from sage.categories.algebras import Algebras
from sage.categories.commutative_algebras import CommutativeAlgebras
from sage.categories.coalgebras import Coalgebras
from sage.categories.bialgebras import Bialgebras
from sage.categories.hopf_algebras import HopfAlgebras
from sage.categories.lie_algebras import LieAlgebras

# specific algebras
from sage.categories.monoid_algebras import MonoidAlgebras
from sage.categories.group_algebras import GroupAlgebras
from sage.categories.matrix_algebras import MatrixAlgebras

# ideals
from sage.categories.ring_ideals import RingIdeals

Ideals = RingIdeals
from sage.categories.commutative_ring_ideals import CommutativeRingIdeals
from sage.categories.algebra_modules import AlgebraModules
from sage.categories.algebra_ideals import AlgebraIdeals
from sage.categories.commutative_algebra_ideals import CommutativeAlgebraIdeals

# schemes and varieties
from sage.categories.modular_abelian_varieties import ModularAbelianVarieties
from sage.categories.schemes import Schemes

# * with basis
from sage.categories.modules_with_basis import ModulesWithBasis

FreeModules = ModulesWithBasis
from sage.categories.hecke_modules import HeckeModules
from sage.categories.algebras_with_basis import AlgebrasWithBasis
from sage.categories.coalgebras_with_basis import CoalgebrasWithBasis
from sage.categories.bialgebras_with_basis import BialgebrasWithBasis
from sage.categories.hopf_algebras_with_basis import HopfAlgebrasWithBasis

# finite dimensional * with basis
from sage.categories.finite_dimensional_modules_with_basis import FiniteDimensionalModulesWithBasis
from sage.categories.finite_dimensional_algebras_with_basis import FiniteDimensionalAlgebrasWithBasis
from sage.categories.finite_dimensional_coalgebras_with_basis import FiniteDimensionalCoalgebrasWithBasis
from sage.categories.finite_dimensional_bialgebras_with_basis import FiniteDimensionalBialgebrasWithBasis
from sage.categories.finite_dimensional_hopf_algebras_with_basis import FiniteDimensionalHopfAlgebrasWithBasis

# graded *
from sage.categories.graded_modules import GradedModules
from sage.categories.graded_algebras import GradedAlgebras
from sage.categories.graded_coalgebras import GradedCoalgebras
from sage.categories.graded_bialgebras import GradedBialgebras
from sage.categories.graded_hopf_algebras import GradedHopfAlgebras

# graded * with basis
from sage.categories.graded_modules_with_basis import GradedModulesWithBasis
from sage.categories.graded_algebras_with_basis import GradedAlgebrasWithBasis
from sage.categories.graded_coalgebras_with_basis import GradedCoalgebrasWithBasis
from sage.categories.graded_bialgebras_with_basis import GradedBialgebrasWithBasis
from sage.categories.graded_hopf_algebras_with_basis import GradedHopfAlgebrasWithBasis

# Coxeter groups
from sage.categories.coxeter_groups import CoxeterGroups
lazy_import('sage.categories.finite_coxeter_groups', 'FiniteCoxeterGroups')
from sage.categories.weyl_groups import WeylGroups
from sage.categories.finite_weyl_groups import FiniteWeylGroups
from sage.categories.affine_weyl_groups import AffineWeylGroups

# crystal bases
from sage.categories.crystals import Crystals
from sage.categories.highest_weight_crystals import HighestWeightCrystals
from sage.categories.regular_crystals import RegularCrystals
from sage.categories.finite_crystals import FiniteCrystals
from sage.categories.classical_crystals import ClassicalCrystals

# polyhedra
lazy_import('sage.categories.polyhedra', 'PolyhedralSets')
Expand Down
14 changes: 13 additions & 1 deletion src/sage/categories/all__sagemath_objects.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
# Subset of sage.categories.all that is made available by the sage-objects distribution

from sage.misc.lazy_import import lazy_import

# Resolve a circular import so that "import sage.categories.all" can succeed
# in initializing the category system.
import sage.structure.category_object # imports sage.categories.category

# Small part of "from .basic import *":
# Small part of "from sage.categories.basic import *":
from sage.categories.objects import Objects
from sage.categories.sets_cat import Sets, EmptySetError


from sage.categories.category import Category

from sage.categories.category_types import Elements

from sage.categories.cartesian_product import cartesian_product

from sage.categories.functor import ForgetfulFunctor, IdentityFunctor

from sage.categories.homset import Hom, hom, End, end, Homset, HomsetWithBase

from sage.categories.morphism import Morphism

from sage.categories.realizations import Realizations

from sage.categories.sets_with_partial_maps import SetsWithPartialMaps
45 changes: 40 additions & 5 deletions src/sage/categories/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,59 @@
A subset of sage.categories.all with just the basic categories needed
for sage startup (i.e. to define ZZ, QQ, ...).
"""
#*****************************************************************************
# *****************************************************************************
# Copyright (C) 2008-2009 Nicolas M. Thiery <nthiery at users.sf.net>
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#******************************************************************************
# ******************************************************************************

from sage.categories.objects import Objects
from sage.categories.sets_cat import Sets, EmptySetError
from sage.categories.posets import Posets

# For backward compatibility; will be deprecated at some point
PartiallyOrderedSets = Posets
OrderedSets = Posets


from sage.categories.additive_magmas import AdditiveMagmas
from sage.categories.commutative_additive_semigroups import (
CommutativeAdditiveSemigroups,
)
from sage.categories.commutative_additive_monoids import CommutativeAdditiveMonoids
from sage.categories.commutative_additive_groups import CommutativeAdditiveGroups

from sage.categories.magmas import Magmas
from sage.categories.semigroups import Semigroups
from sage.categories.monoids import Monoids
from sage.categories.groups import Groups
from sage.categories.partially_ordered_monoids import PartiallyOrderedMonoids

# For backward compatibility; might be deprecated at some point
OrderedMonoids = PartiallyOrderedMonoids



from sage.categories.rngs import Rngs
from sage.categories.semirings import Semirings
from sage.categories.rings import Rings
from sage.categories.domains import Domains
from sage.categories.division_rings import DivisionRings

from sage.categories.commutative_rings import CommutativeRings
from sage.categories.integral_domains import IntegralDomains
from sage.categories.gcd_domains import GcdDomains
from sage.categories.principal_ideal_domains import PrincipalIdealDomains
from sage.categories.euclidean_domains import EuclideanDomains
from sage.categories.unique_factorization_domains import UniqueFactorizationDomains
from sage.categories.complete_discrete_valuation import CompleteDiscreteValuationRings

from sage.categories.fields import Fields
from sage.categories.quotient_fields import QuotientFields
from sage.categories.finite_fields import FiniteFields
from sage.categories.discrete_valuation import (
DiscreteValuationRings,
DiscreteValuationFields,
)
from sage.categories.complete_discrete_valuation import (
CompleteDiscreteValuationRings,
CompleteDiscreteValuationFields,
)
2 changes: 0 additions & 2 deletions src/sage/categories/category_singleton.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ from sage.categories.category import Category
from sage.structure.category_object cimport CategoryObject
from sage.structure.dynamic_class import DynamicMetaclass

# I have no idea why this is necessary, but otherwise the type import fails
from cpython.method cimport PyMethod_Check
from cpython.type cimport PyType_IsSubtype

# This helper class is used to implement Category_singleton.__contains__
Expand Down
4 changes: 2 additions & 2 deletions src/sage/categories/chain_complexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ def _apply_functor_to_morphism(self, f):
sage: id_star(one)
[one]
"""
from .homset import Hom
from .morphism import SetMorphism
from sage.categories.homset import Hom
from sage.categories.morphism import SetMorphism

domain = f.domain()
codomain = f.codomain()
Expand Down

0 comments on commit bac9d7c

Please sign in to comment.