MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / pick_latest_subdir

Function pick_latest_subdir

scripts/worldmirror/compare_to_reference.py:32–39  ·  view source on GitHub ↗

Return most recent -like subdir, or `path` itself.

(path: Path)

Source from the content-addressed store, hash-verified

30
31
32def pick_latest_subdir(path: Path) -> Path:
33 """Return most recent <timestamp>-like subdir, or `path` itself."""
34 candidates = [p for p in path.iterdir() if p.is_dir()]
35 if not candidates:
36 return path
37 # Prefer children that look like timestamp dirs, fall back to mtime.
38 candidates.sort(key=lambda p: p.stat().st_mtime, reverse=True)
39 return candidates[0]
40
41
42def resolve_output_dir(path: Path) -> Path:

Callers 1

resolve_output_dirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected