def test_number_independent_conservation_relations(model): """ Show number of independent conservation relations in the model. This test will return the number of conservation relations, i.e. conservation pools through the left null space of the S-Matrix. This test is not scored, as the dimension of the left null space depends on the S-Matrix constructed, which is system-specific. """ ann = test_number_independent_conservation_relations.annotation ann["data"] = matrix.number_independent_conservation_relations(model) ann["message"] = wrapper.fill( """The number of independent conservation relations is {}.""".format( ann["data"]))
def test_number_independent_conservation_relations(model): """ Show the number of independent conservation relations in the model. This test will return the number of conservation relations, i.e., conservation pools through the left null space of the stoichiometric matrix. This test is not scored, as the dimension of the left null space is system-specific. Implementation: Calculate the left null space, i.e., the null space of the transposed stoichiometric matrix, using an algorithm based on the singular value decomposition adapted from https://scipy.github.io/old-wiki/pages/Cookbook/RankNullspace.html Then, return the estimated dimension of that null space. """ ann = test_number_independent_conservation_relations.annotation ann["data"] = matrix.number_independent_conservation_relations(model) # Report the number of ICR scaled by the number of metabolites. ann["metric"] = ann["data"] / len(model.metabolites) ann["message"] = wrapper.fill( """The number of independent conservation relations is {}.""".format( ann["data"]))
def test_number_independent_conservation_relations(model, num): assert matrix.number_independent_conservation_relations(model) == num