本文整理汇总了Python中cobra.Model._sbml方法的典型用法代码示例。如果您正苦于以下问题:Python Model._sbml方法的具体用法?Python Model._sbml怎么用?Python Model._sbml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cobra.Model
的用法示例。
在下文中一共展示了Model._sbml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_model_history
# 需要导入模块: from cobra import Model [as 别名]
# 或者: from cobra.Model import _sbml [as 别名]
def test_model_history(tmp_path):
"""Testing reading and writing of ModelHistory."""
model = Model("test")
model._sbml = {
"creators": [{
"familyName": "Mustermann",
"givenName": "Max",
"organisation": "Muster University",
"email": "[email protected]",
}]
}
sbml_path = join(str(tmp_path), "test.xml")
with open(sbml_path, "w") as f_out:
write_sbml_model(model, f_out)
with open(sbml_path, "r") as f_in:
model2 = read_sbml_model(f_in)
assert "creators" in model2._sbml
assert len(model2._sbml["creators"]) is 1
c = model2._sbml["creators"][0]
assert c["familyName"] == "Mustermann"
assert c["givenName"] == "Max"
assert c["organisation"] == "Muster University"
assert c["email"] == "[email protected]"