def from_pickle(path, check_version=True):
"""Reads a graph from a gpickle file.
:param file or str path: File or filename to read. Filenames ending in .gz or .bz2 will be uncompressed.
:param bool check_version: Checks if the graph was produced by this version of PyBEL
:return: A BEL graph
:rtype: BELGraph
"""
graph = read_gpickle(path)
raise_for_not_bel(graph)
if check_version:
raise_for_old_graph(graph)
return graph
评论列表
文章目录