topologicpy 0.8.58__py3-none-any.whl → 0.8.61__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 +5 -2
- topologicpy/Graph.py +1937 -660
- topologicpy/Kuzu.py +1 -1
- topologicpy/Plotly.py +9 -7
- topologicpy/Topology.py +51 -26
- topologicpy/version.py +1 -1
- {topologicpy-0.8.58.dist-info → topologicpy-0.8.61.dist-info}/METADATA +1 -1
- {topologicpy-0.8.58.dist-info → topologicpy-0.8.61.dist-info}/RECORD +11 -11
- {topologicpy-0.8.58.dist-info → topologicpy-0.8.61.dist-info}/WHEEL +0 -0
- {topologicpy-0.8.58.dist-info → topologicpy-0.8.61.dist-info}/licenses/LICENSE +0 -0
- {topologicpy-0.8.58.dist-info → topologicpy-0.8.61.dist-info}/top_level.txt +0 -0
topologicpy/Kuzu.py
CHANGED
topologicpy/Plotly.py
CHANGED
@@ -286,7 +286,7 @@ class Plotly:
|
|
286
286
|
vertexSizeKey: str = None,
|
287
287
|
vertexLabelKey: str = None,
|
288
288
|
vertexBorderColor: str = "black",
|
289
|
-
vertexBorderWidth: float =
|
289
|
+
vertexBorderWidth: float = 0,
|
290
290
|
vertexBorderColorKey: str = None,
|
291
291
|
vertexBorderWidthKey: float = None,
|
292
292
|
vertexGroupKey: str = None,
|
@@ -570,7 +570,7 @@ class Plotly:
|
|
570
570
|
if not temp_color == None:
|
571
571
|
borderColors[m] = Color.AnyToHex(temp_color)
|
572
572
|
if not borderWidthKey == None:
|
573
|
-
temp_width = Dictionary.ValueAtKey(d, key=borderWidthKey)
|
573
|
+
temp_width = Dictionary.ValueAtKey(d, key=borderWidthKey, defaultValue=borderWidth)
|
574
574
|
if temp_width == None or temp_width <= 0:
|
575
575
|
borderSizes[m] = 0
|
576
576
|
else:
|
@@ -615,8 +615,9 @@ class Plotly:
|
|
615
615
|
showlegend=showLegend,
|
616
616
|
marker=dict(color=colors,
|
617
617
|
size=sizes,
|
618
|
-
symbol="circle",
|
618
|
+
symbol="circle",
|
619
619
|
opacity=1,
|
620
|
+
line=dict(width=0),
|
620
621
|
sizemode="diameter"),
|
621
622
|
mode=mode,
|
622
623
|
customdata = labels,
|
@@ -637,6 +638,7 @@ class Plotly:
|
|
637
638
|
size=borderSizes,
|
638
639
|
symbol="circle",
|
639
640
|
opacity=1,
|
641
|
+
line=dict(width=0),
|
640
642
|
sizemode="diameter"),
|
641
643
|
mode=mode
|
642
644
|
)
|
@@ -748,11 +750,11 @@ class Plotly:
|
|
748
750
|
d = dict_clusters[j][0] # All dicitonaries have same values in dictionaries, so take first one.
|
749
751
|
if d:
|
750
752
|
if not colorKey == None:
|
751
|
-
d_color = Color.AnyToHex(Dictionary.ValueAtKey(d, key=colorKey,
|
753
|
+
d_color = Color.AnyToHex(Dictionary.ValueAtKey(d, key=colorKey, defaultValue=color))
|
752
754
|
if not dashKey == None:
|
753
|
-
d_dash = Dictionary.ValueAtKey(d, key=dashKey,
|
755
|
+
d_dash = Dictionary.ValueAtKey(d, key=dashKey, defaultValue=dash)
|
754
756
|
if not arrowSizeKey == None:
|
755
|
-
d_arrowSize = Dictionary.ValueAtKey(d, key=arrowSizeKey,
|
757
|
+
d_arrowSize = Dictionary.ValueAtKey(d, key=arrowSizeKey, defaultValue=arrowSize)
|
756
758
|
if not labelKey == None:
|
757
759
|
labels.append(str(Dictionary.ValueAtKey(d, labelKey, "")))
|
758
760
|
if not widthKey == None:
|
@@ -927,7 +929,7 @@ class Plotly:
|
|
927
929
|
vertexColorKey : str , optional
|
928
930
|
The dictionary key under which to find the vertex color.The default is None.
|
929
931
|
vertexBorderWidth : float , optional
|
930
|
-
The desired width of the border of the output vertices. Default is
|
932
|
+
The desired width of the border of the output vertices. Default is 0.
|
931
933
|
vertexBorderColor : str , optional
|
932
934
|
The desired color of the border of the output vertices. This can be any plotly color string and may be specified as:
|
933
935
|
- A hex string (e.g. '#ff0000')
|
topologicpy/Topology.py
CHANGED
@@ -1994,6 +1994,7 @@ class Topology():
|
|
1994
1994
|
return
|
1995
1995
|
|
1996
1996
|
def convert_entity(entity, file, sides=36):
|
1997
|
+
e = None
|
1997
1998
|
entity_type = entity.dxftype()
|
1998
1999
|
python_dict = entity.dxf.all_existing_dxf_attribs()
|
1999
2000
|
keys = python_dict.keys()
|
@@ -2389,7 +2390,7 @@ class Topology():
|
|
2389
2390
|
return topology
|
2390
2391
|
'''
|
2391
2392
|
@staticmethod
|
2392
|
-
def ByJSONFile(file, tolerance=0.0001):
|
2393
|
+
def ByJSONFile(file, tolerance: float = 0.0001, silent: bool = False):
|
2393
2394
|
"""
|
2394
2395
|
Imports the topology from a JSON file.
|
2395
2396
|
|
@@ -2399,6 +2400,8 @@ class Topology():
|
|
2399
2400
|
The input JSON file.
|
2400
2401
|
tolerance : float , optional
|
2401
2402
|
The desired tolerance. Default is 0.0001.
|
2403
|
+
silent : bool , optional
|
2404
|
+
If set to True, error and warning messages are suppressed. Default is False.
|
2402
2405
|
|
2403
2406
|
Returns
|
2404
2407
|
-------
|
@@ -2406,14 +2409,21 @@ class Topology():
|
|
2406
2409
|
The list of imported topologies (Warning: the list could contain 0, 1, or many topologies, but this method will always return a list)
|
2407
2410
|
|
2408
2411
|
"""
|
2412
|
+
import json
|
2409
2413
|
if not file:
|
2410
|
-
|
2414
|
+
if not silent:
|
2415
|
+
print("Topology.ByJSONFile - Error: the input file parameter is not a valid file. Returning None.")
|
2416
|
+
return None
|
2417
|
+
try:
|
2418
|
+
json_dict = json.load(file)
|
2419
|
+
except Exception as e:
|
2420
|
+
if not silent:
|
2421
|
+
print("Topology.ByJSONFile - Error: Could not load the JSON file: {e}. Returning None.")
|
2411
2422
|
return None
|
2412
|
-
json_dict =
|
2413
|
-
return Topology.ByJSONDictionary(json_dict, tolerance=tolerance)
|
2423
|
+
return Topology.ByJSONDictionary(json_dict, tolerance=tolerance, silent=silent)
|
2414
2424
|
|
2415
2425
|
@staticmethod
|
2416
|
-
def ByJSONPath(path, tolerance=0.0001):
|
2426
|
+
def ByJSONPath(path, tolerance: float = 0.0001, silent: bool = False):
|
2417
2427
|
"""
|
2418
2428
|
Imports the topology from a JSON file.
|
2419
2429
|
|
@@ -2423,6 +2433,8 @@ class Topology():
|
|
2423
2433
|
The file path to the json file.
|
2424
2434
|
tolerance : float , optional
|
2425
2435
|
The desired tolerance. Default is 0.0001.
|
2436
|
+
silent : bool , optional
|
2437
|
+
If set to True, error and warning messages are suppressed. Default is False.
|
2426
2438
|
|
2427
2439
|
Returns
|
2428
2440
|
-------
|
@@ -2432,15 +2444,20 @@ class Topology():
|
|
2432
2444
|
"""
|
2433
2445
|
import json
|
2434
2446
|
if not path:
|
2435
|
-
|
2447
|
+
if not silent:
|
2448
|
+
print("Topology.ByJSONPath - Error: the input path parameter is not a valid path. Returning None.")
|
2436
2449
|
return None
|
2437
|
-
|
2438
|
-
|
2439
|
-
|
2440
|
-
|
2450
|
+
try:
|
2451
|
+
with open(path) as file:
|
2452
|
+
json_dict = json.load(file)
|
2453
|
+
except Exception as e:
|
2454
|
+
if not silent:
|
2455
|
+
print("Topology.ByJSONPath - Error: Could not load file: {e}. Returning None.")
|
2456
|
+
return None
|
2457
|
+
return Topology.ByJSONDictionary(json_dict, tolerance=tolerance, silent=silent)
|
2441
2458
|
|
2442
2459
|
@staticmethod
|
2443
|
-
def ByJSONDictionary(jsonDictionary, tolerance=0.0001):
|
2460
|
+
def ByJSONDictionary(jsonDictionary: dict, tolerance: float = 0.0001, silent: bool = False):
|
2444
2461
|
"""
|
2445
2462
|
Imports the topology from a JSON dictionary.
|
2446
2463
|
|
@@ -2450,6 +2467,8 @@ class Topology():
|
|
2450
2467
|
The input JSON dictionary.
|
2451
2468
|
tolerance : float , optional
|
2452
2469
|
The desired tolerance. Default is 0.0001.
|
2470
|
+
silent : bool , optional
|
2471
|
+
If set to True, error and warning messages are suppressed. Default is False.
|
2453
2472
|
|
2454
2473
|
Returns
|
2455
2474
|
-------
|
@@ -2488,41 +2507,41 @@ class Topology():
|
|
2488
2507
|
# Create basic topological entities
|
2489
2508
|
if entity_type == 'Vertex':
|
2490
2509
|
parent_entity = Vertex.ByCoordinates(*entity['coordinates'])
|
2491
|
-
parent_entity = Topology.SetDictionary(parent_entity, entity_dict)
|
2510
|
+
parent_entity = Topology.SetDictionary(parent_entity, entity_dict, silent=silent)
|
2492
2511
|
vertices[entity['uuid']] = parent_entity
|
2493
2512
|
|
2494
2513
|
elif entity_type == 'Edge':
|
2495
2514
|
vertex1 = vertices[entity['vertices'][0]]
|
2496
2515
|
vertex2 = vertices[entity['vertices'][1]]
|
2497
|
-
parent_entity = Edge.ByVertices([vertex1, vertex2])
|
2498
|
-
parent_entity = Topology.SetDictionary(parent_entity, entity_dict)
|
2516
|
+
parent_entity = Edge.ByVertices([vertex1, vertex2], tolerance=tolerance, silent=silent)
|
2517
|
+
parent_entity = Topology.SetDictionary(parent_entity, entity_dict, silent=silent)
|
2499
2518
|
edges[entity['uuid']] = parent_entity
|
2500
2519
|
|
2501
2520
|
elif entity_type == 'Wire':
|
2502
2521
|
wire_edges = [edges[uuid] for uuid in entity['edges']]
|
2503
|
-
parent_entity = Wire.ByEdges(wire_edges)
|
2504
|
-
parent_entity = Topology.SetDictionary(parent_entity, entity_dict)
|
2522
|
+
parent_entity = Wire.ByEdges(wire_edges, tolerance=tolerance, silent=silent)
|
2523
|
+
parent_entity = Topology.SetDictionary(parent_entity, entity_dict, silent=silent)
|
2505
2524
|
wires[entity['uuid']] = parent_entity
|
2506
2525
|
|
2507
2526
|
elif entity_type == 'Face':
|
2508
2527
|
face_wires = [wires[uuid] for uuid in entity['wires']]
|
2509
2528
|
if len(face_wires) > 1:
|
2510
|
-
parent_entity = Face.ByWires(face_wires[0], face_wires[1:])
|
2529
|
+
parent_entity = Face.ByWires(face_wires[0], face_wires[1:], tolerance=tolerance, silent=silent)
|
2511
2530
|
else:
|
2512
|
-
parent_entity = Face.ByWire(face_wires[0])
|
2513
|
-
parent_entity = Topology.SetDictionary(parent_entity, entity_dict)
|
2531
|
+
parent_entity = Face.ByWire(face_wires[0], tolerance=tolerance, silent=silent)
|
2532
|
+
parent_entity = Topology.SetDictionary(parent_entity, entity_dict, silent=silent)
|
2514
2533
|
faces[entity['uuid']] = parent_entity
|
2515
2534
|
|
2516
2535
|
elif entity_type == 'Shell':
|
2517
2536
|
shell_faces = [faces[uuid] for uuid in entity['faces']]
|
2518
|
-
parent_entity = Shell.ByFaces(shell_faces)
|
2519
|
-
parent_entity = Topology.SetDictionary(parent_entity, entity_dict)
|
2537
|
+
parent_entity = Shell.ByFaces(shell_faces, tolerance=tolerance, silent=silent)
|
2538
|
+
parent_entity = Topology.SetDictionary(parent_entity, entity_dict, silent=silent)
|
2520
2539
|
shells[entity['uuid']] = parent_entity
|
2521
2540
|
|
2522
2541
|
elif entity_type == 'Cell':
|
2523
2542
|
cell_shells = [shells[uuid] for uuid in entity['shells']]
|
2524
2543
|
if len(cell_shells) > 1:
|
2525
|
-
parent_entity = Cell.ByShells(cell_shells[0], cell_shells[1:])
|
2544
|
+
parent_entity = Cell.ByShells(cell_shells[0], cell_shells[1:], tolerance=tolerance, silent=silent)
|
2526
2545
|
else:
|
2527
2546
|
parent_entity = Cell.ByShell(cell_shells[0])
|
2528
2547
|
parent_entity = Topology.SetDictionary(parent_entity, entity_dict)
|
@@ -2648,7 +2667,7 @@ class Topology():
|
|
2648
2667
|
return top_level_list
|
2649
2668
|
|
2650
2669
|
@staticmethod
|
2651
|
-
def ByJSONString(string, tolerance=0.0001):
|
2670
|
+
def ByJSONString(string: str, tolerance: float = 0.0001, silent: bool = False):
|
2652
2671
|
"""
|
2653
2672
|
Imports the topology from a JSON string.
|
2654
2673
|
|
@@ -2658,6 +2677,8 @@ class Topology():
|
|
2658
2677
|
The input JSON string.
|
2659
2678
|
tolerance : float , optional
|
2660
2679
|
The desired tolerance. Default is 0.0001.
|
2680
|
+
silent : bool , optional
|
2681
|
+
If set to True, error and warning messages are suppressed. Default is False.
|
2661
2682
|
|
2662
2683
|
Returns
|
2663
2684
|
-------
|
@@ -2665,9 +2686,13 @@ class Topology():
|
|
2665
2686
|
The list of imported topologies (Warning: the list could contain 0, 1, or many topologies, but this method will always return a list)
|
2666
2687
|
|
2667
2688
|
"""
|
2668
|
-
|
2669
|
-
|
2670
|
-
|
2689
|
+
try:
|
2690
|
+
json_dict = json.loads(string)
|
2691
|
+
except Exception as e:
|
2692
|
+
if not silent:
|
2693
|
+
print(f"Topology.ByJSONString - Error: Could not read the input string: {e}. Returning None.")
|
2694
|
+
return None
|
2695
|
+
return Topology.ByJSONDictionary(json_dict, tolerance=tolerance, silent=silent)
|
2671
2696
|
|
2672
2697
|
@staticmethod
|
2673
2698
|
def ByMeshData(dictionary, transferDictionaries: bool = False, mantissa: int = 6, tolerance: float = 0.0001, silent: bool = False):
|
topologicpy/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '0.8.
|
1
|
+
__version__ = '0.8.61'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: topologicpy
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.61
|
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
|
@@ -2,7 +2,7 @@ topologicpy/ANN.py,sha256=gpflv4lFypOW789vO7mSkMLaMF_ZftVOCqCvtGr6-JA,47873
|
|
2
2
|
topologicpy/Aperture.py,sha256=wNn5miB_IrGCBYuQ18HXQYRva20dUC3id4AJCulL7to,2723
|
3
3
|
topologicpy/BVH.py,sha256=JA4bb-9hgMfVZ_syzmSmTL3ueCq-0vMUGMPZxNcawAY,13023
|
4
4
|
topologicpy/CSG.py,sha256=09la1-xzS9vr-WnV7tpJ0I-mkZ-XY0MRSd5iB50Nfgw,15556
|
5
|
-
topologicpy/Cell.py,sha256=
|
5
|
+
topologicpy/Cell.py,sha256=xkt9lfutgSwr_1lah1U5n48UnrLIggznNKUmEe2FA2g,177505
|
6
6
|
topologicpy/CellComplex.py,sha256=Kbz63rGeE08bJfMXFvB-AptoKHiaCK5OtiV1wz8Y-Fk,68081
|
7
7
|
topologicpy/Cluster.py,sha256=G49AuhJHQ1s819cB5MtVdmAGgkag19IC3dRP1ub1Wh4,58608
|
8
8
|
topologicpy/Color.py,sha256=hzSmgBWhiuYc55RSipkQNIgGtgyhC5BqY8AakNYEK-U,24486
|
@@ -12,28 +12,28 @@ topologicpy/Dictionary.py,sha256=Z4YQ88tONWd-0X0dENQ8IZqIOa9mbBqhJkTBsHmft2g,446
|
|
12
12
|
topologicpy/Edge.py,sha256=DifItuyabFDUFC7CVMlt2DeMFMNaGOqCg43iU9CPP0A,74029
|
13
13
|
topologicpy/EnergyModel.py,sha256=hB1aiJe45gdDMFm1AhkBr-1djjtXSzn24iRpQMk43-4,57749
|
14
14
|
topologicpy/Face.py,sha256=aX9EcR3JGbLITElhd25J0Z8m9U8KkmbYivGg3oZN-Uw,202296
|
15
|
-
topologicpy/Graph.py,sha256=
|
15
|
+
topologicpy/Graph.py,sha256=ytXl9VLj243o9LhY0A8P_gp4_Ce_VrHW5oaC2WK6Mbc,782718
|
16
16
|
topologicpy/Grid.py,sha256=3OsBMyHh4w8gpFOTMKHMNTpo62V0CwRNu5cwm87yDUA,18421
|
17
17
|
topologicpy/Helper.py,sha256=Nr6pyzl0sZm4Cu11wOqoYKu6yYal5N6A9jErXnaZBJc,31765
|
18
18
|
topologicpy/Honeybee.py,sha256=DzaG9wpkJdcDWcjOGXhuN5X0gCqypmZGBa1y5E2MkjU,48964
|
19
|
-
topologicpy/Kuzu.py,sha256=
|
19
|
+
topologicpy/Kuzu.py,sha256=fxaDPWM5Xam7Tot0olPZsazS_7xgE_Vo-jf0Sbv3VZE,36298
|
20
20
|
topologicpy/Matrix.py,sha256=bOofT34G3YHu9aMIWx60YHAJga4R0GbDjsZBUD4Hu_k,22706
|
21
21
|
topologicpy/Neo4j.py,sha256=J8jU_mr5-mWC0Lg_D2dMjMlx1rY_eh8ks_aubUuTdWw,22319
|
22
|
-
topologicpy/Plotly.py,sha256=
|
22
|
+
topologicpy/Plotly.py,sha256=OQvCzAXqu_QYn8iY0rjc8ZB4XwwK70pWjnnoMzDdcc0,123167
|
23
23
|
topologicpy/Polyskel.py,sha256=oVfM4lqSMPTjnkHfsRU9VI8Blt6Vf0LVPkD9ebz7Wmw,27082
|
24
24
|
topologicpy/PyG.py,sha256=wOsoBFxMgwZYWjj86OMkz_PJuQ02locV_djhSDD6dVc,109644
|
25
25
|
topologicpy/ShapeGrammar.py,sha256=KYsKDLXWdflAcYMAIz84AUF-GMkbTmaBDd2-ovbilqU,23336
|
26
26
|
topologicpy/Shell.py,sha256=ioO4raCJfXtYldQg-adpcLVeJPEA6od6cAA5ro7t6r4,96792
|
27
27
|
topologicpy/Speckle.py,sha256=-eiTqJugd7pHiHpD3pDUcDO6CGhVyPV14HFRzaqEoaw,18187
|
28
28
|
topologicpy/Sun.py,sha256=8S6dhCKfOhUGVny-jEk87Q08anLYMB1JEBKRGCklvbQ,36670
|
29
|
-
topologicpy/Topology.py,sha256=
|
29
|
+
topologicpy/Topology.py,sha256=O3K4B47K0ic4jMj4OC9ZuqDPV6I7QRZ6r7Q9SHPEqaI,474206
|
30
30
|
topologicpy/Vector.py,sha256=pEC8YY3TeHGfGdeNgvdHjgMDwxGabp5aWjwYC1HSvMk,42236
|
31
31
|
topologicpy/Vertex.py,sha256=r_3cicgpino96ymm1ANptfOuqE59b99YWwksxyPOYK4,85914
|
32
32
|
topologicpy/Wire.py,sha256=gjgQUGHdBdXUIijgZc_VIW0E39w-smaVhhdl0jF63fQ,230466
|
33
33
|
topologicpy/__init__.py,sha256=RMftibjgAnHB1vdL-muo71RwMS4972JCxHuRHOlU428,928
|
34
|
-
topologicpy/version.py,sha256=
|
35
|
-
topologicpy-0.8.
|
36
|
-
topologicpy-0.8.
|
37
|
-
topologicpy-0.8.
|
38
|
-
topologicpy-0.8.
|
39
|
-
topologicpy-0.8.
|
34
|
+
topologicpy/version.py,sha256=v9RYfeFVriaSopTI1WMyzj0QSU9vvxnXtU_efzx9Iek,23
|
35
|
+
topologicpy-0.8.61.dist-info/licenses/LICENSE,sha256=FK0vJ73LuE8PYJAn7LutsReWR47-Ooovw2dnRe5yV6Q,681
|
36
|
+
topologicpy-0.8.61.dist-info/METADATA,sha256=AUdc_jfqI7o0MlB6Izlr_BIUcpjbN71DLKCHBY1UYsA,10535
|
37
|
+
topologicpy-0.8.61.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
38
|
+
topologicpy-0.8.61.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
|
39
|
+
topologicpy-0.8.61.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|