Changeset 709 for branches


Ignore:
Timestamp:
12/03/13 10:29:37 (2 years ago)
Author:
mmckerns
Message:

updated cache examples in decorate to use klepto (some should move to klepto)

Location:
branches/decorate
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/decorate/memoize.py

    r671 r709  
    33""" 
    44from functools import update_wrapper, wraps as functools_wraps 
    5 from mystic.math.rounding import deep_round, simple_round 
    6 from mystic.cache.archives import archive_dict 
    7 from mystic.cache.keymaps import stringmap 
    8 from mystic.cache import inf_cache 
    9 from mystic.cache._cache import _CacheInfo #XXX: expose _CacheInfo in cache ? 
     5from klepto.rounding import deep_round, simple_round 
     6from klepto.archives import archive_dict 
     7from klepto.keymaps import stringmap 
     8from klepto import inf_cache 
     9from klepto.tools import CacheInfo 
    1010 
    1111__all__ = ['memoize', 'memoized'] 
     
    8787        def info(): 
    8888            """Report cache statistics""" 
    89             return _CacheInfo(stats[HIT], stats[MISS], stats[LOAD], self.__maxsize, len(self.__cache)) 
     89            return CacheInfo(stats[HIT], stats[MISS], stats[LOAD], self.__maxsize, len(self.__cache)) 
    9090 
    9191        # interface 
  • branches/decorate/surrogate.py

    r669 r709  
    2020 
    2121 
    22 from mystic.cache.safe import inf_cache as memoized 
    23 #from mystic.cache import inf_cache as memoized 
    24 from mystic.cache.archives import archive_dict, file_archive 
    25 from mystic.cache.keymaps import picklemap, stringmap, hashmap 
     22from klepto.safe import inf_cache as memoized 
     23#from klepto import inf_cache as memoized 
     24from klepto.archives import archive_dict, file_archive 
     25from klepto.keymaps import picklemap, stringmap, hashmap 
    2626dumps = picklemap(flat=False) 
    2727encode = stringmap(flat=False) 
  • branches/decorate/test_cached.py

    r671 r709  
    1 #from mystic.cache.safe import inf_cache as memoized 
    21#from mystic.cache import inf_cache as memoized 
     2#from klepto.safe import inf_cache as memoized 
    33from memoize import memoize as memoized 
    4 from mystic.cache.archives import file_archive 
     4 
     5from klepto.archives import file_archive 
    56from timer import timed 
    67 
Note: See TracChangeset for help on using the changeset viewer.