MCPcopy Create free account
hub / github.com/Lightricks/LTX-2 / validate_output_dir

Function validate_output_dir

packages/ltx-trainer/scripts/split_scenes.py:105–117  ·  view source on GitHub ↗

Validate and create output directory if it doesn't exist. Args: output_dir: Path to the output directory Returns: Path object of the validated output directory

(output_dir: str)

Source from the content-addressed store, hash-verified

103
104
105def validate_output_dir(output_dir: str) -> Path:
106 """Validate and create output directory if it doesn't exist.
107 Args:
108 output_dir: Path to the output directory
109 Returns:
110 Path object of the validated output directory
111 """
112 path = Path(output_dir)
113
114 if path.exists() and not path.is_dir():
115 raise typer.BadParameter(f"{output_dir} exists but is not a directory")
116
117 return path
118
119
120def parse_timecode(video: any, time_str: Optional[str]) -> Optional[FrameTimecode]:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected