From d6736d194bcf0c4051b91f7b0a1d81e2117aa17b Mon Sep 17 00:00:00 2001 From: Lorenzo Volpi Date: Sun, 26 Nov 2023 16:30:54 +0100 Subject: [PATCH] removed md creation --- quacc/main.py | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/quacc/main.py b/quacc/main.py index 9a0c64d..9bbd8dd 100644 --- a/quacc/main.py +++ b/quacc/main.py @@ -2,39 +2,16 @@ from traceback import print_exception as traceback import quacc.evaluation.comp as comp from quacc.dataset import Dataset -from quacc.environment import env, environ -from quacc.evaluation.report import DatasetReport +from quacc.environment import env from quacc.logger import Logger from quacc.utils import create_dataser_dir CE = comp.CompEstimator() -CREATE_MD = False - - -def create_md(_env: environ, dr: DatasetReport, dataset: Dataset, log: Logger): - for plot_conf in _env.get_plot_confs(): - for m in _env.METRICS: - output_path = _env.OUT_DIR / f"{plot_conf}_{m}.md" - try: - _repr = dr.to_md( - conf=plot_conf, - metric=m, - estimators=CE.name[_env.PLOT_ESTIMATORS], - plot_path=_env.PLOT_OUT_DIR, - ) - with open(output_path, "w") as f: - f.write(_repr) - except Exception as e: - log.error( - f"Failed while saving configuration {plot_conf} of {dataset.name}. Exception: {e}" - ) - traceback(e) - def estimate_comparison(): log = Logger.logger() - for conf in env.get_confs(): + for conf in env.load_confs(): dataset = Dataset( env.DATASET_NAME, target=env.DATASET_TARGET, @@ -44,21 +21,18 @@ def estimate_comparison(): create_dataser_dir( dataset.name, update=env.DATASET_DIR_UPDATE, - create_md=CREATE_MD, ) Logger.add_handler(env.OUT_DIR / f"{dataset.name}.log") try: dr = comp.evaluate_comparison( dataset, estimators=CE.name[env.COMP_ESTIMATORS], - ).pickle(env.OUT_DIR / f"{dataset.name}.pickle") + ) + dr.pickle(env.OUT_DIR / f"{dataset.name}.pickle") except Exception as e: log.error(f"Evaluation over {dataset.name} failed. Exception: {e}") traceback(e) - if CREATE_MD: - create_md(env, dr, dataset, log) - Logger.clear_handlers() @@ -67,7 +41,7 @@ def main(): try: estimate_comparison() except Exception as e: - log.error(f"estimate comparison failed. Exceprion: {e}") + log.error(f"estimate comparison failed. Exception: {e}") traceback(e) Logger.close()