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

Commit

Permalink
Merge branch 'public/combinat/sf/sp_orth' of trac.sagemath.org:sage i…
Browse files Browse the repository at this point in the history
…nto public/combinat/sf/sp_orth
  • Loading branch information
Travis Scrimshaw committed Nov 2, 2015
2 parents c4c1416 + d8d3eda commit 0513f6a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 10 deletions.
6 changes: 5 additions & 1 deletion src/sage/combinat/ncsf_qsym/ncsf.py
Expand Up @@ -32,6 +32,7 @@
from sage.functions.other import factorial
from sage.categories.realizations import Category_realization_of_parent
from sage.categories.rings import Rings
from sage.categories.fields import Fields
from sage.categories.graded_hopf_algebras import GradedHopfAlgebras
from sage.combinat.composition import Compositions
from sage.combinat.free_module import CombinatorialFreeModule
Expand Down Expand Up @@ -401,9 +402,12 @@ def __init__(self, R):
r"""
TESTS::
sage: NCSF1 = NonCommutativeSymmetricFunctions(FiniteField(23))
sage: NCSF2 = NonCommutativeSymmetricFunctions(Integers(23))
sage: TestSuite(NonCommutativeSymmetricFunctions(QQ)).run()
"""
assert(R in Rings())
# change the line below to assert(R in Rings()) once MRO issues from #15536, #15475 are resolved
assert(R in Fields() or R in Rings()) # side effect of this statement assures MRO exists for R
self._base = R # Won't be needed once CategoryObject won't override base_ring
Parent.__init__(self, category = GradedHopfAlgebras(R).WithRealizations())

Expand Down
7 changes: 5 additions & 2 deletions src/sage/combinat/ncsf_qsym/qsym.py
Expand Up @@ -65,8 +65,8 @@

from sage.misc.bindable_class import BindableClass
from sage.categories.graded_hopf_algebras import GradedHopfAlgebras
from sage.categories.all import CommutativeRings
from sage.categories.rings import Rings
from sage.categories.fields import Fields
from sage.categories.realizations import Category_realization_of_parent
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
Expand Down Expand Up @@ -529,9 +529,12 @@ def __init__(self, R):
sage: QuasiSymmetricFunctions(QQ)
Quasisymmetric functions over the Rational Field
sage: QSym1 = QuasiSymmetricFunctions(FiniteField(23))
sage: QSym2 = QuasiSymmetricFunctions(Integers(23))
sage: TestSuite(QuasiSymmetricFunctions(QQ)).run()
"""
assert R in Rings()
# change the line below to assert(R in Rings()) once MRO issues from #15536, #15475 are resolved
assert(R in Fields() or R in Rings()) # side effect of this statement assures MRO exists for R
self._base = R # Won't be needed once CategoryObject won't override base_ring
category = GradedHopfAlgebras(R) # TODO: .Commutative()
self._category = category
Expand Down
6 changes: 6 additions & 0 deletions src/sage/combinat/ncsym/dual.py
Expand Up @@ -17,6 +17,8 @@
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.graded_hopf_algebras import GradedHopfAlgebras
from sage.categories.rings import Rings
from sage.categories.fields import Fields

from sage.combinat.ncsym.bases import NCSymDualBases, NCSymBasis_abstract
from sage.combinat.partition import Partition
Expand All @@ -39,8 +41,12 @@ def __init__(self, R):
EXAMPLES::
sage: NCSymD1 = SymmetricFunctionsNonCommutingVariablesDual(FiniteField(23))
sage: NCSymD2 = SymmetricFunctionsNonCommutingVariablesDual(Integers(23))
sage: TestSuite(SymmetricFunctionsNonCommutingVariables(QQ).dual()).run()
"""
# change the line below to assert(R in Rings()) once MRO issues from #15536, #15475 are resolved
assert(R in Fields() or R in Rings()) # side effect of this statement assures MRO exists for R
self._base = R # Won't be needed once CategoryObject won't override base_ring
category = GradedHopfAlgebras(R) # TODO: .Commutative()
Parent.__init__(self, category=category.WithRealizations())
Expand Down
6 changes: 6 additions & 0 deletions src/sage/combinat/ncsym/ncsym.py
Expand Up @@ -18,6 +18,8 @@
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.graded_hopf_algebras import GradedHopfAlgebras
from sage.categories.rings import Rings
from sage.categories.fields import Fields

from sage.functions.other import factorial
from sage.combinat.free_module import CombinatorialFreeModule
Expand Down Expand Up @@ -282,8 +284,12 @@ def __init__(self, R):
EXAMPLES::
sage: NCSym1 = SymmetricFunctionsNonCommutingVariables(FiniteField(23))
sage: NCSym2 = SymmetricFunctionsNonCommutingVariables(Integers(23))
sage: TestSuite(SymmetricFunctionsNonCommutingVariables(QQ)).run()
"""
# change the line below to assert(R in Rings()) once MRO issues from #15536, #15475 are resolved
assert(R in Fields() or R in Rings()) # side effect of this statement assures MRO exists for R
self._base = R # Won't be needed once CategoryObject won't override base_ring
category = GradedHopfAlgebras(R) # TODO: .Commutative()
Parent.__init__(self, category = category.WithRealizations())
Expand Down
12 changes: 5 additions & 7 deletions src/sage/combinat/sf/sf.py
Expand Up @@ -21,9 +21,9 @@
#*****************************************************************************
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.rings import Rings
from sage.categories.graded_hopf_algebras import GradedHopfAlgebras
from sage.categories.fields import Fields
from sage.categories.rings import Rings
from sage.combinat.partition import Partitions
from sage.combinat.free_module import CombinatorialFreeModule
from sage.rings.rational_field import QQ
Expand Down Expand Up @@ -829,15 +829,13 @@ def __init__(self, R):
TESTS::
sage: Sym1 = SymmetricFunctions(FiniteField(23))
sage: Sym2 = SymmetricFunctions(Integers(23))
sage: TestSuite(Sym).run()
"""
assert(R in Rings())
# FIXME: We just automatically check that the base ring is a field to
# prevent category refinement during construction of the category,
# thus preventing the MRO issues noted in #15536, #15475 (and likely others).
# Thus fix the MRO/category-refinement issue and remove the line below.
R in Fields()
# change the line below to assert(R in Rings()) once MRO issues from #15536, #15475 are resolved
assert(R in Fields() or R in Rings()) # side effect of this statement assures MRO exists for R
self._base = R # Won't be needed when CategoryObject won't override anymore base_ring
Parent.__init__(self, category = GradedHopfAlgebras(R).WithRealizations())

Expand Down

0 comments on commit 0513f6a

Please sign in to comment.