Ticket #9392: trac_9392-first_reviewer.patch

File trac_9392-first_reviewer.patch, 1.4 KB (added by leif, 9 years ago)

Fixes non-optional doctesting. Apply on top of Nathann's patch.

  • sage/numerical/optimize.py

    # HG changeset patch
    # User Leif Leonhardy <not.really@online.de>
    # Date 1278274007 -7200
    # Node ID f33ad853b0a78286c9b35b8172d6631081776dd9
    # Parent  415efe09065e11cb108eec6034845dbd44b0077f
    #9392 broken doctest due to different (valid) solutions from binpacking - first reviewer patch
    
    Fixes: Modified doctest fails on "normal" (non-optional) testing because of undefined variables.
    Apply on top of Nathann Cohen's patch.
    
    diff -r 415efe09065e -r f33ad853b0a7 sage/numerical/optimize.py
    a b  
    699699        sage: from sage.numerical.optimize import binpacking
    700700        sage: values = [1/5, 1/3, 2/3, 3/4, 5/7]
    701701        sage: bins = binpacking(values) # optional - GLPK, CBC
    702         sage: len(bins)
     702        sage: len(bins) # optional - GLPK, CBC
    703703        3
    704704
    705705    Checking the bins are of correct size ::
    706706
    707         sage: all([ sum(b)<= 1 for b in bins ])
     707        sage: all([ sum(b)<= 1 for b in bins ]) # optional - GLPK, CBC
    708708        True
    709709
    710710    Checking every item is in a bin ::
    711711
    712         sage: b1, b2, b3 = bins
    713         sage: all([ (v in b1 or v in b2 or v in b3) for v in values ])
     712        sage: b1, b2, b3 = bins # optional - GLPK, CBC
     713        sage: all([ (v in b1 or v in b2 or v in b3) for v in values ]) # optional - GLPK, CBC
    714714        True
    715715
    716716    One way to use only three boxes (which is best possible) is to put