Ticket #13203 (closed defect: fixed)

Opened 11 months ago

Last modified 4 months ago

Promotion on Tableaux should force its argument to be an Integer.

Reported by: nthiery Owned by: sage-combinat
Priority: major Milestone: sage-5.6
Component: combinatorics Keywords: tableaux, promotion
Cc: sage-combinat, schilling Work issues:
Report Upstream: N/A Reviewers: Nicolas M. Thiéry
Authors: Frédéric Chapoton Merged in: sage-5.6.beta3
Dependencies: #13074 Stopgaps:

Description

The entries of a tableau are Integers::

    sage: T = Tableau([[1]])
    sage: type(T[0][0])
    <type 'sage.rings.integer.Integer'>

This invariant should be preserved by inverse promotion::

    sage: type(T.promotion_inverse(2)[0][0])
    <type 'sage.rings.integer.Integer'>

But this is currently not if the input is a plain int::

    sage: type(T.promotion_inverse(int(2))[0][0])
    <type 'int'>

Attachments

trac_13203_promotion_integer-fc.patch Download (1.3 KB) - added by chapoton 8 months ago.

Change History

comment:1 Changed 11 months ago by nthiery

  • Cc schilling added
  • Type changed from PLEASE CHANGE to defect

comment:2 Changed 10 months ago by chapoton

  • Status changed from new to needs_review
  • Authors changed from Anne Schilling to Frédéric Chapoton

comment:3 Changed 10 months ago by chapoton

Could somebody please review this patch ?

comment:4 Changed 10 months ago by mhansen

Could you add

    sage: type(T.promotion_inverse(int(2))[0][0])
    <type 'sage.rings.integer.Integer'>

as a doctest?

comment:5 Changed 10 months ago by chapoton

Here is a new ticket, with a doctest added.

comment:6 Changed 9 months ago by chapoton

rebased on 5.2

comment:7 Changed 8 months ago by nthiery

I just had a look, and this sounds good. For consistency, can you put spaces on both sides of the = sign, and move this line just after the is_rectangular test (putting together all the argument checks/preprocessing).

Once done, you can set a positive review on my behalf (where is the patchbot?)

Ah: it depends syntactically on #13074. I just moved your patch right after it in the queue; please run the tests with them applied.

Thanks!

Cheers,

Nicolas

Changed 8 months ago by chapoton

comment:8 Changed 8 months ago by chapoton

I have made the changes, and the tests pass. I do not understand whether I should add the dependency to #13074 or not.

comment:9 Changed 8 months ago by nthiery

  • Status changed from needs_review to positive_review

Unless you commute this patch past #13074, yes it should be a dependency (done)

Last edited 8 months ago by nthiery (previous) (diff)

comment:10 Changed 8 months ago by nthiery

  • Dependencies set to #13074

comment:11 Changed 8 months ago by jdemeyer

  • Milestone changed from sage-5.4 to sage-pending

comment:12 Changed 5 months ago by jdemeyer

  • Milestone changed from sage-pending to sage-5.6

comment:13 Changed 4 months ago by jdemeyer

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-5.6.beta3
Note: See TracTickets for help on using tickets.