topologicpy 0.8.12__py3-none-any.whl → 0.8.13__py3-none-any.whl
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/Graph.py +7 -7
- topologicpy/version.py +1 -1
- {topologicpy-0.8.12.dist-info → topologicpy-0.8.13.dist-info}/METADATA +1 -1
- {topologicpy-0.8.12.dist-info → topologicpy-0.8.13.dist-info}/RECORD +7 -7
- {topologicpy-0.8.12.dist-info → topologicpy-0.8.13.dist-info}/LICENSE +0 -0
- {topologicpy-0.8.12.dist-info → topologicpy-0.8.13.dist-info}/WHEEL +0 -0
- {topologicpy-0.8.12.dist-info → topologicpy-0.8.13.dist-info}/top_level.txt +0 -0
topologicpy/Graph.py
CHANGED
@@ -1358,7 +1358,7 @@ class Graph:
|
|
1358
1358
|
return bot_graph.serialize(format=format)
|
1359
1359
|
|
1360
1360
|
@staticmethod
|
1361
|
-
def BetweennessCentrality(graph, method: str = "vertex", weightKey="length", normalize: bool = False,
|
1361
|
+
def BetweennessCentrality(graph, method: str = "vertex", weightKey="length", normalize: bool = False, nxCompatible: bool = False, key: str = "betweenness_centrality", colorKey="bc_color", colorScale="viridis", mantissa: int = 6, tolerance: float = 0.001, silent: bool = False):
|
1362
1362
|
"""
|
1363
1363
|
Returns the betweenness centrality of the input graph. The order of the returned list is the same as the order of vertices/edges. See https://en.wikipedia.org/wiki/Betweenness_centrality.
|
1364
1364
|
|
@@ -1374,7 +1374,7 @@ class Graph:
|
|
1374
1374
|
This is used in weighted graphs. if weightKey is set to "Length" or "Distance", the length of the edge will be used as its weight.
|
1375
1375
|
normalize : bool , optional
|
1376
1376
|
If set to True, the values are normalized to be in the range 0 to 1. Otherwise they are not. The default is False.
|
1377
|
-
|
1377
|
+
nxCompatible : bool , optional
|
1378
1378
|
If set to True, and normalize input parameter is also set to True, the values are set to be identical to NetworkX values. Otherwise, they are normalized between 0 and 1. The default is False.
|
1379
1379
|
key : str , optional
|
1380
1380
|
The desired dictionary key under which to store the betweenness centrality score. The default is "betweenness_centrality".
|
@@ -1423,12 +1423,12 @@ class Graph:
|
|
1423
1423
|
if "vert" in method.lower():
|
1424
1424
|
elements = Graph.Vertices(graph)
|
1425
1425
|
elements_dict = nx.betweenness_centrality(nx_graph, normalized=normalize, weight=weightKey)
|
1426
|
-
values = list(elements_dict.values())
|
1426
|
+
values = [round(value, mantissa) for value in list(elements_dict.values())]
|
1427
1427
|
else:
|
1428
1428
|
elements = Graph.Edges(graph)
|
1429
1429
|
elements_dict = nx.edge_betweenness_centrality(nx_graph, normalized=normalize, weight=weightKey)
|
1430
1430
|
values = [round(value, mantissa) for value in list(elements_dict.values())]
|
1431
|
-
if
|
1431
|
+
if nxCompatible == False:
|
1432
1432
|
if mantissa > 0: # We cannot have values in the range 0 to 1 with a mantissa < 1
|
1433
1433
|
values = [round(v, mantissa) for v in Helper.Normalize(values)]
|
1434
1434
|
else:
|
@@ -4686,7 +4686,7 @@ class Graph:
|
|
4686
4686
|
return graph
|
4687
4687
|
|
4688
4688
|
@staticmethod
|
4689
|
-
def ClosenessCentrality(graph, weightKey="length", normalize: bool = False,
|
4689
|
+
def ClosenessCentrality(graph, weightKey="length", normalize: bool = False, nxCompatible: bool = True, key: str = "closeness_centrality", colorKey="cc_color", colorScale="viridis", mantissa: int = 6, tolerance: float = 0.001, silent: bool = False):
|
4690
4690
|
"""
|
4691
4691
|
Returns the closeness centrality of the input graph. The order of the returned list is the same as the order of vertices/edges. See https://en.wikipedia.org/wiki/Betweenness_centrality.
|
4692
4692
|
|
@@ -4700,7 +4700,7 @@ class Graph:
|
|
4700
4700
|
This is used in weighted graphs. if weightKey is set to "Length" or "Distance", the length of the edge will be used as its weight.
|
4701
4701
|
normalize : bool , optional
|
4702
4702
|
If set to True, the values are normalized to be in the range 0 to 1. Otherwise they are not. The default is False.
|
4703
|
-
|
4703
|
+
nxCompatible : bool , optional
|
4704
4704
|
If set to True, use networkX to scale by the fraction of nodes reachable. This gives the Wasserman and Faust improved formula.
|
4705
4705
|
For single component graphs it is the same as the original formula.
|
4706
4706
|
key : str , optional
|
@@ -4753,7 +4753,7 @@ class Graph:
|
|
4753
4753
|
weightKey = "length"
|
4754
4754
|
nx_graph = Graph.NetworkXGraph(graph)
|
4755
4755
|
elements = Graph.Vertices(graph)
|
4756
|
-
elements_dict = nx.closeness_centrality(nx_graph, distance=weightKey, wf_improved=
|
4756
|
+
elements_dict = nx.closeness_centrality(nx_graph, distance=weightKey, wf_improved=nxCompatible)
|
4757
4757
|
values = [round(v, mantissa) for v in list(elements_dict.values())]
|
4758
4758
|
if normalize == True:
|
4759
4759
|
if mantissa > 0: # We cannot round numbers from 0 to 1 with a mantissa = 0.
|
topologicpy/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '0.8.
|
1
|
+
__version__ = '0.8.13'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: topologicpy
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.13
|
4
4
|
Summary: An AI-Powered Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
|
5
5
|
Author-email: Wassim Jabi <wassim.jabi@gmail.com>
|
6
6
|
License: AGPL v3 License
|
@@ -11,7 +11,7 @@ topologicpy/Dictionary.py,sha256=t0O7Du-iPq46FyKqZfcjHfsUK1E8GS_e67R2V5cpkbw,331
|
|
11
11
|
topologicpy/Edge.py,sha256=yxkCVDYBflJNEYxnjMmlyvbkpg8TNy7y5bSH3yQ4jzs,71418
|
12
12
|
topologicpy/EnergyModel.py,sha256=UoQ9Jm-hYsN383CbcLKw-y6BKitRHj0uyh84yQ-8ACg,53856
|
13
13
|
topologicpy/Face.py,sha256=tn3PI-t9rXikgI1QMclw0PFwQ5vvyLi-wJKqZZZ9xmw,182755
|
14
|
-
topologicpy/Graph.py,sha256=
|
14
|
+
topologicpy/Graph.py,sha256=FBmiMObzztPwZFJ2T846Ivz0Y1kpzMF0sF-PDUMPk4o,498946
|
15
15
|
topologicpy/Grid.py,sha256=2s9cSlWldivn1i9EUz4OOokJyANveqmRe_vR93CAndI,18245
|
16
16
|
topologicpy/Helper.py,sha256=4H5KPiv_eiEs489UOOyGLe9RaeoZIfmMh3mk_YCHmXg,29100
|
17
17
|
topologicpy/Honeybee.py,sha256=Y_El6M8x3ixvvIe_VcRiwj_4C89ZZg5_WlT7adbCkpw,21849
|
@@ -28,9 +28,9 @@ topologicpy/Vector.py,sha256=GkGt-aJ591IJ2IPffMAudvITLDPi2qZibZc4UAav6m8,42407
|
|
28
28
|
topologicpy/Vertex.py,sha256=xr8KSgKnx-hgVp-eIvMPAKRv04R-wk-_4zc57xVyEqE,80793
|
29
29
|
topologicpy/Wire.py,sha256=x7tOeR1o5qi5cXp_d9JrQrSXfYztCWiBC1OnVl6Yp7A,228463
|
30
30
|
topologicpy/__init__.py,sha256=vlPCanUbxe5NifC4pHcnhSzkmmYcs_UrZrTlVMsxcFs,928
|
31
|
-
topologicpy/version.py,sha256=
|
32
|
-
topologicpy-0.8.
|
33
|
-
topologicpy-0.8.
|
34
|
-
topologicpy-0.8.
|
35
|
-
topologicpy-0.8.
|
36
|
-
topologicpy-0.8.
|
31
|
+
topologicpy/version.py,sha256=XjaqL6H5ZzfJyu62UXI4UhwezcxfWWIh4nGQ9YuybtM,23
|
32
|
+
topologicpy-0.8.13.dist-info/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
|
33
|
+
topologicpy-0.8.13.dist-info/METADATA,sha256=5SZpCgIN0s9DGq8P0heNOhibtizlRvUZIb2fP0gJAtE,10513
|
34
|
+
topologicpy-0.8.13.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
35
|
+
topologicpy-0.8.13.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
|
36
|
+
topologicpy-0.8.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|