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

Commit

Permalink
Fixing options for Brauer diagrams and algebra.
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Scrimshaw committed Apr 10, 2018
1 parent e5c848a commit 179ce29
Showing 1 changed file with 37 additions and 40 deletions.
77 changes: 37 additions & 40 deletions src/sage/combinat/diagram_algebras.py
Expand Up @@ -239,40 +239,6 @@ def __init__(self, parent, d):
self._base_diagram = tuple(sorted(tuple(sorted(i)) for i in d))
super(AbstractPartitionDiagram, self).__init__(parent, self._base_diagram)

# add options to class
class options(GlobalOptions):
r"""
Set and display the global options for Brauer diagram (algebras). If no
parameters are set, then the function returns a copy of the options
dictionary.
The ``options`` to diagram algebras can be accessed as the method
:obj:`BrauerAlgebra.options` of :class:`BrauerAlgebra` and
related classes.
@OPTIONS@
EXAMPLES::
sage: R.<q> = QQ[]
sage: BA = BrauerAlgebra(2, q)
sage: E = BA([[1,2],[-1,-2]])
sage: E
B{{-2, -1}, {1, 2}}
sage: BrauerAlgebra.options.display="compact" # known bug (Trac #24323)
sage: E # known bug (Trac #24323)
B[12/12;]
sage: BrauerAlgebra.options._reset() # known bug (Trac #24323)
"""
NAME = 'Brauer diagram'
module = 'sage.combinat.diagram_algebras'
option_class='AbstractPartitionDiagram'
display = dict(default="normal",
description='Specifies how the Brauer diagrams should be printed',
values=dict(normal="Using the normal representation",
compact="Using the compact representation"),
case_sensitive=False)

def check(self):
r"""
Check the validity of the input for the diagram.
Expand Down Expand Up @@ -440,6 +406,40 @@ def __init__(self, parent, d):
"""
super(BrauerDiagram, self).__init__(parent,d)

# add options to class
class options(GlobalOptions):
r"""
Set and display the global options for Brauer diagram (algebras). If no
parameters are set, then the function returns a copy of the options
dictionary.
The ``options`` to diagram algebras can be accessed as the method
:obj:`BrauerAlgebra.options` of :class:`BrauerAlgebra` and
related classes.
@OPTIONS@
EXAMPLES::
sage: R.<q> = QQ[]
sage: BA = BrauerAlgebra(2, q)
sage: E = BA([[1,2],[-1,-2]])
sage: E
B{{-2, -1}, {1, 2}}
sage: BrauerAlgebra.options.display = "compact"
sage: E
B[12/12;]
sage: BrauerAlgebra.options._reset()
"""
NAME = 'Brauer diagram'
module = 'sage.combinat.diagram_algebras'
option_class='BrauerDiagram'
display = dict(default="normal",
description='Specifies how the Brauer diagrams should be printed',
values=dict(normal="Using the normal representation",
compact="Using the compact representation"),
case_sensitive=False)

def check(self):
r"""
Check the validity of the input for ``self``.
Expand Down Expand Up @@ -859,7 +859,7 @@ class BrauerDiagrams(AbstractPartitionDiagrams):
sage: bd.options._reset()
"""
Element = BrauerDiagram
options = AbstractPartitionDiagram.options
options = BrauerDiagram.options

def __init__(self, order, category=None):
r"""
Expand Down Expand Up @@ -1912,6 +1912,8 @@ def __init__(self, k, q, base_ring, prefix):
"""
SubPartitionAlgebra.__init__(self, k, q, base_ring, prefix, BrauerDiagrams(k))

options = BrauerDiagram.options

def _repr_(self):
"""
Return a string representation of ``self``.
Expand Down Expand Up @@ -2689,8 +2691,3 @@ def set_partition_composition(sp1, sp2):
# END BORROWED CODE
##########################################################################

# Deprecations from trac:18555. July 2016
from sage.misc.superseded import deprecated_function_alias
AbstractPartitionDiagram.global_options=deprecated_function_alias(18555, AbstractPartitionDiagram.options)
BrauerDiagramOptions = deprecated_function_alias(18555, AbstractPartitionDiagram.options)
BrauerDiagrams.global_options = deprecated_function_alias(18555, BrauerDiagrams.options)

0 comments on commit 179ce29

Please sign in to comment.