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

unicode art fails for empty skew partition #28644

Closed
mantepse opened this issue Oct 22, 2019 · 8 comments
Closed

unicode art fails for empty skew partition #28644

mantepse opened this issue Oct 22, 2019 · 8 comments

Comments

@mantepse
Copy link
Contributor

sage: unicode_art(SkewPartition([[],[]]))
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-75-4f053427a9a8> in <module>()
----> 1 unicode_art(SkewPartition([[],[]]))

/home/martin/sage-develop/local/lib/python2.7/site-packages/sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport.__call__ (build/cythonized/sage/misc/lazy_import.c:3697)()
    352             True
    353         """
--> 354         return self.get_object()(*args, **kwds)
    355 
    356     def __repr__(self):

/home/martin/sage-develop/local/lib/python2.7/site-packages/sage/typeset/unicode_art.pyc in unicode_art(*obj, **kwds)
    149         raise ValueError('unknown keyword arguments: {0}'.format(list(kwds)))
    150     if len(obj) == 1:
--> 151         return _unicode_art_factory.build(obj[0], baseline=baseline)
    152     if not isinstance(separator, UnicodeArt):
    153         separator = _unicode_art_factory.build(separator, baseline=sep_baseline)

/home/martin/sage-develop/local/lib/python2.7/site-packages/sage/typeset/character_art_factory.pyc in build(self, obj, baseline)
    120             return obj
    121         if isinstance(obj, SageObject):
--> 122             return self.build_from_magic_method(obj, baseline)
    123         if baseline is None:
    124             baseline = 0

/home/martin/sage-develop/local/lib/python2.7/site-packages/sage/typeset/character_art_factory.pyc in build_from_magic_method(self, obj, baseline)
    168         """
    169         magic_method = getattr(obj, self.magic_method_name)
--> 170         ret = magic_method()
    171         if baseline is not None:
    172             ret._baseline = baseline

/home/martin/sage-develop/local/lib/python2.7/site-packages/sage/combinat/skew_partition.pyc in _unicode_art_(self)
    466 
    467         # working with English conventions
--> 468         txt = [s * inn[0] + tl + t * (out[0] - inn[0] - 1) + tr]
    469         for i in range(len(out) - 1):
    470             o0 = out[i]

IndexError: list index out of range

Component: combinatorics

Author: Frédéric Chapoton

Branch/Commit: 410d40b

Reviewer: Martin Rubey

Issue created by migration from https://trac.sagemath.org/ticket/28644

@mantepse mantepse added this to the sage-9.0 milestone Oct 22, 2019
@fchapoton
Copy link
Contributor

Author: Frédéric Chapoton

@fchapoton
Copy link
Contributor

comment:1

done


New commits:

410d40bfix for unicode art of empty skew partition

@fchapoton
Copy link
Contributor

Branch: u/chapoton/28644

@fchapoton
Copy link
Contributor

Commit: 410d40b

@fchapoton
Copy link
Contributor

comment:2

green bot, please review. Note that the case of skew partitions with empty lines is still not working, as explained in the doc.

@mantepse
Copy link
Contributor Author

Reviewer: Martin Rubey

@mantepse
Copy link
Contributor Author

comment:3

Thank you, very beautiful!

@vbraun
Copy link
Member

vbraun commented Oct 27, 2019

Changed branch from u/chapoton/28644 to 410d40b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants