MCPcopy Create free account
hub / github.com/Tong89/smartNode / load_scenario

Method load_scenario

backend/store.py:188–196  ·  view source on GitHub ↗

按名称加载完整场景记录。

(self, name: str)

Source from the content-addressed store, hash-verified

186 return self.load_scenario(name) or {}
187
188 def load_scenario(self, name: str) -> Optional[Dict[str, Any]]:
189 """按名称加载完整场景记录。"""
190 with self._lock:
191 row = self._conn.execute(
192 "SELECT * FROM scenarios WHERE name=?", (name,)
193 ).fetchone()
194 if row is None:
195 return None
196 return self._row_to_dict(row)
197
198 def list_scenarios(self) -> List[Dict[str, Any]]:
199 """列出全部场景摘要(不含 run_stats 详情以减小响应体积)。

Callers 7

save_scenarioMethod · 0.95
switch_toMethod · 0.95
compareMethod · 0.95
test_load_scenarioMethod · 0.80
test_load_missingMethod · 0.80
test_delete_scenarioMethod · 0.80

Calls 1

_row_to_dictMethod · 0.95

Tested by 4

test_load_scenarioMethod · 0.64
test_load_missingMethod · 0.64
test_delete_scenarioMethod · 0.64