ChunkCache
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| Generic typing Abstract base class for generic types. |
⋔ Inheritance diagram¶
graph TD
1605609077["chunkcache.ChunkCache"]
3481597255["typing.Generic"]
2751680898["builtins.object"]
3481597255 --> 1605609077
2751680898 --> 3481597255
🛈 DocStrings¶
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.