Skip to content

Commit

Permalink
feat(get-path): return path and graph
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjayankur31 committed Sep 8, 2023
1 parent 4f5e2c1 commit 6f1d5f9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions neuroml/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def get_relative_component_path(src: str, dest: str, root: Type =
:param root: root component of the hierarchy
:param graph: a networkx digraph of the NeuroML hierarchy if available
if not, one is constructed
:returns: networkx digraph for future use
:returns: calculated path and networkx digraph for future use
"""
if graph is None:
graph = networkx.DiGraph()
Expand All @@ -299,9 +299,10 @@ def get_relative_component_path(src: str, dest: str, root: Type =
print(f"Path2: {p2s}")
# remove one "../" because we do not need to get to the common level
# here, unlike actual file system path traversal
print("Relative path: " + os.path.relpath(p1s, p2s).replace("../", "", 1))
path = os.path.relpath(p1s, p2s).replace("../", "", 1)
print("Relative path: " + path)

return graph
return (path, graph)


def main():
Expand Down

0 comments on commit 6f1d5f9

Please sign in to comment.