#18270: Print matrices using unicode large delimiters (on demand)
-------------------------------------+-------------------------------------
Reporter: gagern | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.7
Component: user interface | Resolution:
Keywords: unicode matrix | Merged in:
Authors: Martin von Gagern | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/gagern/MatrixUnicodeDelimiters | e174830facfed57934dec14cf107ffd6952955b5
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
Replying to [comment:9 gagern]:
> Replying to [comment:8 vdelecroix]:
> > review comment:
> > - I would very much prefer that you avoid `replace` as well as the
final step which deals with the top and bottom line. You should rather
define '''all''' the characters needed as variables at the begining (as
you did for `left_bracket`, `right_bracket`, etc). That would help for
readability and if at some point we decide that all these characters are
arguments of the function.
>
> Indeed when I started this patch, I had a line like
>
> top_left_bracket, mid_left_bracket, … = u"⎡⎢⎣⎤⎥⎦"
>
> but the long names made things very hard to read. And shorter
alternatives, like `tlb`, make things a bit hard to understand and
therefore harder to maintain. Quite the opposite of “help for
readability”, in my opinion. But if you insist, I can go with this
approach, using the short names.
If there are comments it is fine. For example
{{{
tlb = u"⎡" # top left bracket
...
}}}
or
{{{
# we set delimiters as a string composed of 6 characters
# - top left bracket (tlb)
# ...
if unicode_symbols:
delimiters = u"⎡⎢⎣⎤⎥⎦"
else:
delimiters = "[[[]]]"
tlb, ... = delimiters
}}}
> > - why not curly bracket?
>
> Because I don't encounter them in my day-to-day work. Can you give me a
hint as to where these might occur? For an even number of rows (except
two), big curly brackets would look slightly unsymmetric, but I doubt that
should be a concern.
By "curly", I meant only using ⎧ ⎫ ⎩ ⎭ instead of your more angular
version. The term was probably wrong. See
{{{
sage: m = matrix([[2,1],[0,1]])
sage: view(m)
}}}
... no angle...
--
Ticket URL: <http://trac.sagemath.org/ticket/18270#comment:10>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.