#17979: Reimplementation of IntegerListsLex
-------------------------------------+-------------------------------------
       Reporter:  aschilling         |        Owner:
           Type:  defect             |       Status:  needs_work
       Priority:  blocker            |    Milestone:  sage-6.6
      Component:  combinatorics      |   Resolution:
       Keywords:  days64             |    Merged in:
        Authors:  Bryan Gillespie,   |    Reviewers:
  Anne Schilling, Nicolas M. Thiery  |  Work issues:  support n in an
Report Upstream:  N/A                |  iterable
         Branch:                     |       Commit:
  public/ticket/17979                |  cb18ced22db714063e744bb907a035b4fe3afa24
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by bgillespie):

 Replying to [comment:48 jdemeyer]:
 > I dislike the fact that the warning shows even in cases where the output
 is obviously finite:
 > {{{
 > sage: IntegerListsLex(5, ceiling=lambda i:i, length=5)
 > /usr/local/src/sage-config/local/lib/python2.7/site-
 packages/sage/combinat/integer_list.py:606: UserWarning: When the user
 specifies a method, then (s)he is responsible that the algorithm
 >             will not hang. Also note that the specified function should
 start at 0 rather than 1.
 >             Before trac#17979 the indexing was ambiguous and sometimes
 started at 1.
 >   Before trac#17979 the indexing was ambiguous and sometimes started at
 1.""")
 > Integer lists of sum 5 satisfying certain constraints
 > }}}
 >
 > Also note that the formatting of the warning is not quite right.

 I updated the formatting of the warning (also the message to be more
 explicit/verbose), so check if it looks reasonable to you.

 Here's what our thought process was concerning when to raise a warning
 message.  We could easily do some additional computations to find certain
 cases where the specified parameters make giving a custom function safe.
 However, one of the complaints with the old version was that it was
 difficult to understand how the parameters affected the output.  If we
 make it "sometimes" verifiably safe to use a custom function, depending on
 the circumstances, then that's another point of complexity for the user to
 follow--but if we just raise a warning whenever a user uses a custom floor
 or ceiling function (but only if they haven't "signed a waiver" by
 specifying `waiver=True`), that simplifies the interface for the user.

 Also note that the example you gave could be handled by the following
 specification without raising a warning:
 {{{
 sage: IntegerListsLex(5, ceiling=[0,1,2,3,4], length=5)
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/17979#comment:71>
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.

Reply via email to