nep框架搭建

This commit is contained in:
2025-12-08 17:14:27 +08:00
parent 7a6ca92ad4
commit 0b6537a810
21 changed files with 219 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
import json
import os
from pathlib import Path
class StatusManager:
def __init__(self, workspace_path):
self.workspace = Path(workspace_path)
self.status_file = self.workspace / "status.json"
if not self.workspace.exists():
self.workspace.mkdir(parents=True)
# 如果没有状态文件,创建一个初始的
if not self.status_file.exists():
self._save_status({"current_iter": 1, "stages": {}})
def _save_status(self, data):
with open(self.status_file, 'w') as f:
json.dump(data, f, indent=4)
def get_current_iter(self):
if self.status_file.exists():
with open(self.status_file, 'r') as f:
data = json.load(f)
return data.get("current_iter", 1)
return 1