diff --git a/supervised/base_automl.py b/supervised/base_automl.py index 00bec293..9ebaecc6 100644 --- a/supervised/base_automl.py +++ b/supervised/base_automl.py @@ -4,6 +4,7 @@ import shutil import time import types +import uuid from abc import ABC from copy import deepcopy @@ -107,6 +108,7 @@ def __init__(self): self._underprivileged_groups = [] self._optuna_verbose = True self._n_jobs = -1 + self._id = str(uuid.uuid4()) def _get_tuner_params( self, start_random_models, hill_climbing_steps, top_models_to_improve @@ -2380,26 +2382,26 @@ def _md_to_html(self, md_fname, page_type, dir_path, me=None): content_html = "\n".join(new_content) # change links - if page_type == "automl-report-main": + if page_type == f"automl-report-main-{self._id}": for f in os.listdir(dir_path): if os.path.exists(os.path.join(dir_path, f, "README.md")): old = f'href="{f}/README.html"' - new = f"onclick=\"toggleShow('{f}');toggleShow('automl-report-main')\" " + new = f"onclick=\"toggleShow('{f}-{self._id}');toggleShow('automl-report-main-{self._id}')\" " content_html = content_html.replace(old, new) # other links if me is not None: old = 'href="../README.html"' - new = f"onclick=\"toggleShow('{me}');toggleShow('automl-report-main')\" " + new = f"onclick=\"toggleShow('{me}-{self._id}');toggleShow('automl-report-main-{self._id}')\" " content_html = content_html.replace(old, new) beginning = "" - if page_type == "automl-report-main": + if page_type == f"automl-report-main-{self._id}": beginning += """\n\n""" if os.path.exists(os.path.join(self._results_path, "optuna/README.md")): - beginning += "

» Optuna Params Tuning Report

" + beginning += f"

» Optuna Params Tuning Report

" content_html = beginning + content_html @@ -2424,8 +2426,8 @@ def _report(self, width=900, height=1200): body = "" fname = os.path.join(self._results_path, "README.md") body += ( - '
\n' - + self._md_to_html(fname, "automl-report-main", self._results_path) + f'
\n' + + self._md_to_html(fname, f"automl-report-main-{self._id}", self._results_path) + "\n\n
\n\n" ) @@ -2433,7 +2435,7 @@ def _report(self, width=900, height=1200): fname = os.path.join(self._results_path, f, "README.md") if os.path.exists(fname): body += ( - f'