Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement fast load graph - Issue #152 #153

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions ClearMap/Analysis/Graphs/GraphGt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1438,9 +1438,27 @@ def copy(self):
return Graph(name = copy.copy(self.name), base = self.base.copy())


def load(filename):
g = gt.load_graph(filename);
return Graph(base = g);
def load(filename, ignore_vp=None, ignore_ep=None, ignore_gp=None):
"""Read graph from file.

Arguments
---------
filename : str
Path to the GT file.
ignore_vp : list
Vertex properties that will be ignored.
ignore_ep : list
Edge properties that will be ignored.
ignore_gp : list
Graph properties that will be ignored.

Returns
-------
graph : Graph
The graph as a Graph object.
"""
g = gt.load_graph(filename, ignore_vp=ignore_vp, ignore_ep=ignore_ep, ignore_gp=ignore_gp)
return Graph(base=g)

def save(filename, graph):
graph.save(filename);
Expand Down