topologicpy 0.7.87__py3-none-any.whl → 0.7.91__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/Cell.py +7 -3
- topologicpy/Face.py +175 -18
- topologicpy/Graph.py +765 -114
- topologicpy/Plotly.py +43 -22
- topologicpy/Topology.py +19 -16
- topologicpy/version.py +1 -1
- {topologicpy-0.7.87.dist-info → topologicpy-0.7.91.dist-info}/METADATA +1 -1
- {topologicpy-0.7.87.dist-info → topologicpy-0.7.91.dist-info}/RECORD +11 -11
- {topologicpy-0.7.87.dist-info → topologicpy-0.7.91.dist-info}/LICENSE +0 -0
- {topologicpy-0.7.87.dist-info → topologicpy-0.7.91.dist-info}/WHEEL +0 -0
- {topologicpy-0.7.87.dist-info → topologicpy-0.7.91.dist-info}/top_level.txt +0 -0
topologicpy/Plotly.py
CHANGED
@@ -411,29 +411,46 @@ class Plotly:
|
|
411
411
|
|
412
412
|
if showVertices:
|
413
413
|
vertices = Graph.Vertices(graph)
|
414
|
-
|
414
|
+
v_dictionaries = [Topology.Dictionary(v) for v in vertices]
|
415
415
|
e_cluster = Cluster.ByTopologies(vertices)
|
416
416
|
geo = Topology.Geometry(e_cluster, mantissa=mantissa)
|
417
417
|
vertices = geo['vertices']
|
418
418
|
if len(vertices) > 0:
|
419
|
-
v_data = Plotly.
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
419
|
+
v_data = Plotly.vertexData(vertices,
|
420
|
+
dictionaries=v_dictionaries,
|
421
|
+
color=vertexColor,
|
422
|
+
colorKey=vertexColorKey,
|
423
|
+
size=vertexSize,
|
424
|
+
sizeKey=vertexSizeKey,
|
425
|
+
labelKey=vertexLabelKey,
|
426
|
+
showVertexLabel=showVertexLabel,
|
427
|
+
groupKey=vertexGroupKey,
|
428
|
+
minGroup=vertexMinGroup,
|
429
|
+
maxGroup=vertexMaxGroup,
|
430
|
+
groups=vertexGroups,
|
431
|
+
legendLabel=vertexLegendLabel,
|
432
|
+
legendGroup=vertexLegendGroup,
|
433
|
+
legendRank=vertexLegendRank,
|
434
|
+
showLegend=showVertexLegend,
|
435
|
+
colorScale=colorScale)
|
436
|
+
|
437
|
+
# v_data = Plotly.DataByTopology(e_cluster,
|
438
|
+
# vertexColor=vertexColor,
|
439
|
+
# vertexColorKey=vertexColorKey,
|
440
|
+
# vertexSize=vertexSize,
|
441
|
+
# vertexSizeKey=vertexSizeKey,
|
442
|
+
# vertexLabelKey=vertexLabelKey,
|
443
|
+
# showVertexLabel=showVertexLabel,
|
444
|
+
# vertexGroupKey=vertexGroupKey,
|
445
|
+
# vertexMinGroup=vertexMinGroup,
|
446
|
+
# vertexMaxGroup=vertexMaxGroup,
|
447
|
+
# vertexGroups=vertexGroups,
|
448
|
+
# showVertexLegend=showVertexLegend,
|
449
|
+
# vertexLegendLabel=vertexLegendLabel,
|
450
|
+
# vertexLegendGroup=vertexLegendGroup,
|
451
|
+
# vertexLegendRank=vertexLegendRank,
|
452
|
+
# colorScale=colorScale)
|
453
|
+
data += [v_data]
|
437
454
|
|
438
455
|
if showEdges:
|
439
456
|
e_dictionaries = []
|
@@ -501,7 +518,7 @@ class Plotly:
|
|
501
518
|
z.append(v[2])
|
502
519
|
colors.append(Color.AnyToHex(color))
|
503
520
|
labels.append("Vertex_"+str(m+1).zfill(n))
|
504
|
-
sizes.append(size)
|
521
|
+
sizes.append(max(size, 1.1))
|
505
522
|
if len(dictionaries) > 0:
|
506
523
|
d = dictionaries[m]
|
507
524
|
if d:
|
@@ -512,7 +529,11 @@ class Plotly:
|
|
512
529
|
if not labelKey == None:
|
513
530
|
labels[m] = str(Dictionary.ValueAtKey(d, key=labelKey)) or labels[m]
|
514
531
|
if not sizeKey == None:
|
515
|
-
sizes[m] = Dictionary.ValueAtKey(d, key=sizeKey)
|
532
|
+
sizes[m] = Dictionary.ValueAtKey(d, key=sizeKey)
|
533
|
+
if sizes[m] == None:
|
534
|
+
sizes[m] = size
|
535
|
+
if sizes[m] <= 0:
|
536
|
+
sizes[m] = 1.1
|
516
537
|
if not groupKey == None:
|
517
538
|
c_value = Dictionary.ValueAtKey(d, key=groupKey)
|
518
539
|
if not c_value == None:
|
@@ -540,7 +561,7 @@ class Plotly:
|
|
540
561
|
if len(labels) < 1:
|
541
562
|
labels = "Vertex_1"
|
542
563
|
if len(sizes) < 1:
|
543
|
-
sizes = size
|
564
|
+
sizes = [size]*len(x)
|
544
565
|
if showVertexLabel == True:
|
545
566
|
mode = "markers+text"
|
546
567
|
else:
|
topologicpy/Topology.py
CHANGED
@@ -6240,7 +6240,7 @@ class Topology():
|
|
6240
6240
|
return Topology.Type(topology)
|
6241
6241
|
|
6242
6242
|
@staticmethod
|
6243
|
-
def _InternalVertex(topology, tolerance: float = 0.0001):
|
6243
|
+
def _InternalVertex(topology, tolerance: float = 0.0001, silent: bool = False):
|
6244
6244
|
"""
|
6245
6245
|
Returns a vertex guaranteed to be inside the input topology.
|
6246
6246
|
|
@@ -6250,6 +6250,8 @@ class Topology():
|
|
6250
6250
|
The input topology.
|
6251
6251
|
tolerance : float , ptional
|
6252
6252
|
The desired tolerance. The default is 0.0001.
|
6253
|
+
silent : bool , optional
|
6254
|
+
If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
|
6253
6255
|
|
6254
6256
|
Returns
|
6255
6257
|
-------
|
@@ -6271,20 +6273,20 @@ class Topology():
|
|
6271
6273
|
top = Topology.Copy(topology)
|
6272
6274
|
if Topology.IsInstance(top, "CellComplex"): #CellComplex
|
6273
6275
|
tempCell = Topology.Cells(top)[0]
|
6274
|
-
vst = Cell.InternalVertex(tempCell, tolerance=tolerance)
|
6276
|
+
vst = Cell.InternalVertex(tempCell, tolerance=tolerance, silent=silent)
|
6275
6277
|
elif Topology.IsInstance(top, "Cell"): #Cell
|
6276
|
-
vst = Cell.InternalVertex(top, tolerance=tolerance)
|
6278
|
+
vst = Cell.InternalVertex(top, tolerance=tolerance, silent=silent)
|
6277
6279
|
elif Topology.IsInstance(top, "Shell"): #Shell
|
6278
6280
|
tempFace = Topology.Faces(top)[0]
|
6279
|
-
vst = Face.InternalVertex(tempFace, tolerance=tolerance)
|
6281
|
+
vst = Face.InternalVertex(tempFace, tolerance=tolerance, silent=silent)
|
6280
6282
|
elif Topology.IsInstance(top, "Face"): #Face
|
6281
|
-
vst = Face.InternalVertex(top, tolerance=tolerance)
|
6283
|
+
vst = Face.InternalVertex(top, tolerance=tolerance, silent=silent)
|
6282
6284
|
elif Topology.IsInstance(top, "Wire"): #Wire
|
6283
6285
|
if top.IsClosed():
|
6284
6286
|
internalBoundaries = []
|
6285
6287
|
try:
|
6286
6288
|
tempFace = topologic.Face.ByExternalInternalBoundaries(top, internalBoundaries)
|
6287
|
-
vst = Face.InternalVertex(tempFace, tolerance=tolerance)
|
6289
|
+
vst = Face.InternalVertex(tempFace, tolerance=tolerance, silent=silent)
|
6288
6290
|
except:
|
6289
6291
|
vst = Topology.Centroid(top)
|
6290
6292
|
else:
|
@@ -6295,7 +6297,7 @@ class Topology():
|
|
6295
6297
|
elif Topology.IsInstance(top, "Vertex"): #Vertex
|
6296
6298
|
vst = top
|
6297
6299
|
elif Topology.IsInstance(topology, "Aperture"): #Aperture
|
6298
|
-
vst = Face.InternalVertex(Aperture.Topology(top), tolerance=tolerance)
|
6300
|
+
vst = Face.InternalVertex(Aperture.Topology(top), tolerance=tolerance, silent=silent)
|
6299
6301
|
else:
|
6300
6302
|
vst = Topology.Centroid(top)
|
6301
6303
|
return vst
|
@@ -6303,7 +6305,7 @@ class Topology():
|
|
6303
6305
|
|
6304
6306
|
|
6305
6307
|
@staticmethod
|
6306
|
-
def InternalVertex(topology, timeout: int =
|
6308
|
+
def InternalVertex(topology, timeout: int = 30, tolerance: float = 0.0001, silent: bool = False):
|
6307
6309
|
"""
|
6308
6310
|
Returns a vertex guaranteed to be inside the input topology.
|
6309
6311
|
|
@@ -6312,9 +6314,11 @@ class Topology():
|
|
6312
6314
|
topology : topologic_core.Topology
|
6313
6315
|
The input topology.
|
6314
6316
|
timeout : int , optional
|
6315
|
-
The amount of seconds to wait before timing out. The default is
|
6317
|
+
The amount of seconds to wait before timing out. The default is 30 seconds.
|
6316
6318
|
tolerance : float , ptional
|
6317
6319
|
The desired tolerance. The default is 0.0001.
|
6320
|
+
silent : bool , optional
|
6321
|
+
If set to True, no error and warning messages are printed. Otherwise, they are. The default is False.
|
6318
6322
|
|
6319
6323
|
Returns
|
6320
6324
|
-------
|
@@ -6325,22 +6329,21 @@ class Topology():
|
|
6325
6329
|
import concurrent.futures
|
6326
6330
|
import time
|
6327
6331
|
# Wrapper function with timeout
|
6328
|
-
def run_with_timeout(func, topology, tolerance=0.0001, timeout=10):
|
6332
|
+
def run_with_timeout(func, topology, tolerance=0.0001, silent=False, timeout=10):
|
6329
6333
|
with concurrent.futures.ThreadPoolExecutor() as executor:
|
6330
|
-
future = executor.submit(func, topology, tolerance=tolerance)
|
6334
|
+
future = executor.submit(func, topology, tolerance=tolerance, silent=silent)
|
6331
6335
|
try:
|
6332
6336
|
result = future.result(timeout=timeout) # Wait for the result with a timeout
|
6333
6337
|
return result
|
6334
6338
|
except concurrent.futures.TimeoutError:
|
6335
|
-
print("Function took too long, retrying with a different solution.")
|
6336
6339
|
return None # or try another approach here
|
6337
6340
|
|
6338
|
-
result = run_with_timeout(Topology._InternalVertex, topology=topology, tolerance=tolerance, timeout=timeout) # Set a 10 second timeout
|
6341
|
+
result = run_with_timeout(Topology._InternalVertex, topology=topology, tolerance=tolerance, silent=silent, timeout=timeout) # Set a 10 second timeout
|
6339
6342
|
if result is None:
|
6340
6343
|
# Handle failure case (e.g., try a different solution)
|
6341
|
-
|
6342
|
-
|
6343
|
-
|
6344
|
+
if not silent:
|
6345
|
+
print("Topology.InternalVertex - Warning: Operation took too long. Returning None")
|
6346
|
+
return None
|
6344
6347
|
return result
|
6345
6348
|
|
6346
6349
|
@staticmethod
|
topologicpy/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '0.7.
|
1
|
+
__version__ = '0.7.91'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: topologicpy
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.91
|
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
|
@@ -1,7 +1,7 @@
|
|
1
1
|
topologicpy/ANN.py,sha256=m_WxD1lgQqDhUpaM20Lia6TmJACDYaAE96wigsi-99U,47932
|
2
2
|
topologicpy/Aperture.py,sha256=p9pUzTQSBWoUaDiug1V1R1hnEIEwYSXFg2t7iRAmNRY,2723
|
3
3
|
topologicpy/BVH.py,sha256=mKVCAu9K8qzcWXtPDVH5usXZV1DNNNJl4n3rU5Lh1ZM,12931
|
4
|
-
topologicpy/Cell.py,sha256=
|
4
|
+
topologicpy/Cell.py,sha256=Fdqf2GCWfKe50EecBVcB8PCHKWENRUTTH8yPrOSF3-0,108321
|
5
5
|
topologicpy/CellComplex.py,sha256=ncjfvJ2QJzz4Fu8BMaQBLxAQ6WHx6HfUCddaLP8kXsc,51480
|
6
6
|
topologicpy/Cluster.py,sha256=__PvNVjRnFfy12aawd7HSrb3UBX3Rtd1iWSSQnPGpfk,55768
|
7
7
|
topologicpy/Color.py,sha256=q9xsGmxFMz7sQKmygwSVS12GaTRB-OT0-_i6t3-cthE,20307
|
@@ -10,27 +10,27 @@ topologicpy/DGL.py,sha256=Dd6O08D-vSxpjHYgKm45JpKiaeGvWlg1BRMzYMAXGNc,138991
|
|
10
10
|
topologicpy/Dictionary.py,sha256=t0O7Du-iPq46FyKqZfcjHfsUK1E8GS_e67R2V5cpkbw,33186
|
11
11
|
topologicpy/Edge.py,sha256=KWOJCkLDwCWyZJ5MKwDhT5umWwCYBHtLOz6ulHrSOfY,67205
|
12
12
|
topologicpy/EnergyModel.py,sha256=AqTtmXE35SxvRXhG3vYAQd7GQDW-6HtjYPHua6ME4Eg,53762
|
13
|
-
topologicpy/Face.py,sha256=
|
14
|
-
topologicpy/Graph.py,sha256=
|
13
|
+
topologicpy/Face.py,sha256=2k1vSRK1M-s588RcqGHEalwIHJ9nT3qgx3pU4ktN0dU,150077
|
14
|
+
topologicpy/Graph.py,sha256=Qm0V17oeIlhr62faoYqJpNUMzAB5d0F-3zes4jCtRi8,460350
|
15
15
|
topologicpy/Grid.py,sha256=2s9cSlWldivn1i9EUz4OOokJyANveqmRe_vR93CAndI,18245
|
16
16
|
topologicpy/Helper.py,sha256=F3h4_qcOD_PHAoVe0tEbEE7_jYyVcaHjtwVs4QHOZuI,23978
|
17
17
|
topologicpy/Honeybee.py,sha256=HfTaEV1R8K1xOVQQy9sBOhBTF_ap8A2RxZOYhirp_Mw,21835
|
18
18
|
topologicpy/Matrix.py,sha256=umgR7An919-wGInXJ1wpqnoQ2jCPdyMe2rcWTZ16upk,8079
|
19
19
|
topologicpy/Neo4j.py,sha256=t52hgE9cVsqkGc7m7fjRsLnyfRHakVHwdvF4ms7ow78,22342
|
20
|
-
topologicpy/Plotly.py,sha256=
|
20
|
+
topologicpy/Plotly.py,sha256=Tvo0_zKVEHtPhsMNNvLy5G0HIys5FPAOyp_o4QN_I_A,115760
|
21
21
|
topologicpy/Polyskel.py,sha256=EFsuh2EwQJGPLiFUjvtXmAwdX-A4r_DxP5hF7Qd3PaU,19829
|
22
22
|
topologicpy/PyG.py,sha256=LU9LCCzjxGPUM31qbaJXZsTvniTtgugxJY7y612t4A4,109757
|
23
23
|
topologicpy/Shell.py,sha256=UdDz3zfIYmGRjoZIseviJ2cXNtR5Kx5tIsZLhWMyO_U,87906
|
24
24
|
topologicpy/Speckle.py,sha256=AlsGlSDuKRtX5jhVsPNSSjjbZis079HbUchDH_5RJmE,18187
|
25
25
|
topologicpy/Sun.py,sha256=42tDWMYpwRG7Z2Qjtp94eRgBuqySq7k8TgNUZDK7QxQ,36837
|
26
|
-
topologicpy/Topology.py,sha256=
|
26
|
+
topologicpy/Topology.py,sha256=d99wryPPXvw7eRw12GVKV-DT6jhlmVq6GsMAjg-E-40,441693
|
27
27
|
topologicpy/Vector.py,sha256=A1g83zDHep58iVPY8WQ8iHNrSOfGWFEzvVeDuMnjDNY,33078
|
28
28
|
topologicpy/Vertex.py,sha256=sYWTbAHqKGRUAJRCIUqrCO_xFhvsXK09Sx7E4dafPLQ,73754
|
29
29
|
topologicpy/Wire.py,sha256=HjagWKoJb8Z3zhgOij_4k6ZnKIl5gk8LletHbsT1ZKU,190632
|
30
30
|
topologicpy/__init__.py,sha256=vlPCanUbxe5NifC4pHcnhSzkmmYcs_UrZrTlVMsxcFs,928
|
31
|
-
topologicpy/version.py,sha256=
|
32
|
-
topologicpy-0.7.
|
33
|
-
topologicpy-0.7.
|
34
|
-
topologicpy-0.7.
|
35
|
-
topologicpy-0.7.
|
36
|
-
topologicpy-0.7.
|
31
|
+
topologicpy/version.py,sha256=em3O4PG8JKL9957EgCcS5zUXOhgyMhAa6bmjZHQ7UmE,23
|
32
|
+
topologicpy-0.7.91.dist-info/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
|
33
|
+
topologicpy-0.7.91.dist-info/METADATA,sha256=m96FnumZC4Hy2QqaPuRryOZron2mQdjkGJvv5HJs3kM,10513
|
34
|
+
topologicpy-0.7.91.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
35
|
+
topologicpy-0.7.91.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
|
36
|
+
topologicpy-0.7.91.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|