original_docstring: 
          Function for calculating some aggregate statistics of the assignments and u-lines. This
          breaks the assignments sources up to identify what the dominant source of information was.
          The two metrics for assignments are the number of transitions and the intensity contribution
          assigned by a particular source.
          :return: dict
          
docstring: Function for calculating some aggregate statistics of the assignments and u-lines. This
  breaks the assignments sources up to identify what the dominant source of information was.
  The two metrics for assignments are the number of transitions and the intensity contribution
  assigned by a particular source.
docstring_tokens: Function for calculating some aggregate statistics of the assignments and u - lines . This breaks the assignments sources up to identify what the dominant source of information was . The two metrics for assignments are the number of transitions and the intensity contribution assigned by a particular source .
code: def calculate_assignment_statistics(self):
          """
          Function for calculating some aggregate statistics of the assignments and u-lines. This
          breaks the assignments sources up to identify what the dominant source of information was.
          The two metrics for assignments are the number of transitions and the intensity contribution
          assigned by a particular source.
          :return: dict
          """
          reduced_table = self.table[
              [
                  "frequency",
                  "intensity",
                  "formula",
                  "name",
                  "catalog_frequency",
                  "deviation",
                  "ustate_energy",
                  "source",
                  "public",
              ]
          ]
          artifacts = reduced_table.loc[reduced_table["name"] == "Artifact"]
          splat = reduced_table.loc[reduced_table["source"] == "CDMS/JPL"]
          local = reduced_table.loc[
              (reduced_table["source"] != "Artifact")
              & (reduced_table["source"] != "CDMS/JPL")
          ]
          public = local.loc[local["public"] == True]
          private = local.loc[local["public"] == False]
          sources = [
              "Artifacts",
              "Splatalogue",
              "Published molecules",
              "Unpublished molecules",
          ]
          # Added up the total number of lines
          total_lines = len(self.line_lists["Peaks"])
          # Add up the total intensity
          ulines = self.line_lists.get("Peaks").get_ulines()
          total_intensity = np.sum([uline.intensity for uline in ulines])
          total_intensity += np.sum(reduced_table["intensity"])
          line_breakdown = [len(source) for source in [artifacts, splat, public, private]]
          intensity_breakdown = [
              np.sum(source["intensity"])
              for source in [artifacts, splat, public, private]
          ]
          # Calculate the aggregate statistics
          cum_line_breakdown = np.cumsum(line_breakdown)
          cum_int_breakdown = np.cumsum(intensity_breakdown)
          # Organize results into dictionary for return
          return_dict = {
              "sources": sources,
              # These are absolute values
              "abs": {
                  "total lines": total_lines,
                  "total intensity": total_intensity,
                  "line breakdown": line_breakdown,
                  "intensity breakdown": intensity_breakdown,
                  "cumulative line breakdown": cum_line_breakdown,
                  "cumulative intensity breakdown": cum_int_breakdown,
              },
              # These are the corresponding values in percentage
              "percent": {
                  "line breakdown": [
                      (value / total_lines) * 100.0 for value in line_breakdown
                  ],
                  "intensity breakdown": [
                      (value / total_intensity) * 100.0 for value in intensity_breakdown
                  ],
                  "cumulative line breakdown": [
                      (value / total_lines) * 100.0 for value in cum_line_breakdown
                  ],
                  "cumulative intensity breakdown": [
                      (value / total_intensity) * 100.0 for value in cum_int_breakdown
                  ],
              },
              "molecules": {
                  "CDMS/JPL": {
                      name: len(splat.loc[splat["name"] == name])
                      for name in splat["name"].unique()
                  },
                  "Published": {
                      name: len(public.loc[public["name"] == name])
                      for name in public["name"].unique()
                  },
                  "Unpublished": {
                      name: len(private.loc[private["name"] == name])
                      for name in private["name"].unique()
                  },
              },
          }
          return return_dict
code_tokens: def calculate_assignment_statistics ( self ) : reduced_table = self . table [ [ "frequency" , "intensity" , "formula" , "name" , "catalog_frequency" , "deviation" , "ustate_energy" , "source" , "public" , ] ] artifacts = reduced_table . loc [ reduced_table [ "name" ] == "Artifact" ] splat = reduced_table . loc [ reduced_table [ "source" ] == "CDMS/JPL" ] local = reduced_table . loc [ ( reduced_table [ "source" ] != "Artifact" ) & ( reduced_table [ "source" ] != "CDMS/JPL" ) ] public = local . loc [ local [ "public" ] == True ] private = local . loc [ local [ "public" ] == False ] sources = [ "Artifacts" , "Splatalogue" , "Published molecules" , "Unpublished molecules" , ] total_lines = len ( self . line_lists [ "Peaks" ] ) ulines = self . line_lists . get ( "Peaks" ) . get_ulines ( ) total_intensity = np . sum ( [ uline . intensity for uline in ulines ] ) total_intensity += np . sum ( reduced_table [ "intensity" ] ) line_breakdown = [ len ( source ) for source in [ artifacts , splat , public , private ] ] intensity_breakdown = [ np . sum ( source [ "intensity" ] ) for source in [ artifacts , splat , public , private ] ] cum_line_breakdown = np . cumsum ( line_breakdown ) cum_int_breakdown = np . cumsum ( intensity_breakdown ) return_dict = { "sources" : sources , "abs" : { "total lines" : total_lines , "total intensity" : total_intensity , "line breakdown" : line_breakdown , "intensity breakdown" : intensity_breakdown , "cumulative line breakdown" : cum_line_breakdown , "cumulative intensity breakdown" : cum_int_breakdown , } , "percent" : { "line breakdown" : [ ( value / total_lines ) * 100.0 for value in line_breakdown ] , "intensity breakdown" : [ ( value / total_intensity ) * 100.0 for value in intensity_breakdown ] , "cumulative line breakdown" : [ ( value / total_lines ) * 100.0 for value in cum_line_breakdown ] , "cumulative intensity breakdown" : [ ( value / total_intensity ) * 100.0 for value in cum_int_breakdown ] , } , "molecules" : { "CDMS/JPL" : { name : len ( splat . loc [ splat [ "name" ] == name ] ) for name in splat [ "name" ] . unique ( ) } , "Published" : { name : len ( public . loc [ public [ "name" ] == name ] ) for name in public [ "name" ] . unique ( ) } , "Unpublished" : { name : len ( private . loc [ private [ "name" ] == name ] ) for name in private [ "name" ] . unique ( ) } , } , } return return_dict
short_docstring: Function for calculating some aggregate statistics of the assignments and u-lines.
short_docstring_tokens: Function for calculating some aggregate statistics of the assignments and u - lines .
comment: """
          Function for calculating some aggregate statistics of the assignments and u-lines. This
          breaks the assignments sources up to identify what the dominant source of information was.
          The two metrics for assignments are the number of transitions and the intensity contribution
          assigned by a particular source.
          :return: dict
          """$SEP$# Added up the total number of lines$SEP$# Add up the total intensity$SEP$# Calculate the aggregate statistics$SEP$# Organize results into dictionary for return$SEP$# These are absolute values$SEP$# These are the corresponding values in percentage