original_docstring: 
          Adds new compounds to the reaction
        
          INPUTS:
          -------
          compounds_list: A dictionary whose keys are compounds objects and values are their
                          stoichiometric coefficinet in the reaction. The compound objects should
                          have already been defined and added to the model
          
docstring: Adds new compounds to the reaction
  INPUTS.
  
  A dictionary whose keys are compounds objects and values are their
  stoichiometric coefficinet in the reaction. The compound objects should
  have already been defined and added to the model
docstring_tokens: Adds new compounds to the reaction INPUTS . A dictionary whose keys are compounds objects and values are their stoichiometric coefficinet in the reaction . The compound objects should have already been defined and added to the model
code: def add_compounds(self,compounds_list):
          """
          Adds new compounds to the reaction
        
          INPUTS:
          -------
          compounds_list: A dictionary whose keys are compounds objects and values are their
                          stoichiometric coefficinet in the reaction. The compound objects should
                          have already been defined and added to the model
          """
          if not isinstance(compounds_list,dict):
              raise TypeError('compounds_list must be a dictionary')
          
          # Return an error if there are new compound objects not already in the model 
          cmp_notInModel = [c for c in compounds_list.keys() if c not in self.model.compounds]
          if len(cmp_notInModel) > 0:
              raise ValueError('The following compounds not in the model ' + self.model.id + ': ' + str([c.id for c in cmp_notInModel])) 
  
          for cmp in compounds_list:
              if compounds_list[cmp] == 0 and self.warnings:
                  print 'WARNING! Compound {} has a stoichiometric coefficinet of zero and was not added to reaction {}'.format(cmp.id,self.id)
              else:
                  self.compounds.append(cmp)
                  self.stoichiometry[cmp] = compounds_list[cmp]
                  cmp.reactions.append(self)
                  if compounds_list[cmp] < 0:
                      self.reactants.append(cmp)
                      cmp.reactant_reactions.append(self)
                  elif compounds_list[cmp] > 0:
                      self.products.append(cmp)
                      cmp.product_reactions.append(self)
  
          self.compounds = sorted([c for c in self.stoichiometry.keys() if self.stoichiometry[c] < 0 ],key=lambda x:x.id) + sorted([c for c in self.stoichiometry.keys() if self.stoichiometry[c] > 0 ],key=lambda x:x.id) 
          self.reactants = sorted(self.reactants,key=lambda x:x.id) 
          self.products = sorted(self.products,key=lambda x:x.id)
code_tokens: def add_compounds ( self , compounds_list ) : if not isinstance ( compounds_list , dict ) : raise TypeError ( 'compounds_list must be a dictionary' ) cmp_notInModel = [ c for c in compounds_list . keys ( ) if c not in self . model . compounds ] if len ( cmp_notInModel ) > 0 : raise ValueError ( 'The following compounds not in the model ' + self . model . id + ': ' + str ( [ c . id for c in cmp_notInModel ] ) ) for cmp in compounds_list : if compounds_list [ cmp ] == 0 and self . warnings : print 'WARNING! Compound {} has a stoichiometric coefficinet of zero and was not added to reaction {}' . format ( cmp . id , self . id ) else : self . compounds . append ( cmp ) self . stoichiometry [ cmp ] = compounds_list [ cmp ] cmp . reactions . append ( self ) if compounds_list [ cmp ] < 0 : self . reactants . append ( cmp ) cmp . reactant_reactions . append ( self ) elif compounds_list [ cmp ] > 0 : self . products . append ( cmp ) cmp . product_reactions . append ( self ) self . compounds = sorted ( [ c for c in self . stoichiometry . keys ( ) if self . stoichiometry [ c ] < 0 ] , key = lambda x : x . id ) + sorted ( [ c for c in self . stoichiometry . keys ( ) if self . stoichiometry [ c ] > 0 ] , key = lambda x : x . id ) self . reactants = sorted ( self . reactants , key = lambda x : x . id ) self . products = sorted ( self . products , key = lambda x : x . id )
short_docstring: Adds new compounds to the reaction
  INPUTS:
short_docstring_tokens: Adds new compounds to the reaction INPUTS :
comment: """
          Adds new compounds to the reaction
        
          INPUTS:
          -------
          compounds_list: A dictionary whose keys are compounds objects and values are their
                          stoichiometric coefficinet in the reaction. The compound objects should
                          have already been defined and added to the model
          """$SEP$# Return an error if there are new compound objects not already in the model 