MCPcopy Index your code
hub / github.com/algorithmicsuperintelligence/openevolve / _resolve_run_root

Function _resolve_run_root

scripts/manual.py:26–49  ·  view source on GitHub ↗

Resolve run root from a path that may point to: - - /checkpoints - /checkpoints/checkpoint_123 - /checkpoint_123 Returns: Path to

(path_str: str)

Source from the content-addressed store, hash-verified

24
25
26def _resolve_run_root(path_str: str) -> Path:
27 """
28 Resolve run root from a path that may point to:
29 - <run_root>
30 - <run_root>/checkpoints
31 - <run_root>/checkpoints/checkpoint_123
32 - <run_root>/checkpoint_123
33
34 Returns:
35 Path to <run_root>
36 """
37 p = Path(path_str).expanduser().resolve()
38
39 if p.name.startswith("checkpoint_"):
40 # .../checkpoints/checkpoint_123 -> run_root is parent of "checkpoints"
41 if p.parent.name == "checkpoints":
42 return p.parent.parent
43 # .../checkpoint_123 -> run_root is parent
44 return p.parent
45
46 if p.name == "checkpoints":
47 return p.parent
48
49 return p
50
51
52def _queue_dir(run_root: Path) -> Path:

Callers 3

api_tasksFunction · 0.85
api_task_detailFunction · 0.85
api_task_answerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected