uproot.LRUArrayCache
Defined in uproot.cache on line 168.
Inheritance order: |
|---|
|
- class uproot.cache.LRUArrayCache(limit_bytes)
- Parameters:
limit_bytes (None, int, or str) – Amount of data to allow in the cache before evicting the least-recently used. An integer is interpreted as a number of bytes and a string must be a number followed by a unit, such as “100 MB”. If None, this cache never evicts.
LRUArrayCache is a
MutableMappingthat evicts the least-recently used objects when thecurrentnumber of bytes exceeds thelimit. The size of an object is taken from itsnbytesattribute. If it does not have annbytes, it is presumed to havedefault_nbytes.Get and set (or explicitly remove) items with
MutableMappingsyntax: square bracket subscripting.LRUArrayCache is thread-safe for all options: getting, setting, deleting, iterating, listing keys, values, and items.
This cache is sensitive to the size of the objects it stores, but only if those objects have meaningful
nbytes. It is therefore a betterarray_cachethan anarray_cache.
sizeof
Inherited from uproot.LRUCache.
- classmethod LRUArrayCache.sizeof(what)
The “size of” an object in this cache is its
nbytesattribute/property if it has one (NumPy and Awkward Arrays, Pandas Series),memory_usage().sum()if it exists (Pandas DataFrames),default_nbytesotherwise.
limit
Inherited from uproot.LRUCache.
- LRUArrayCache.limit
Number of bytes to allow in the cache before evicting the least-recently used. If None, this cache never evicts.
current
Inherited from uproot.LRUCache.
- LRUArrayCache.current
Current number of bytes in the cache.
keys
Inherited from uproot.LRUCache.
- LRUArrayCache.keys()
Returns a copy of the keys currently in the cache, in least-recently used order.
The list ascends from least-recently used to most-recently used: index
0is the least-recently used and index-1is the most-recently used.(Calling this method does not change the order.)
values
Inherited from uproot.LRUCache.
- LRUArrayCache.values()
Returns a copy of the values currently in the cache, in least-recently used order.
The list ascends from least-recently used to most-recently used: index
0is the least-recently used and index-1is the most-recently used.(Calling this method does not change the order.)
items
Inherited from uproot.LRUCache.
- LRUArrayCache.items()
Returns a copy of the items currently in the cache, in least-recently used order.
The list ascends from least-recently used to most-recently used: index
0is the least-recently used and index-1is the most-recently used.(Calling this method does not change the order.)