Skip to content

Commit

Permalink
Bug Fixes. Bumped to v0.7.89
Browse files Browse the repository at this point in the history
  • Loading branch information
wassimj committed Dec 19, 2024
1 parent d11f603 commit a603620
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 424 deletions.
264 changes: 89 additions & 175 deletions notebooks/Chessboard.ipynb

Large diffs are not rendered by default.

253 changes: 9 additions & 244 deletions notebooks/GraphByIFCPath.ipynb

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions src/topologicpy/Graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -9008,6 +9008,7 @@ def _topological_distance(g, start, target):
queue.append((neighbor, distance + 1))

return None # Target not reachable

@staticmethod
def TopologicalDistance(graph, vertexA, vertexB, tolerance=0.0001):
"""
Expand Down Expand Up @@ -9043,14 +9044,21 @@ def TopologicalDistance(graph, vertexA, vertexB, tolerance=0.0001):
if not Topology.IsInstance(vertexB, "Vertex"):
print("Graph.TopologicalDistance - Error: The input vertexB is not a valid vertex. Returning None.")
return None
vertices = Graph.Vertices(graph)

g = Graph.AdjacencyDictionary(graph)
vertices = Graph.Vertices(graph)
keys = list(g.keys())
index_a = Vertex.Index(vertexA, vertices, tolerance=tolerance)
g_vertexA = Graph.NearestVertex(graph, vertexA)
g_vertexB = Graph.NearestVertex(graph, vertexB)
index_a = Vertex.Index(g_vertexA, vertices, tolerance=tolerance)
if index_a == None:
return 0
start = keys[index_a]
index_b = Vertex.Index(vertexB, vertices, tolerance=tolerance)
index_b = Vertex.Index(g_vertexB, vertices, tolerance=tolerance)
if index_b == None:
return 0
target = keys[index_b]
return Graph._topological_distance(g, start, target) # Hook to Core
return Graph._topological_distance(g, start, target)

@staticmethod
def Topology(graph):
Expand Down
2 changes: 1 addition & 1 deletion src/topologicpy/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.7.88'
__version__ = '0.7.89'

0 comments on commit a603620

Please sign in to comment.