本文整理汇总了Python中PhyloBuddy.hash_ids方法的典型用法代码示例。如果您正苦于以下问题:Python PhyloBuddy.hash_ids方法的具体用法?Python PhyloBuddy.hash_ids怎么用?Python PhyloBuddy.hash_ids使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhyloBuddy
的用法示例。
在下文中一共展示了PhyloBuddy.hash_ids方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_hash_ids_edges
# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import hash_ids [as 别名]
def test_hash_ids_edges():
with pytest.raises(TypeError) as e:
Pb.hash_ids(Pb.PhyloBuddy, hash_length="foo")
assert "Hash length argument must be an integer, not <class 'str'>" in str(e)
with pytest.raises(ValueError) as e:
Pb.hash_ids(Pb.PhyloBuddy, hash_length=0)
assert "Hash length must be greater than 0" in str(e)
with pytest.raises(ValueError) as e:
Pb.hash_ids(pb_resources.get_one("m n"), hash_length=1)
assert "Insufficient number of hashes available to cover all sequences." in str(e)
tester = Pb.PhyloBuddy(resource("tree_with_node_lables.nwk"))
test_hash = phylo_to_hash(tester)
tester = Pb.hash_ids(tester, hash_length=5, nodes=True)
assert phylo_to_hash(tester) != test_hash
示例2: test_hash_ids
# 需要导入模块: import PhyloBuddy [as 别名]
# 或者: from PhyloBuddy import hash_ids [as 别名]
def test_hash_ids(phylobuddy):
orig_hash = phylo_to_hash(phylobuddy)
Pb.hash_ids(phylobuddy)
assert phylo_to_hash(phylobuddy) != orig_hash