#9370: customize printing of elements in CombinatorialFreeModules
-----------------------------+----------------------------------------------
Reporter: jhpalmieri | Owner: sage-combinat
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.5
Component: combinatorics | Keywords:
Author: John Palmieri | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
Changes (by saliola):
* status: new => needs_work
Comment:
Hello John,
I like your ideas. I have a few quick comments for you now.
Comments on the docstring for {{{CombinatorialFreeModule}}}:
{{{
- ``basis_keys`` - list, tuple, family, set, etc. defining the
basis of this module
}}}
basis_keys provides the indexing set for the basis, not the basis itself.
{{{
- ``element_class`` - the class of which elements of this module
should be instances (optional, default None)
}}}
I understand that the default argument is None, but it would be nice to
have a description of the class used in that case since elements are not
instances of None.
{{{
- ``prefix`` - prefix used for printing elements of this module
(optional, default 'B'). With the default, a monomial indexed
by 'a' would be printed as ``B['a']``.
- ``latex_prefix`` - prefix used in the LaTeX representation of
elements (optional, default same as 'prefix'). With the
default, a monomial indexed by 'a' would be printed as
``B_{a}``. If this is the empty string, then don't print
monomials as subscripts: the monomial indexed by 'a' would be
printed as ``a``, or as ``[a]`` if ``latex_bracket`` is True.
}}}
It doesn't say here, but it seems that prefix and latex_prefix are
supposed
to be strings. Or anything that concatenates with a string (for example, I
think any instance of LatexExpr will work).
{{{
- ``repr_bracket`` - whether to print a bracket when printing
elements (optional, default True). If it is one of "[", "(", or
"{", use it and its partner as brackets. If this is any other
string, use it as both brackets.
}}}
Please describe what bracket gets used with the default option. Also, the
code sets the default to None, not True.
And perhaps a method called print_options might be useful (instead of
pointing the user to an "internal" attribute). With no arguments, it will
return _print_options and otherwise it will set the appropriate option.
For example,
{{{
sage: A.print_options(repr_bracket="|") # to change repr_bracket
}}}
What do you think?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9370#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.