File: PKG-INFO

package info (click to toggle)
cachey 0.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 132 kB
  • sloc: python: 287; makefile: 3
file content (78 lines) | stat: -rw-r--r-- 2,595 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Metadata-Version: 2.1
Name: cachey
Version: 0.2.1
Summary: Caching mindful of computation/storage costs
Home-page: http://github.com/dask/cachey/
Maintainer: Matthew Rocklin
Maintainer-email: mrocklin@gmail.com
License: BSD
Description: Caching for Analytic Computations
        ---------------------------------
        
        Humans repeat stuff.  Caching helps.
        
        Normal caching policies like LRU aren't well suited for analytic computations
        where both the cost of recomputation and the cost of storage routinely vary by
        one million or more.  Consider the following computations
        
        ```python
        # Want this
        np.std(x)        # tiny result, costly to recompute
        
        # Don't want this
        np.transpose(x)  # huge result, cheap to recompute
        ```
        
        Cachey tries to hold on to values that have the following characteristics
        
        1. Expensive to recompute (in seconds)
        2. Cheap to store (in bytes)
        3. Frequently used
        4. Recenty used
        
        It accomplishes this by adding the following to each items score on each access
        
            score += compute_time / num_bytes * (1 + eps) ** tick_time
        
        For some small value of epsilon (which determines the memory halflife.) This
        has units of inverse bandwidth, has exponential decay of old results and
        roughly linear amplification of repeated results.
        
        Example
        -------
        
        ```python
        >>> from cachey import Cache
        >>> c = Cache(1e9, 1)  # 1 GB, cut off anything with cost 1 or less
        
        >>> c.put('x', 'some value', cost=3)
        >>> c.put('y', 'other value', cost=2)
        
        >>> c.get('x')
        'some value'
        ```
        
        This also has a `memoize` method
        
        ```python
        >>> memo_f = c.memoize(f)
        ```
        
        Status
        ------
        
        Cachey is new and not robust.
        
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.6
Description-Content-Type: text/markdown