topologicpy 0.4.81__tar.gz → 0.4.83__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {topologicpy-0.4.81/src/topologicpy.egg-info → topologicpy-0.4.83}/PKG-INFO +1 -1
- {topologicpy-0.4.81 → topologicpy-0.4.83}/pyproject.toml +1 -1
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Graph.py +241 -3
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/__init__.py +1 -1
- {topologicpy-0.4.81 → topologicpy-0.4.83/src/topologicpy.egg-info}/PKG-INFO +1 -1
- {topologicpy-0.4.81 → topologicpy-0.4.83}/LICENSE +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/MANIFEST.in +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/README.md +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/setup.cfg +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Aperture.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Cell.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/CellComplex.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Cluster.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Color.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Context.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/DGL.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Dictionary.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Edge.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/EnergyModel.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Face.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Grid.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Helper.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Honeybee.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Matrix.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Neo4j.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Plotly.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Polyskel.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Shell.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Speckle.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Topology.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Vector.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Vertex.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/Wire.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/__init__.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libTKBO-6bdf205d.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libTKBRep-2960a069.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libTKBool-c44b74bd.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libTKFillet-9a670ba0.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libTKG2d-8f31849e.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libTKG3d-4c6bce57.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libTKGeomAlgo-26066fd9.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libTKGeomBase-2116cabe.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libTKMath-72572fa8.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libTKMesh-2a060427.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libTKOffset-6cab68ff.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libTKPrim-eb1262b3.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libTKShHealing-e67e5cc7.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libTKTopAlgo-e4c96c33.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libTKernel-fb7fe3b7.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libgcc_s-32c1665e.so.1 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libstdc++-672d7b41.so.6.0.30 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/topologic.cpython-310-x86_64-linux-gnu.so +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/topologic.cpython-311-x86_64-linux-gnu.so +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/topologic.cpython-38-x86_64-linux-gnu.so +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/topologic.cpython-39-x86_64-linux-gnu.so +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libTKBO-6bdf205d.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libTKBRep-2960a069.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libTKBool-c44b74bd.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libTKFillet-9a670ba0.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libTKG2d-8f31849e.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libTKG3d-4c6bce57.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libTKGeomAlgo-26066fd9.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libTKGeomBase-2116cabe.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libTKMath-72572fa8.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libTKMesh-2a060427.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libTKOffset-6cab68ff.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libTKPrim-eb1262b3.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libTKShHealing-e67e5cc7.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libTKTopAlgo-e4c96c33.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libTKernel-fb7fe3b7.so.7.7.0 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libgcc_s-32c1665e.so.1 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic.libs/libstdc++-672d7b41.so.6.0.30 +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/macos/topologic/__init__.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKBO-f6b191de.dll +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKBRep-e56a600e.dll +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKBool-7b8d47ae.dll +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKFillet-0ddbf0a8.dll +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKG2d-2e2dee3d.dll +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKG3d-6674513d.dll +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKGeomAlgo-d240e370.dll +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKGeomBase-df87aba5.dll +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKMath-45bd625a.dll +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKMesh-d6e826b1.dll +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKOffset-79b9cc94.dll +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKPrim-aa430a86.dll +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKShHealing-bb48be89.dll +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKTopAlgo-7d0d1e22.dll +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKernel-08c8cfbb.dll +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/__init__.py +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/topologic.cp310-win_amd64.pyd +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/topologic.cp311-win_amd64.pyd +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/topologic.cp38-win_amd64.pyd +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/topologic.cp39-win_amd64.pyd +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy.egg-info/SOURCES.txt +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy.egg-info/dependency_links.txt +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy.egg-info/requires.txt +0 -0
- {topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: topologicpy
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.83
|
4
4
|
Summary: An Advanced Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
|
5
5
|
Author-email: Wassim Jabi <wassim.jabi@gmail.com>
|
6
6
|
Project-URL: Homepage, https://github.com/wassimj/TopologicPy
|
@@ -4315,6 +4315,87 @@ class Graph:
|
|
4315
4315
|
return None
|
4316
4316
|
return graph.GetGUID()
|
4317
4317
|
|
4318
|
+
@staticmethod
|
4319
|
+
def IncomingEdges(graph: topologic.Graph, vertex: topologic.Vertex, directed: bool=False, tolerance: float=0.0001) -> list:
|
4320
|
+
"""
|
4321
|
+
Returns the incoming edges connected to a vertex. An edge is considered incoming if its end vertex is
|
4322
|
+
coincident with the input vertex.
|
4323
|
+
|
4324
|
+
Parameters
|
4325
|
+
----------
|
4326
|
+
graph : topologic.Graph
|
4327
|
+
The input graph.
|
4328
|
+
vertex : topologic.Vertex
|
4329
|
+
The input vertex.
|
4330
|
+
directed : bool , optional
|
4331
|
+
If set to True, the graph is considered to be directed. Otherwise, it will be considered as an unidrected graph. The default is False.
|
4332
|
+
tolerance : float , optional
|
4333
|
+
The desired tolerance. The default is 0.0001.
|
4334
|
+
|
4335
|
+
Returns
|
4336
|
+
-------
|
4337
|
+
list
|
4338
|
+
The list of incoming edges
|
4339
|
+
|
4340
|
+
"""
|
4341
|
+
from topologicpy.Edge import Edge
|
4342
|
+
if not isinstance(graph, topologic.Graph):
|
4343
|
+
print("Graph.IncomingEdges - Error: The input graph parameter is not a valid graph. Returning None.")
|
4344
|
+
return None
|
4345
|
+
if not isinstance(vertex, topologic.Vertex):
|
4346
|
+
print("Graph.IncomingEdges - Error: The input vertex parameter is not a valid vertex. Returning None.")
|
4347
|
+
return None
|
4348
|
+
|
4349
|
+
edges = Graph.Edges(graph, [vertex])
|
4350
|
+
if directed == False:
|
4351
|
+
return edges
|
4352
|
+
incoming_edges = []
|
4353
|
+
for edge in edges:
|
4354
|
+
ev = Edge.EndVertex(edge)
|
4355
|
+
if Vertex.Distance(vertex, ev) < tolerance:
|
4356
|
+
incoming_edges.append(edge)
|
4357
|
+
return incoming_edges
|
4358
|
+
|
4359
|
+
@staticmethod
|
4360
|
+
def IncomingVertices(graph: topologic.Graph, vertex: topologic.Vertex, directed: bool=False, tolerance: float=0.0001) -> list:
|
4361
|
+
"""
|
4362
|
+
Returns the incoming vertices connected to a vertex. A vertex is considered incoming if it is an adjacent vertex to the input vertex
|
4363
|
+
and the the edge connecting it to the input vertex is an incoming edge.
|
4364
|
+
|
4365
|
+
Parameters
|
4366
|
+
----------
|
4367
|
+
graph : topologic.Graph
|
4368
|
+
The input graph.
|
4369
|
+
vertex : topologic.Vertex
|
4370
|
+
The input vertex.
|
4371
|
+
directed : bool , optional
|
4372
|
+
If set to True, the graph is considered to be directed. Otherwise, it will be considered as an unidrected graph. The default is False.
|
4373
|
+
tolerance : float , optional
|
4374
|
+
The desired tolerance. The default is 0.0001.
|
4375
|
+
|
4376
|
+
Returns
|
4377
|
+
-------
|
4378
|
+
list
|
4379
|
+
The list of incoming vertices
|
4380
|
+
|
4381
|
+
"""
|
4382
|
+
from topologicpy.Edge import Edge
|
4383
|
+
if not isinstance(graph, topologic.Graph):
|
4384
|
+
print("Graph.IncomingVertices - Error: The input graph parameter is not a valid graph. Returning None.")
|
4385
|
+
return None
|
4386
|
+
if not isinstance(vertex, topologic.Vertex):
|
4387
|
+
print("Graph.IncomingVertices - Error: The input vertex parameter is not a valid vertex. Returning None.")
|
4388
|
+
return None
|
4389
|
+
|
4390
|
+
if directed == False:
|
4391
|
+
return Graph.AdjacentVertices(graph, vertex)
|
4392
|
+
incoming_edges = Graph.IncomingEdges(graph, vertex, directed=directed, tolerance=tolerance)
|
4393
|
+
incoming_vertices = []
|
4394
|
+
for edge in incoming_edges:
|
4395
|
+
sv = Edge.StartVertex(edge)
|
4396
|
+
incoming_vertices.append(Graph.NearestVertex(graph, sv))
|
4397
|
+
return incoming_vertices
|
4398
|
+
|
4318
4399
|
@staticmethod
|
4319
4400
|
def IsBipartite(graph, tolerance=0.0001):
|
4320
4401
|
"""
|
@@ -5142,7 +5223,144 @@ class Graph:
|
|
5142
5223
|
print("Graph.Order - Error: The input graph is not a valid graph. Returning None.")
|
5143
5224
|
return None
|
5144
5225
|
return len(Graph.Vertices(graph))
|
5226
|
+
|
5227
|
+
@staticmethod
|
5228
|
+
def OutgoingEdges(graph: topologic.Graph, vertex: topologic.Vertex, directed: bool=False, tolerance: float=0.0001) -> list:
|
5229
|
+
"""
|
5230
|
+
Returns the outgoing edges connected to a vertex. An edge is considered outgoing if its start vertex is
|
5231
|
+
coincident with the input vertex.
|
5232
|
+
|
5233
|
+
Parameters
|
5234
|
+
----------
|
5235
|
+
graph : topologic.Graph
|
5236
|
+
The input graph.
|
5237
|
+
vertex : topologic.Vertex
|
5238
|
+
The input vertex.
|
5239
|
+
directed : bool , optional
|
5240
|
+
If set to True, the graph is considered to be directed. Otherwise, it will be considered as an unidrected graph. The default is False.
|
5241
|
+
tolerance : float , optional
|
5242
|
+
The desired tolerance. The default is 0.0001.
|
5243
|
+
|
5244
|
+
Returns
|
5245
|
+
-------
|
5246
|
+
list
|
5247
|
+
The list of outgoing edges
|
5145
5248
|
|
5249
|
+
"""
|
5250
|
+
from topologicpy.Edge import Edge
|
5251
|
+
if not isinstance(graph, topologic.Graph):
|
5252
|
+
print("Graph.IncomingEdges - Error: The input graph parameter is not a valid graph. Returning None.")
|
5253
|
+
return None
|
5254
|
+
if not isinstance(vertex, topologic.Vertex):
|
5255
|
+
print("Graph.IncomingEdges - Error: The input vertex parameter is not a valid vertex. Returning None.")
|
5256
|
+
return None
|
5257
|
+
|
5258
|
+
edges = Graph.Edges(graph, [vertex])
|
5259
|
+
if directed == False:
|
5260
|
+
return edges
|
5261
|
+
outgoing_edges = []
|
5262
|
+
for edge in edges:
|
5263
|
+
sv = Edge.StartVertex(edge)
|
5264
|
+
if Vertex.Distance(vertex, sv) < tolerance:
|
5265
|
+
outgoing_edges.append(edge)
|
5266
|
+
return outgoing_edges
|
5267
|
+
|
5268
|
+
@staticmethod
|
5269
|
+
def OutgoingVertices(graph: topologic.Graph, vertex: topologic.Vertex, directed: bool=False, tolerance: float=0.0001) -> list:
|
5270
|
+
"""
|
5271
|
+
Returns the list of outgoing vertices connected to a vertex. A vertex is considered outgoing if it is an adjacent vertex to the input vertex
|
5272
|
+
and the the edge connecting it to the input vertex is an outgoing edge.
|
5273
|
+
|
5274
|
+
Parameters
|
5275
|
+
----------
|
5276
|
+
graph : topologic.Graph
|
5277
|
+
The input graph.
|
5278
|
+
vertex : topologic.Vertex
|
5279
|
+
The input vertex.
|
5280
|
+
directed : bool , optional
|
5281
|
+
If set to True, the graph is considered to be directed. Otherwise, it will be considered as an unidrected graph. The default is False.
|
5282
|
+
tolerance : float , optional
|
5283
|
+
The desired tolerance. The default is 0.0001.
|
5284
|
+
|
5285
|
+
Returns
|
5286
|
+
-------
|
5287
|
+
list
|
5288
|
+
The list of incoming vertices
|
5289
|
+
|
5290
|
+
"""
|
5291
|
+
from topologicpy.Edge import Edge
|
5292
|
+
if not isinstance(graph, topologic.Graph):
|
5293
|
+
print("Graph.OutgoingVertices - Error: The input graph parameter is not a valid graph. Returning None.")
|
5294
|
+
return None
|
5295
|
+
if not isinstance(vertex, topologic.Vertex):
|
5296
|
+
print("Graph.OutgoingVertices - Error: The input vertex parameter is not a valid vertex. Returning None.")
|
5297
|
+
return None
|
5298
|
+
|
5299
|
+
if directed == False:
|
5300
|
+
return Graph.AdjacentVertices(graph, vertex)
|
5301
|
+
outgoing_edges = Graph.OutgoingEdges(graph, vertex, directed=directed, tolerance=tolerance)
|
5302
|
+
outgoing_vertices = []
|
5303
|
+
for edge in outgoing_edges:
|
5304
|
+
ev = Edge.EndVertex(edge)
|
5305
|
+
outgoing_vertices.append(Graph.NearestVertex(graph, ev))
|
5306
|
+
return outgoing_vertices
|
5307
|
+
|
5308
|
+
@staticmethod
|
5309
|
+
def PageRank(graph, alpha=0.85, maxIterations=100, normalize=True, directed=False, mantissa=6, tolerance=0.0001):
|
5310
|
+
"""
|
5311
|
+
Calculates PageRank scores for nodes in a directed graph. see https://en.wikipedia.org/wiki/PageRank.
|
5312
|
+
|
5313
|
+
Parameters
|
5314
|
+
----------
|
5315
|
+
graph : topologic.Graph
|
5316
|
+
The input graph.
|
5317
|
+
alpha : float , optional
|
5318
|
+
The damping (dampening) factor. The default is 0.85. See https://en.wikipedia.org/wiki/PageRank.
|
5319
|
+
maxIterations : int , optional
|
5320
|
+
The maximum number of iterations to calculate the page rank. The default is 100.
|
5321
|
+
normalize : bool , optional
|
5322
|
+
If set to True, the results will be normalized from 0 to 1. Otherwise, they won't be. The default is True.
|
5323
|
+
directed : bool , optional
|
5324
|
+
If set to True, the graph is considered as a directed graph. Otherwise, it will be considered as an undirected graph. The default is False.
|
5325
|
+
mantissa : int , optional
|
5326
|
+
The desired length of the mantissa.
|
5327
|
+
tolerance : float , optional
|
5328
|
+
The desired tolerance. The default is 0.0001.
|
5329
|
+
|
5330
|
+
Returns
|
5331
|
+
-------
|
5332
|
+
list
|
5333
|
+
The list of page ranks for the vertices in the graph.
|
5334
|
+
"""
|
5335
|
+
from topologicpy.Helper import Helper
|
5336
|
+
|
5337
|
+
vertices = Graph.Vertices(graph)
|
5338
|
+
num_vertices = len(vertices)
|
5339
|
+
if num_vertices < 1:
|
5340
|
+
print("Graph.PageRank - Error: The input graph parameter has no vertices. Returning None")
|
5341
|
+
return None
|
5342
|
+
initial_score = 1.0 / num_vertices
|
5343
|
+
scores = [initial_score for vertex in vertices]
|
5344
|
+
for _ in range(maxIterations):
|
5345
|
+
new_scores = [0 for vertex in vertices]
|
5346
|
+
for i, vertex in enumerate(vertices):
|
5347
|
+
incoming_score = 0
|
5348
|
+
for incoming_vertex in Graph.IncomingVertices(graph, vertex, directed=directed):
|
5349
|
+
if len(Graph.IncomingVertices(graph, incoming_vertex, directed=directed)) > 0:
|
5350
|
+
incoming_score += scores[Vertex.Index(incoming_vertex, vertices)] / len(Graph.IncomingVertices(graph, incoming_vertex, directed=directed))
|
5351
|
+
new_scores[i] = alpha * incoming_score + (1 - alpha) / num_vertices
|
5352
|
+
|
5353
|
+
# Check for convergence
|
5354
|
+
if all(abs(new_scores[i] - scores[i]) < tolerance for i in range(len(vertices))):
|
5355
|
+
break
|
5356
|
+
|
5357
|
+
scores = new_scores
|
5358
|
+
if normalize == True:
|
5359
|
+
scores = Helper.Normalize(scores, mantissa=mantissa)
|
5360
|
+
else:
|
5361
|
+
scores = [round(x, mantissa) for x in scores]
|
5362
|
+
return scores
|
5363
|
+
|
5146
5364
|
@staticmethod
|
5147
5365
|
def Path(graph, vertexA, vertexB):
|
5148
5366
|
"""
|
@@ -5835,7 +6053,7 @@ class Graph:
|
|
5835
6053
|
return Graph.ByVerticesEdges(dictionary['vertices'], dictionary['edges'])
|
5836
6054
|
|
5837
6055
|
@staticmethod
|
5838
|
-
def VertexDegree(graph, vertex):
|
6056
|
+
def VertexDegree(graph : topologic.Graph, vertex: topologic.Vertex, edgeKey: str=None, tolerance: float=0.0001):
|
5839
6057
|
"""
|
5840
6058
|
Returns the degree of the input vertex. See https://en.wikipedia.org/wiki/Degree_(graph_theory).
|
5841
6059
|
|
@@ -5843,8 +6061,13 @@ class Graph:
|
|
5843
6061
|
----------
|
5844
6062
|
graph : topologic.Graph
|
5845
6063
|
The input graph.
|
5846
|
-
|
6064
|
+
vertex : topologic.Vertex
|
5847
6065
|
The input vertex.
|
6066
|
+
edgeKey : str , optional
|
6067
|
+
If specified, the value in the connected edges' dictionary specified by the edgeKey string will be aggregated to calculate
|
6068
|
+
the vertex degree. If a numeric value cannot be retrieved from an edge, a value of 1 is used instead. This is used in weighted graphs.
|
6069
|
+
tolerance : float , optional
|
6070
|
+
The desired tolerance. The default is 0.0001.
|
5848
6071
|
|
5849
6072
|
Returns
|
5850
6073
|
-------
|
@@ -5852,13 +6075,28 @@ class Graph:
|
|
5852
6075
|
The degree of the input vertex.
|
5853
6076
|
|
5854
6077
|
"""
|
6078
|
+
from topologicpy.Topology import Topology
|
6079
|
+
from topologicpy.Dictionary import Dictionary
|
6080
|
+
import numbers
|
6081
|
+
|
5855
6082
|
if not isinstance(graph, topologic.Graph):
|
5856
6083
|
print("Graph.VertexDegree - Error: The input graph is not a valid graph. Returning None.")
|
5857
6084
|
return None
|
5858
6085
|
if not isinstance(vertex, topologic.Vertex):
|
5859
6086
|
print("Graph.VertexDegree - Error: The input vertex is not a valid vertex. Returning None.")
|
5860
6087
|
return None
|
5861
|
-
|
6088
|
+
if not isinstance(edgeKey, str):
|
6089
|
+
edgeKey = ""
|
6090
|
+
edges = Graph.Edges(graph, [vertex], tolerance=tolerance)
|
6091
|
+
degree = 0
|
6092
|
+
for edge in edges:
|
6093
|
+
d = Topology.Dictionary(edge)
|
6094
|
+
value = Dictionary.ValueAtKey(d, edgeKey)
|
6095
|
+
if isinstance(value, numbers.Number):
|
6096
|
+
degree += value
|
6097
|
+
else:
|
6098
|
+
degree += 1
|
6099
|
+
return degree
|
5862
6100
|
|
5863
6101
|
@staticmethod
|
5864
6102
|
def Vertices(graph):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: topologicpy
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.83
|
4
4
|
Summary: An Advanced Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
|
5
5
|
Author-email: Wassim Jabi <wassim.jabi@gmail.com>
|
6
6
|
Project-URL: Homepage, https://github.com/wassimj/TopologicPy
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/linux/topologic/libgcc_s-32c1665e.so.1
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKBO-f6b191de.dll
RENAMED
File without changes
|
{topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKBRep-e56a600e.dll
RENAMED
File without changes
|
{topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKBool-7b8d47ae.dll
RENAMED
File without changes
|
File without changes
|
{topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKG2d-2e2dee3d.dll
RENAMED
File without changes
|
{topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKG3d-6674513d.dll
RENAMED
File without changes
|
File without changes
|
File without changes
|
{topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKMath-45bd625a.dll
RENAMED
File without changes
|
{topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKMesh-d6e826b1.dll
RENAMED
File without changes
|
File without changes
|
{topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKPrim-aa430a86.dll
RENAMED
File without changes
|
File without changes
|
File without changes
|
{topologicpy-0.4.81 → topologicpy-0.4.83}/src/topologicpy/bin/windows/topologic/TKernel-08c8cfbb.dll
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|