Changeset 9940:a4af8643d113 in orange


Ignore:
Timestamp:
02/07/12 18:40:51 (2 years ago)
Author:
Jure Zbontar <jure.zbontar@…>
Branch:
default
Message:

Fixed failing doctest in misc/counters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/misc/counters.py

    r9871 r9940  
    1919    One way to use the counter is within a for-loop: 
    2020 
    21     >>> for r in Orange.misc.counters.BooleanCounter(3): 
     21    >>> for r in BooleanCounter(3): 
    2222    ...    print r 
    2323    [0, 0, 0] 
     
    3232    You can also call it manually. 
    3333 
    34     >>> r = Orange.misc.counters.BooleanCounter(3) 
     34    >>> r = BooleanCounter(3) 
    3535    >>> r.next() 
    3636    [0, 0, 0] 
     
    8080    from 0 to 1, but to the limits that are specified individually for each digit. 
    8181 
    82     >>> for t in Orange.misc.counters.LimitedCounter([3, 5, 2]): 
     82    >>> for t in LimitedCounter([3, 5]): 
    8383    ...     print t 
    84     [0, 0, 0] 
    85     [0, 0, 1] 
    86     [0, 1, 0] 
    87     [0, 1, 1] 
    88     [0, 2, 0] 
    89     [0, 2, 1] 
    90     [0, 3, 0] 
    91     [0, 3, 1] 
    92     [0, 4, 0] 
    93     [0, 4, 1] 
    94     [1, 0, 0] 
    95     [1, 0, 1] 
    96     [1, 1, 0] 
    97     [1, 1, 1] 
     84    [0, 0] 
     85    [0, 1] 
     86    [0, 2] 
     87    [0, 3] 
     88    [0, 4] 
     89    [1, 0] 
     90    [1, 1] 
     91    [1, 2] 
     92    [1, 3] 
     93    [1, 4] 
     94    [2, 0] 
     95    [2, 1] 
     96    [2, 2] 
     97    [2, 3] 
     98    [2, 4] 
    9899 
    99100    .. attribute:: state 
     
    139140    Counter returns all consecutive subset lists of length ``m`` out of ``n`` where ``m`` <= ``n``. 
    140141 
    141     >>> for t in Orange.misc.counters.MofNCounter(3,7): 
     142    >>> for t in MofNCounter(3,7): 
    142143    ...     print t 
    143144    ... 
     
    203204    Or, with an example 
    204205 
    205     >>> for t in Orange.misc.counters.NondecreasingCounter(4): 
     206    >>> for t in NondecreasingCounter(4): 
    206207    ...     print t 
    207208    ... 
     
    258259    The sequences generated are equivalent to all possible functions from a set of cardinality of the sequences length. 
    259260 
    260     >>> for t in Orange.misc.counters.CanonicFuncCounter(4): 
     261    >>> for t in CanonicFuncCounter(4): 
    261262    ...     print t 
    262263    ... 
Note: See TracChangeset for help on using the changeset viewer.