eval running - offline logger implemented -> Test it!

This commit is contained in:
Si11ium
2020-05-30 18:12:41 +02:00
parent 77ea043907
commit 5987efb169
9 changed files with 626 additions and 17 deletions

View File

@ -9,12 +9,13 @@ from pathlib import Path
class Plotter(object):
def __init__(self, root_path=''):
self.root_path = Path(root_path)
if not root_path:
self.root_path = Path(root_path)
def save_current_figure(self, path, extention='.png', naked=True):
def save_current_figure(self, filename: str, extention='.png', naked=False):
fig, _ = plt.gcf(), plt.gca()
# Prepare save location and check img file extention
path = self.root_path / Path(path if str(path).endswith(extention) else f'{str(path)}{extention}')
path = self.root_path / Path(filename if filename.endswith(extention) else f'{filename}{extention}')
path.parent.mkdir(exist_ok=True, parents=True)
if naked:
plt.axis('off')