Plot stats using Matplotlib and save images.
(self, output_dir: Union[str, Path])
| 88 | self.matplotlib_plot(self.log_dir) |
| 89 | |
| 90 | def matplotlib_plot(self, output_dir: Union[str, Path]): |
| 91 | """Plot stats using Matplotlib and save images.""" |
| 92 | keys2 = set.union(*[set(self.get_keys2(k)) for k in self.get_keys()]) |
| 93 | for key2 in keys2: |
| 94 | keys = [k for k in self.get_keys() if key2 in self.get_keys2(k)] |
| 95 | plt = self._plot_stats(keys, key2) |
| 96 | p = Path(output_dir) / f"{key2}.png" |
| 97 | p.parent.mkdir(parents=True, exist_ok=True) |
| 98 | plt.savefig(p) |
| 99 | |
| 100 | def _plot_stats(self, keys: Sequence[str], key2: str): |
| 101 | # str is also Sequence[str] |
no test coverage detected