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

Deprecate is_SymmetricFunction #38279

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all 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/combinat/sf/classical.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def _element_constructor_(self, x):
##############
# Dual bases #
##############
elif sfa.is_SymmetricFunction(x) and hasattr(x, 'dual'):
elif isinstance(x, sfa.SymmetricFunctionAlgebra_generic.Element) and hasattr(x, 'dual'):
# Check to see if it is the dual of some other basis
# If it is, try to coerce its corresponding element
# in the other basis
Expand Down
10 changes: 9 additions & 1 deletion src/sage/combinat/sf/sfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,20 @@ def is_SymmetricFunction(x):
sage: from sage.combinat.sf.sfa import is_SymmetricFunction
sage: s = SymmetricFunctions(QQ).s()
sage: is_SymmetricFunction(2)
doctest:warning...
DeprecationWarning: The function is_SymmetricFunction is deprecated;
use 'isinstance(..., SymmetricFunctionAlgebra_generic.Element)' instead.
See https://github.com/sagemath/sage/issues/38279 for details.
False
sage: is_SymmetricFunction(s(2))
True
sage: is_SymmetricFunction(s([2,1]))
True
"""
from sage.misc.superseded import deprecation
deprecation(38279,
"The function is_SymmetricFunction is deprecated; "
"use 'isinstance(..., SymmetricFunctionAlgebra_generic.Element)' instead.")
return isinstance(x, SymmetricFunctionAlgebra_generic.Element)

#####################################################################
Expand Down Expand Up @@ -3429,7 +3437,7 @@ def plethysm(self, x, include=None, exclude=None):

tHA = HopfAlgebrasWithBasis(R).TensorProducts()
tensorflag = Px in tHA
if not is_SymmetricFunction(x):
if not isinstance(x, SymmetricFunctionAlgebra_generic.Element):
if R.has_coerce_map_from(Px) or x in R:
x = R(x)
Px = R
Expand Down
10 changes: 4 additions & 6 deletions src/sage/rings/lazy_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -6981,9 +6981,8 @@ def functorial_composition(self, *args):
"""
if len(args) != self.parent()._arity:
raise ValueError("arity must be equal to the number of arguments provided")
from sage.combinat.sf.sfa import is_SymmetricFunction
if not all(isinstance(g, LazySymmetricFunction)
or is_SymmetricFunction(g)
from sage.combinat.sf.sfa import SymmetricFunctionAlgebra_generic
if not all(isinstance(g, (LazySymmetricFunction, SymmetricFunctionAlgebra_generic.Element))
or not g for g in args):
raise ValueError("all arguments must be (possibly lazy) symmetric functions")

Expand Down Expand Up @@ -7200,9 +7199,8 @@ def arithmetic_product(self, *args):
"""
if len(args) != self.parent()._arity:
raise ValueError("arity must be equal to the number of arguments provided")
from sage.combinat.sf.sfa import is_SymmetricFunction
if not all(isinstance(g, LazySymmetricFunction)
or is_SymmetricFunction(g)
from sage.combinat.sf.sfa import SymmetricFunctionAlgebra_generic
if not all(isinstance(g, (LazySymmetricFunction, SymmetricFunctionAlgebra_generic.Element))
or not g for g in args):
raise ValueError("all arguments must be (possibly lazy) symmetric functions")

Expand Down
Loading