Files
siloqy/_update_vbt_cache.py

41 lines
1.1 KiB
Python
Raw Normal View History

#!/usr/bin/env python3
"""
Helper script to update VBT Parquet cache.
Called by update_VBT_parquet_cache.bat
"""
import sys
from pathlib import Path
from multiprocessing import freeze_support
# Add current directory to path
sys.path.insert(0, str(Path(__file__).parent))
def main():
try:
from dolphin_vbt_real import build_parquet_cache
except ImportError as e:
print(f"ERROR: Cannot import dolphin_vbt_real: {e}")
print("Make sure you're running from the project root directory.")
return 1
print("Starting VBT cache update...")
print()
try:
stats = build_parquet_cache(force=False)
print()
print("Update complete!")
print(f" Dates processed: {stats.get('dates_processed', 0)}")
print(f" Total scans: {stats.get('total_scans', 0):,}")
print(f" Time: {stats.get('elapsed_s', 0):.1f}s")
return 0
except Exception as e:
print(f"ERROR: {e}", file=sys.stderr)
import traceback
traceback.print_exc()
return 1
if __name__ == '__main__':
freeze_support()
sys.exit(main())