def generate_report( benchmark_results: Dict[str, BenchmarkResult], errors_encountered: Optional[List[str]] = None, include_individual_method_plots: bool = False, notebook_env: bool = False, ) -> str: html_elements = [ h2_html("Bayesian Optimization benchmarking suite report") ] for p, benchmark_result in benchmark_results.items(): html_elements.append(h3_html(f"{p}:")) plots = make_plots( benchmark_result, problem_name=p, include_individual=include_individual_method_plots, ) html_elements.extend(plot_config_to_html(plt) for plt in plots) if errors_encountered: html_elements.append(h3_html("Errors encountered:")) html_elements.extend(p_html(err) for err in errors_encountered) else: html_elements.append(h3_html("No errors encountered!")) # Experiment name is used in header, which is disabled in this case. return render_report_elements( experiment_name="", html_elements=html_elements, header=False, notebook_env=notebook_env, )
def testRenderReportElements(self): elements = [ p_html("foobar"), h2_html("foobar"), h3_html("foobar"), list_item_html("foobar"), unordered_list_html(["foo", "bar"]), ] render_report_elements("test", elements)
def testRenderReportElements(self): elements = [ p_html("foobar"), h2_html("foobar"), h3_html("foobar"), list_item_html("foobar"), unordered_list_html(["foo", "bar"]), link_html("foo", "bar"), table_cell_html("foobar"), table_cell_html("foobar", width="100px"), table_heading_cell_html("foobar"), table_row_html(["foo", "bar"]), table_html(["foo", "bar"]), ] render_report_elements("test", elements)
def generate_report(self, include_individual: bool = False) -> str: benchmark_result_dict = self._runner.aggregate_results() html_elements = [h2_html("Bayesian Optimization benchmarking suite report")] for p, benchmark_result in benchmark_result_dict.items(): html_elements.append(h3_html(f"{p}:")) plots = self._make_plots( benchmark_result, problem_name=p, include_individual=include_individual ) html_elements.extend(plot_config_to_html(plt) for plt in plots) if len(self._runner._error_messages) > 0: html_elements.append(h3_html("Errors encountered")) html_elements.extend(p_html(err) for err in self._runner._error_messages) else: html_elements.append(h3_html("No errors encountered")) return render_report_elements("bo_benchmark_suite_test", html_elements)