original_docstring: 
          Function for generating an HTML report for sharing. The HTML report is rendered with
          Jinja2, and uses the template "report_template.html" located in the module directory.
          The report includes interactive plots showing statistics of the assignments/ulines and
          an overview of the spectrum. At the end of the report is a table of the assignments and
          uline data.
          
          Parameters
          ----------
          
          filepath: str or None, optional
              Path to save the report to. If `None`, defaults to `reports/{id}-summary.html`
          
docstring: Function for generating an HTML report for sharing. The HTML report is rendered with
  Jinja2, and uses the template "report_template.html" located in the module directory.
  The report includes interactive plots showing statistics of the assignments/ulines and
  an overview of the spectrum. At the end of the report is a table of the assignments and
  uline data.
  
  Parameters
  
  str or None, optional
  Path to save the report to. If `None`, defaults to `reports/{id}-summary.html`
docstring_tokens: Function for generating an HTML report for sharing . The HTML report is rendered with Jinja2 and uses the template " report_template . html " located in the module directory . The report includes interactive plots showing statistics of the assignments / ulines and an overview of the spectrum . At the end of the report is a table of the assignments and uline data . Parameters str or None optional Path to save the report to . If ` None ` defaults to ` reports / { id } - summary . html `
code: def _create_html_report(self, filepath=None):
          """
          Function for generating an HTML report for sharing. The HTML report is rendered with
          Jinja2, and uses the template "report_template.html" located in the module directory.
          The report includes interactive plots showing statistics of the assignments/ulines and
          an overview of the spectrum. At the end of the report is a table of the assignments and
          uline data.
          
          Parameters
          ----------
          
          filepath: str or None, optional
              Path to save the report to. If `None`, defaults to `reports/{id}-summary.html`
          """
          template_path = os.path.join(
              os.path.dirname(os.path.abspath(__file__)), "report_template.html"
          )
          with open(template_path) as read_file:
              template = Template(read_file.read())
          html_dict = dict()
          # Say what the minimum value for peak detection is.
          html_dict["peak_threshold"] = self.threshold
          # The assigned molecules table
          reduced_table = self.table[
              [
                  "frequency",
                  "intensity",
                  "formula",
                  "name",
                  "catalog_frequency",
                  "deviation",
                  "ustate_energy",
                  "source",
              ]
          ]
          # Render pandas dataframe HTML with bar annotations
          reduced_table_html = (
              reduced_table.style.bar(
                  subset=["deviation", "ustate_energy"],
                  align="mid",
                  color=["#d65f5f", "#5fba7d"],
              )
              .bar(subset=["intensity"], color="#5fba7d")
              .format(
                  {
                      "frequency": "{:.4f}",
                      "catalog_frequency": "{:.4f}",
                      "deviation": "{:.3f}",
                      "ustate_energy": "{:.2f}",
                      "intensity": "{:.3f}",
                  }
              )
              .set_table_attributes("""class = "data-table hover compact" """)
              .render(classes=""" "data-table hover compact" """)
          )
          html_dict["assignments_table"] = reduced_table_html
          # The unidentified features table
          ulines = self.line_lists["Peaks"].get_ulines()
          uline_df = pd.DataFrame(
              [[uline.frequency, uline.intensity] for uline in ulines],
              columns=["Frequency", "Intensity"],
          )
          html_dict["uline_table"] = (
              uline_df.style.bar(subset=["Intensity"], color="#5fba7d")
              .format({"Frequency": "{:.4f}", "Intensity": "{:.2f}"})
              .set_table_attributes("""class = "data-table hover compact" """)
              .render(classes=""" "data-table hover compact" """)
          )
          # Plotly displays of the spectral feature breakdown and whatnot
          html_dict["plotly_breakdown"] = plot(self.plot_breakdown(), output_type="div")
          html_dict["plotly_figure"] = plot(self.plot_assigned(), output_type="div")
          # Render the template with Jinja and save the HTML report
          output = template.render(session=self.session, **html_dict)
          if filepath is None:
              filepath = f"reports/{self.session.experiment}-summary.html"
          with open(filepath, "w+") as write_file:
              write_file.write(output)
code_tokens: def _create_html_report ( self , filepath = None ) : template_path = os . path . join ( os . path . dirname ( os . path . abspath ( __file__ ) ) , "report_template.html" ) with open ( template_path ) as read_file : template = Template ( read_file . read ( ) ) html_dict = dict ( ) html_dict [ "peak_threshold" ] = self . threshold reduced_table = self . table [ [ "frequency" , "intensity" , "formula" , "name" , "catalog_frequency" , "deviation" , "ustate_energy" , "source" , ] ] reduced_table_html = ( reduced_table . style . bar ( subset = [ "deviation" , "ustate_energy" ] , align = "mid" , color = [ "#d65f5f" , "#5fba7d" ] , ) . bar ( subset = [ "intensity" ] , color = "#5fba7d" ) . format ( { "frequency" : "{:.4f}" , "catalog_frequency" : "{:.4f}" , "deviation" : "{:.3f}" , "ustate_energy" : "{:.2f}" , "intensity" : "{:.3f}" , } ) . set_table_attributes ( """class = "data-table hover compact" """ ) . render ( classes = """ "data-table hover compact" """ ) ) html_dict [ "assignments_table" ] = reduced_table_html ulines = self . line_lists [ "Peaks" ] . get_ulines ( ) uline_df = pd . DataFrame ( [ [ uline . frequency , uline . intensity ] for uline in ulines ] , columns = [ "Frequency" , "Intensity" ] , ) html_dict [ "uline_table" ] = ( uline_df . style . bar ( subset = [ "Intensity" ] , color = "#5fba7d" ) . format ( { "Frequency" : "{:.4f}" , "Intensity" : "{:.2f}" } ) . set_table_attributes ( """class = "data-table hover compact" """ ) . render ( classes = """ "data-table hover compact" """ ) ) html_dict [ "plotly_breakdown" ] = plot ( self . plot_breakdown ( ) , output_type = "div" ) html_dict [ "plotly_figure" ] = plot ( self . plot_assigned ( ) , output_type = "div" ) output = template . render ( session = self . session , ** html_dict ) if filepath is None : filepath = f"reports/{self.session.experiment}-summary.html" with open ( filepath , "w+" ) as write_file : write_file . write ( output )
short_docstring: Function for generating an HTML report for sharing.
short_docstring_tokens: Function for generating an HTML report for sharing .
comment: """
          Function for generating an HTML report for sharing. The HTML report is rendered with
          Jinja2, and uses the template "report_template.html" located in the module directory.
          The report includes interactive plots showing statistics of the assignments/ulines and
          an overview of the spectrum. At the end of the report is a table of the assignments and
          uline data.
          
          Parameters
          ----------
          
          filepath: str or None, optional
              Path to save the report to. If `None`, defaults to `reports/{id}-summary.html`
          """$SEP$# Say what the minimum value for peak detection is.$SEP$# The assigned molecules table$SEP$# Render pandas dataframe HTML with bar annotations$SEP$# The unidentified features table$SEP$# Plotly displays of the spectral feature breakdown and whatnot$SEP$# Render the template with Jinja and save the HTML report