Changeset 839


Ignore:
Timestamp:
10/24/15 08:43:05 (7 months ago)
Author:
mmckerns
Message:

fix spelling error for suppress

Location:
mystic
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • mystic/examples/test_svc1.py

    r835 r839  
    5050constrain = constraint(solvers(solve(constrain,target=['x0']))) 
    5151 
    52 from mystic import supressed 
    53 @supressed(1e-5) 
     52from mystic import suppressed 
     53@suppressed(1e-5) 
    5454def conserve(x): 
    5555    return constrain(x) 
  • mystic/examples/test_svc2.py

    r835 r839  
    7070#constrain = constraint(solvers(solve(constrain))) 
    7171 
    72 from mystic import supressed 
    73 @supressed(5e-2) 
     72from mystic import suppressed 
     73@suppressed(5e-2) 
    7474def conserve(x): 
    7575    return constrain(x) 
  • mystic/examples/test_svr1.py

    r835 r839  
    4747constrain = constraint(solvers(solve(constrain,target=['x0']))) 
    4848 
    49 from mystic import supressed 
    50 @supressed(1e-5) 
     49from mystic import suppressed 
     50@suppressed(1e-5) 
    5151def conserve(x): 
    5252    return constrain(x) 
  • mystic/examples/test_svr2.py

    r830 r839  
    4949constrain = constraint(solvers(solve(constrain,target=['x0']))) 
    5050 
    51 from mystic import supressed 
    52 @supressed(1e-5) 
     51from mystic import suppressed 
     52@suppressed(1e-5) 
    5353def conserve(x): 
    5454    return constrain(x) 
  • mystic/examples_other/test_smo1.py

    r829 r839  
    4444constrain = constraint(solvers(solve(constrain,target=['x0']))) 
    4545 
    46 from mystic import supressed 
    47 @supressed(1e-5) 
     46from mystic import suppressed 
     47@suppressed(1e-5) 
    4848def conserve(x): 
    4949    return constrain(x) 
  • mystic/mystic/_symbolic.py

    r832 r839  
    268268    nvars = None 
    269269    permute = False # if True, return all permutations 
    270     warn = True  # if True, don't supress warnings 
     270    warn = True  # if True, don't suppress warnings 
    271271    verbose = False  # if True, print debug info 
    272272    #-----------------------undocumented------------------------------- 
     
    437437    nvars = None 
    438438    permute = False # if True, return all permutations 
    439     warn = True  # if True, don't supress warnings 
     439    warn = True  # if True, don't suppress warnings 
    440440    verbose = False  # if True, print debug info 
    441441    #-----------------------undocumented------------------------------- 
     
    635635    #-----------------------undocumented------------------------------- 
    636636   #kwds['permute'] = False # if True, return all permutations 
    637     kwds['warn'] = False  # if True, don't supress warnings 
     637    kwds['warn'] = False  # if True, don't suppress warnings 
    638638    kwds['verbose'] = False  # if True, print debug info 
    639639    #------------------------------------------------------------------ 
     
    704704    nvars = None 
    705705    permute = False # if True, return all permutations 
    706     warn = True  # if True, don't supress warnings 
     706    warn = True  # if True, don't suppress warnings 
    707707    verbose = False # if True, print details from _classify_variables 
    708708    #-----------------------undocumented------------------------------- 
  • mystic/mystic/symbolic.py

    r832 r839  
    198198                after, before = eval(after, locals_), eval(before, locals_) 
    199199                break 
    200             except ValueError as error: 
     200            except ValueError as error:  #FIXME: python2.5 
    201201                if error.message.startswith('negative number') and \ 
    202202                   error.message.endswith('raised to a fractional power'): 
  • mystic/mystic/tools.py

    r826 r839  
    3636    - insert_missing: return a sequence with the 'missing' elements inserted 
    3737    - clipped: generate a function where values outside of bounds are clipped 
    38     - supressed: generate a function where values less than tol are supressed 
    39     - supress: supress small values less than tol 
     38    - suppressed: generate a function where values less than tol are suppressed 
     39    - suppress: suppress small values less than tol 
    4040    - unpair: convert a 1D array of N pairs to two 1D arrays of N values 
    4141    - src: extract source code from a python code object 
     
    381381    if bounds: 
    382382        def function_wrapper(x): 
    383             settings = seterr(all='ignore') #XXX: slow to supress warnings? 
     383            settings = seterr(all='ignore') #XXX: slow to suppress warnings? 
    384384            if any((x<min)|(x>max)): #if violate bounds, evaluate as inf 
    385385                seterr(**settings) 
     
    568568 
    569569 
    570 def supress(x, tol=1e-8, clip=True): 
    571     """supress small values less than tol""" 
     570def suppress(x, tol=1e-8, clip=True): 
     571    """suppress small values less than tol""" 
    572572    from numpy import asarray, abs 
    573573    x = asarray(list(x)) 
    574574    mask = abs(x) < tol 
    575575    if not clip: 
    576         # preserve sum by spreading supressed values to the non-zero elements 
     576        # preserve sum by spreading suppressed values to the non-zero elements 
    577577        x[mask==False] = (x + sum(x[mask])/(len(mask)-sum(mask)))[mask==False] 
    578578    x[mask] = 0.0 
    579579    return x.tolist() 
    580580 
    581 def supressed(tol=1e-8, exit=False, clip=True): 
    582     """generate a function, where values less than tol are supressed 
     581def suppressed(tol=1e-8, exit=False, clip=True): 
     582    """generate a function, where values less than tol are suppressed 
    583583 
    584584For example, 
    585     >>> @supressed(1e-8) 
     585    >>> @suppressed(1e-8) 
    586586    ... def square(x): 
    587587    ...     return [i**2 for i in x] 
     
    591591    >>>  
    592592    >>> from mystic.math.measures import normalize 
    593     >>> @supressed(1e-8, exit=True, clip=False) 
     593    >>> @suppressed(1e-8, exit=True, clip=False) 
    594594    ... def norm(x): 
    595595    ...     return normalize(x, mass=1) 
     
    603603        if exit: 
    604604            def func(x, *args, **kwds): 
    605                 return supress(f(x, *args, **kwds), tol, clip) 
     605                return suppress(f(x, *args, **kwds), tol, clip) 
    606606        else: 
    607607            def func(x, *args, **kwds): 
    608                 return f(supress(x, tol, clip), *args, **kwds) 
     608                return f(suppress(x, tol, clip), *args, **kwds) 
    609609        func.__wrapped__ = f 
    610610        func.__doc__ = f.__doc__ 
Note: See TracChangeset for help on using the changeset viewer.