chunkcache
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| ChunkCache cutepandas.frames.chunkcache Caches converted windows of a frame, keyed by (row block, column). |
🛈 DocStrings¶
A thread-safe, bounded LRU cache of per-column row chunks.
ChunkCache
¶
Caches converted windows of a frame, keyed by (row block, column).
A row block covers chunk_rows consecutive rows of one column, so a wide frame only
converts the visible columns. At most max_chunks blocks are kept; the least
recently used one is dropped first, so memory stays bounded however far the user
scrolls.
Every mutation happens under a lock, so a worker thread may fill the cache
(get_or_build) while the GUI thread reads it. clear() and invalidate() start a
new generation: a block built from the old data by a slow worker is dropped instead
of stored.
Source code in src/cutepandas/frames/chunkcache.py
block_bounds
¶
Row range (start, stop) of a block, clipped to row_count.
clear
¶
get_or_build
¶
Return the cached block or build it (outside the lock) and store it.
Source code in src/cutepandas/frames/chunkcache.py
invalidate
¶
Drop the blocks of one row block and/or column (all if both are None).
Source code in src/cutepandas/frames/chunkcache.py
put
¶
Store a block; returns False if it was built for an older generation.