MCPcopy Create free account
hub / github.com/AlmondGod/tinyworlds / extract_step

Function extract_step

utils/utils.py:136–139  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

134 candidate_files = project_wide_search()
135
136 def extract_step(path: str) -> int:
137 fname = os.path.basename(path)
138 m = re.search(r"_step_(\d+)", fname)
139 return int(m.group(1)) if m else -1
140
141 candidate_files.sort(key=lambda p: (extract_step(p), os.path.getctime(p)))
142 return candidate_files[-1]

Callers 1

find_latest_checkpointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected