Storage Manager
Disk usage manager for dataset caching and temporary file tracking.
Tracks cumulative file sizes against a configurable limit and provides best-effort cleanup of registered temporary files.
- class src.utils.storage_manager.StorageManager(limit_gb: float = 500.0)[source]
Bases:
objectManages disk usage to stay under a configurable storage limit.
Tracks cumulative bytes consumed by registered files and provides temporary file creation with automatic registration for later cleanup.
- limit_bytes
Maximum allowed cumulative storage in bytes.
- used_bytes
Current cumulative bytes consumed by registered files.
- temp_files
List of paths to temporary files created via
create_temp_file().
- __init__(limit_gb: float = 500.0)[source]
Initialize the storage manager.
- Parameters:
limit_gb – Storage limit in gigabytes. Defaults to 500 GB.