openpathsampling.netcdfplus.cache.LRUCache

class openpathsampling.netcdfplus.cache.LRUCache(size_limit)[source]

Implements a simple Least Recently Used Cache

Very simple using collections.OrderedDict. The size can be changed during run-time

__init__(size_limit)[source]

Methods

__init__(size_limit)

clear()

get(item[, default])

get value by key if it exists, None else

get_silent(item[, default])

get value by key if it exists, None else

transfer(old_cache)

Transfer values between caches

Attributes

count

the number of strong references int : the number of weak references

size

the maximal number of strong references, -1 if infinite int : the maximal number of weak references, -1 if infinite

size_limit