diff --git a/driving_log_replayer_cli/core/result.py b/driving_log_replayer_cli/core/result.py index b8d4dbde0..f8b5514ff 100644 --- a/driving_log_replayer_cli/core/result.py +++ b/driving_log_replayer_cli/core/result.py @@ -45,18 +45,3 @@ def display_all(output_directory: Path) -> None: for result_path in result_paths: print(f"scenario: {result_path.parent.name}") # noqa display(result_path) - - -def convert_to_json(result_path: Path) -> None: - output_file_path = result_path.parent.joinpath("result.json") - if output_file_path.exists(): - return - result_list = load_result(result_path) - with output_file_path.open("w") as out_file: - json.dump(result_list, out_file) - - -def convert_all(output_directory: Path) -> None: - result_paths = output_directory.glob("**/result.jsonl") - for result_path in result_paths: - convert_to_json(result_path) diff --git a/driving_log_replayer_cli/simulation/__init__.py b/driving_log_replayer_cli/simulation/__init__.py index a760e63c0..bc6c30dc4 100644 --- a/driving_log_replayer_cli/simulation/__init__.py +++ b/driving_log_replayer_cli/simulation/__init__.py @@ -4,7 +4,6 @@ from driving_log_replayer_cli.core.config import Config from driving_log_replayer_cli.core.config import load_config -from driving_log_replayer_cli.core.result import convert_all from driving_log_replayer_cli.core.result import display_all from driving_log_replayer_cli.simulation.run import dry_run as sim_dry_run from driving_log_replayer_cli.simulation.run import run as sim_run @@ -73,16 +72,6 @@ def show_result(output_directory: Path) -> None: display_all(output_directory) -@simulation.command(context_settings=CONTEXT_SETTINGS) -@click.argument( - "output_directory", - type=click.Path(exists=True, file_okay=False, resolve_path=True, path_type=Path), -) -def convert_result(output_directory: Path) -> None: - """Convert result.jsonl to result.json in output_directory.""" - convert_all(output_directory) - - @simulation.command(context_settings=CONTEXT_SETTINGS) @click.option( "--scenario", diff --git a/driving_log_replayer_cli/simulation/run.py b/driving_log_replayer_cli/simulation/run.py index 81ffd5577..4ecadec4f 100644 --- a/driving_log_replayer_cli/simulation/run.py +++ b/driving_log_replayer_cli/simulation/run.py @@ -7,7 +7,6 @@ import termcolor from driving_log_replayer_cli.core.config import Config -from driving_log_replayer_cli.core.result import convert_all from driving_log_replayer_cli.core.result import display_all from driving_log_replayer_cli.core.scenario import Datasets from driving_log_replayer_cli.core.scenario import get_dry_run_scenario_path @@ -93,8 +92,7 @@ def run( update_method, ) - # convert result file and display result - convert_all(output_dir_by_time) + # display result display_all(output_dir_by_time) @@ -141,8 +139,7 @@ def dry_run( run_with_log(cmd, output_case.joinpath("console.log")) except KeyboardInterrupt: termcolor.cprint("Simulation execution canceled by Ctrl+C", "red") - # convert result file and display result - convert_all(output_dir_by_time) + # display result display_all(output_dir_by_time)