(
config_path: Path,
*,
cleanup: bool = False,
output_dir: Path | None = None,
suffix: str = "",
keep_containers: bool = False,
)
| 12 | |
| 13 | |
| 14 | def 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 | |
| 40 | def main_cli(argv: list[str] | None = None): |
no test coverage detected