Opened 2 years ago

Closed 2 years ago

#28644 closed defect (fixed)

unicode art fails for empty skew partition

Reported by: mantepse Owned by:
Priority: major Milestone: sage-9.0
Component: combinatorics Keywords:
Cc: Merged in:
Authors: Frédéric Chapoton Reviewers: Martin Rubey
Report Upstream: N/A Work issues:
Branch: 410d40b (Commits, GitHub, GitLab) Commit: 410d40bb10d6fa782636bf423274cea0b1e86b81
Dependencies: Stopgaps:

Status badges

Description

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

Change History (4)

comment:1 Changed 2 years ago by chapoton

  • Authors set to Frédéric Chapoton
  • Branch set to u/chapoton/28644
  • Commit set to 410d40bb10d6fa782636bf423274cea0b1e86b81
  • Status changed from new to needs_review

done


New commits:

410d40bfix for unicode art of empty skew partition

comment:2 Changed 2 years ago by chapoton

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

comment:3 Changed 2 years ago by mantepse

  • Reviewers set to Martin Rubey
  • Status changed from needs_review to positive_review

Thank you, very beautiful!

comment:4 Changed 2 years ago by vbraun

  • Branch changed from u/chapoton/28644 to 410d40bb10d6fa782636bf423274cea0b1e86b81
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.