removed md creation
This commit is contained in:
parent
b4e2042b52
commit
d6736d194b
|
@ -2,39 +2,16 @@ from traceback import print_exception as traceback
|
||||||
|
|
||||||
import quacc.evaluation.comp as comp
|
import quacc.evaluation.comp as comp
|
||||||
from quacc.dataset import Dataset
|
from quacc.dataset import Dataset
|
||||||
from quacc.environment import env, environ
|
from quacc.environment import env
|
||||||
from quacc.evaluation.report import DatasetReport
|
|
||||||
from quacc.logger import Logger
|
from quacc.logger import Logger
|
||||||
from quacc.utils import create_dataser_dir
|
from quacc.utils import create_dataser_dir
|
||||||
|
|
||||||
CE = comp.CompEstimator()
|
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():
|
def estimate_comparison():
|
||||||
log = Logger.logger()
|
log = Logger.logger()
|
||||||
for conf in env.get_confs():
|
for conf in env.load_confs():
|
||||||
dataset = Dataset(
|
dataset = Dataset(
|
||||||
env.DATASET_NAME,
|
env.DATASET_NAME,
|
||||||
target=env.DATASET_TARGET,
|
target=env.DATASET_TARGET,
|
||||||
|
@ -44,21 +21,18 @@ def estimate_comparison():
|
||||||
create_dataser_dir(
|
create_dataser_dir(
|
||||||
dataset.name,
|
dataset.name,
|
||||||
update=env.DATASET_DIR_UPDATE,
|
update=env.DATASET_DIR_UPDATE,
|
||||||
create_md=CREATE_MD,
|
|
||||||
)
|
)
|
||||||
Logger.add_handler(env.OUT_DIR / f"{dataset.name}.log")
|
Logger.add_handler(env.OUT_DIR / f"{dataset.name}.log")
|
||||||
try:
|
try:
|
||||||
dr = comp.evaluate_comparison(
|
dr = comp.evaluate_comparison(
|
||||||
dataset,
|
dataset,
|
||||||
estimators=CE.name[env.COMP_ESTIMATORS],
|
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:
|
except Exception as e:
|
||||||
log.error(f"Evaluation over {dataset.name} failed. Exception: {e}")
|
log.error(f"Evaluation over {dataset.name} failed. Exception: {e}")
|
||||||
traceback(e)
|
traceback(e)
|
||||||
|
|
||||||
if CREATE_MD:
|
|
||||||
create_md(env, dr, dataset, log)
|
|
||||||
|
|
||||||
Logger.clear_handlers()
|
Logger.clear_handlers()
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,7 +41,7 @@ def main():
|
||||||
try:
|
try:
|
||||||
estimate_comparison()
|
estimate_comparison()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(f"estimate comparison failed. Exceprion: {e}")
|
log.error(f"estimate comparison failed. Exception: {e}")
|
||||||
traceback(e)
|
traceback(e)
|
||||||
|
|
||||||
Logger.close()
|
Logger.close()
|
||||||
|
|
Loading…
Reference in New Issue