コード例 #1
0
ファイル: simple_sbml.py プロジェクト: tybiot/SBMLLint
 def _getMolecules(self):
     """
 :return dict: key is species name, value is species object
 """
     molecules = []
     for reaction in self.reactions:
         molecules.extend(
             MoleculeStoichiometry.getMolecules(reaction.reactants))
         molecules.extend(
             MoleculeStoichiometry.getMolecules(reaction.products))
     return util.uniqueify(molecules)
コード例 #2
0
 def testGetMolecules(self):
     if IGNORE_TEST:
         return
     names = ["a", "b", "c"]
     full_names = list(names)
     full_names.extend(names)
     m_ss = [MoleculeStoichiometry(Molecule(n), NUM1) for n in full_names]
     molecules = MoleculeStoichiometry.getMolecules(m_ss)
     self.assertEqual(len(molecules), len(names))