MCPcopy Create free account
hub / github.com/Enfoirer/Text2GraphRAG / clean_batches

Function clean_batches

agent/batch_manager.py:71–93  ·  view source on GitHub ↗

清理所有批次数据

(output_dir: str)

Source from the content-addressed store, hash-verified

69 print("📋 未找到进度文件")
70
71def clean_batches(output_dir: str):
72 """清理所有批次数据"""
73 batch_dirs = [d for d in os.listdir(output_dir)
74 if d.startswith("batch_") and os.path.isdir(os.path.join(output_dir, d))]
75
76 if not batch_dirs:
77 print("📁 未找到批次数据")
78 return
79
80 print(f"找到 {len(batch_dirs)} 个批次目录:")
81 for batch_dir in sorted(batch_dirs):
82 print(f" - {batch_dir}")
83
84 confirm = input("\n⚠️ 确认要删除所有批次数据吗? (y/N): ").strip().lower()
85 if confirm == 'y':
86 import shutil
87 for batch_dir in batch_dirs:
88 batch_path = os.path.join(output_dir, batch_dir)
89 shutil.rmtree(batch_path)
90 print(f"🗑️ 已删除: {batch_dir}")
91 print("✅ 所有批次数据已清理")
92 else:
93 print("取消操作")
94
95def merge_batches(output_dir: str):
96 """手动合并所有批次数据"""

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected