MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / main

Function main

scripts/main_single_player.py:14–37  ·  view source on GitHub ↗
(
    config_path: Path,
    *,
    cleanup: bool = False,
    output_dir: Path | None = None,
    suffix: str = "",
    keep_containers: bool = False,
)

Source from the content-addressed store, hash-verified

12
13
14def main(
15 config_path: Path,
16 *,
17 cleanup: bool = False,
18 output_dir: Path | None = None,
19 suffix: str = "",
20 keep_containers: bool = False,
21):
22 yaml_content = config_path.read_text()
23 preprocessed_yaml = resolve_includes(yaml_content, base_dir=CONFIG_DIR)
24 config = yaml.safe_load(preprocessed_yaml)
25
26 timestamp = time.strftime("%y%m%d%H%M%S")
27 suffix_part = f".{suffix}" if suffix else ""
28 folder_name = f"SinglePlayerTraining.{config['game']['name']}.{timestamp}{suffix_part}"
29 if output_dir is None:
30 full_output_dir = LOCAL_LOG_DIR / getpass.getuser() / folder_name
31 else:
32 full_output_dir = output_dir / folder_name
33
34 training = SinglePlayerTraining(
35 config, output_dir=full_output_dir, cleanup=cleanup, keep_containers=keep_containers
36 )
37 training.run()
38
39
40def main_cli(argv: list[str] | None = None):

Callers 1

main_cliFunction · 0.70

Calls 3

runMethod · 0.95
resolve_includesFunction · 0.90

Tested by

no test coverage detected