original_docstring: 
              Function that will complete the assignment process by
              serializing DataClass objects and formatting a report.
  
              Creates summary pandas dataframes as self.table and self.profiles,
              which correspond to the assignments and fitted line profiles respectively.
          
docstring: Function that will complete the assignment process by
  serializing DataClass objects and formatting a report.
  
  Creates summary pandas dataframes as self.table and self.profiles,
  which correspond to the assignments and fitted line profiles respectively.
docstring_tokens: Function that will complete the assignment process by serializing DataClass objects and formatting a report . Creates summary pandas dataframes as self . table and self . profiles which correspond to the assignments and fitted line profiles respectively .
code: def finalize_assignments(self):
          """
              Function that will complete the assignment process by
              serializing DataClass objects and formatting a report.
  
              Creates summary pandas dataframes as self.table and self.profiles,
              which correspond to the assignments and fitted line profiles respectively.
          """
          assignments = self.line_lists["Peaks"].get_assignments()
          ulines = self.line_lists["Peaks"].get_ulines()
          if len(assignments) > 0:
              for obj in assignments:
                  if len(obj.multiple) != 0 and obj.final is False:
                      warnings.warn(
                          f"Transition at {obj.frequency:4f} has multiple candidates."
                      )
                      warnings.warn(f"Please choose assignment for peak {obj.peak_id}.")
                  else:
                      # Set the transition as finalized
                      obj.final = True
                  # Dump all the assignments into YAML format
                  obj.to_file(f"assignment_objs/{obj.experiment}-{obj.peak_id}", "yaml")
                  obj.deviation = obj.catalog_frequency - obj.frequency
              # Convert all of the assignment data into a CSV file
              assignment_df = pd.DataFrame(data=[obj.__dict__ for obj in assignments])
              self.table = assignment_df
              self.table.sort_values(["frequency"], ascending=True, inplace=True)
              # Generate a LaTeX table for publication
              self.create_latex_table()
              # Dump assignments to disk
              assignment_df.to_csv(f"reports/{self.session.experiment}.csv", index=False)
              # Dump Uline data to disk
              peak_data = [[peak.frequency, peak.intensity] for peak in ulines]
              peak_df = pd.DataFrame(peak_data, columns=["Frequency", "Intensity"])
              peak_df.to_csv(f"reports/{self.session.experiment}-ulines.csv", index=False)
  
              tally = self._get_assigned_names()
              combined_dict = {
                  "assigned_lines": len(assignments),
                  "ulines": len(ulines),
                  "peaks": self.line_lists["Peaks"].get_frequencies(),
                  "num_peaks": len(self.line_lists["Peaks"]),
                  "tally": tally,
                  "unique_molecules": self.names,
                  "num_unique": len(self.names),
              }
              # Combine Session information
              combined_dict.update(self.session.__dict__)
              # Dump to disk
              routines.dump_yaml(f"sessions/{self.session.experiment}.yml", "yaml")
              self._create_html_report()
              # Dump data to notebook output
              for key, value in combined_dict.items():
                  self.logger.info(key + ":   " + str(value))
          else:
              raise Exception(
                  "No assignments made in this session - nothing to finalize!"
              )
code_tokens: def finalize_assignments ( self ) : assignments = self . line_lists [ "Peaks" ] . get_assignments ( ) ulines = self . line_lists [ "Peaks" ] . get_ulines ( ) if len ( assignments ) > 0 : for obj in assignments : if len ( obj . multiple ) != 0 and obj . final is False : warnings . warn ( f"Transition at {obj.frequency:4f} has multiple candidates." ) warnings . warn ( f"Please choose assignment for peak {obj.peak_id}." ) else : obj . final = True obj . to_file ( f"assignment_objs/{obj.experiment}-{obj.peak_id}" , "yaml" ) obj . deviation = obj . catalog_frequency - obj . frequency assignment_df = pd . DataFrame ( data = [ obj . __dict__ for obj in assignments ] ) self . table = assignment_df self . table . sort_values ( [ "frequency" ] , ascending = True , inplace = True ) self . create_latex_table ( ) assignment_df . to_csv ( f"reports/{self.session.experiment}.csv" , index = False ) peak_data = [ [ peak . frequency , peak . intensity ] for peak in ulines ] peak_df = pd . DataFrame ( peak_data , columns = [ "Frequency" , "Intensity" ] ) peak_df . to_csv ( f"reports/{self.session.experiment}-ulines.csv" , index = False ) tally = self . _get_assigned_names ( ) combined_dict = { "assigned_lines" : len ( assignments ) , "ulines" : len ( ulines ) , "peaks" : self . line_lists [ "Peaks" ] . get_frequencies ( ) , "num_peaks" : len ( self . line_lists [ "Peaks" ] ) , "tally" : tally , "unique_molecules" : self . names , "num_unique" : len ( self . names ) , } combined_dict . update ( self . session . __dict__ ) routines . dump_yaml ( f"sessions/{self.session.experiment}.yml" , "yaml" ) self . _create_html_report ( ) for key , value in combined_dict . items ( ) : self . logger . info ( key + ":   " + str ( value ) ) else : raise Exception ( "No assignments made in this session - nothing to finalize!" )
short_docstring: Function that will complete the assignment process by
  serializing DataClass objects and formatting a report.
short_docstring_tokens: Function that will complete the assignment process by serializing DataClass objects and formatting a report .
comment: """
              Function that will complete the assignment process by
              serializing DataClass objects and formatting a report.
  
              Creates summary pandas dataframes as self.table and self.profiles,
              which correspond to the assignments and fitted line profiles respectively.
          """$SEP$# Set the transition as finalized$SEP$# Dump all the assignments into YAML format$SEP$# Convert all of the assignment data into a CSV file$SEP$# Generate a LaTeX table for publication$SEP$# Dump assignments to disk$SEP$# Dump Uline data to disk$SEP$# Combine Session information$SEP$# Dump to disk$SEP$# Dump data to notebook output