<commit_before>class Metabolite < ActiveRecord::Base
  has_many :concentrations
  
  #Return an array of statistics describing concentrations for this metabolite
  def concentration_statistics
    stats = Array.new
    
    results = self.concentrations.select('concentration_units, avg(concentration_value) as average_concentration, std(concentration_value) std_concentration').
      group('concentration_units')
    
    results.each do |r|
      stats << "#{r.average_concentration.round(2)} &#177; #{r.std_concentration.round(2)} #{r.concentration_units}"
    end
    stats
    
    # unit_concs = Hash.new
    # concentrations.each do |c|
    #   unit = c.concentration_units
    #   value = c.concentration_value
    #   unit_concs[unit] ||= Array.new
    #   unit_concs[unit] << value
    # end
    # 
    # unit_concs.keys.each do |unit|
    #   stats << "33 #{unit}"
    # end
    # 
    # stats
  end
  
end<commit_msg>removed commented code in metabolite model<commit_after>class Metabolite < ActiveRecord::Base
  has_many :concentrations
  
  #Return an array of statistics describing concentrations for this metabolite
  def concentration_statistics
    stats = Array.new
    
    results = self.concentrations.select('concentration_units, avg(concentration_value) as average_concentration, std(concentration_value) std_concentration').
      group('concentration_units')
    
    results.each do |r|
      stats << "#{r.average_concentration.round(2)} &#177; #{r.std_concentration.round(2)} #{r.concentration_units}"
    end
    stats
  end
  
end
{'fraction_non_alphanumeric': 0.09923175416133162, 'fraction_numerical': 0.0076824583866837385, 'mean_word_length': 3.6106194690265485, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7523225', 'n_tokens_mistral': 534, 'n_tokens_neox': 472, 'n_words': 104}