2Contains the GameOutputGenerator class.
5from pathlib
import Path
14 Outputs GameSummary to .json file, and saves plots to a .png file.
19 game_summary: GameSummary,
20 output_dir_suffix: str =
None,
21 custom_output_root: Path =
None,
34 output_dir_name += f
"-{self.output_dir_suffix}"
40 Path(__file__).parent.parent.parent /
"data" /
"game_summaries"
45 game_output_dir_name += f
"-{self.output_dir_suffix}"
47 game_output_dir = output_root / game_output_dir_name
48 game_output_dir.mkdir(parents=
True, exist_ok=
True)
50 return game_output_dir
55 plot_manager.plot(show_plot=
False)
57 game_summary_path = self.
output_dir / f
"{self.game_summary.game_id}.json"
62 plot_manager.save_figure(
63 path=self.
output_dir / f
"{self.game_summary.game_id}.png"
Outputs GameSummary to .json file, and saves plots to a .png file.
def generate_output(self)
Path create_output_dir(self)
def __init__(self, GameSummary game_summary, str output_dir_suffix=None, Path custom_output_root=None)
Manages the layout and file output of a figure containing multiple plots of data from a GameSummary.
Contains functions for importing / exporting a GameSummary from / to .json file.
Contains the GameSummaryPlotManager class.
GameSummary class and its component classes.