topologicpy 0.7.21__py3-none-any.whl → 0.7.23__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/ANN.py +3 -6
- topologicpy/Cell.py +5 -3
- topologicpy/Cluster.py +0 -4
- topologicpy/DGL.py +1 -9
- topologicpy/Dictionary.py +24 -13
- topologicpy/Edge.py +0 -6
- topologicpy/Face.py +35 -26
- topologicpy/Graph.py +2 -19
- topologicpy/Grid.py +0 -1
- topologicpy/Helper.py +0 -2
- topologicpy/Honeybee.py +27 -2
- topologicpy/Plotly.py +0 -1
- topologicpy/Polyskel.py +0 -21
- topologicpy/Shell.py +2 -4
- topologicpy/Sun.py +14 -5
- topologicpy/Topology.py +380 -180
- topologicpy/Vector.py +21 -13
- topologicpy/Vertex.py +8 -5
- topologicpy/Wire.py +53 -35
- topologicpy/version.py +1 -1
- {topologicpy-0.7.21.dist-info → topologicpy-0.7.23.dist-info}/METADATA +1 -1
- topologicpy-0.7.23.dist-info/RECORD +34 -0
- {topologicpy-0.7.21.dist-info → topologicpy-0.7.23.dist-info}/WHEEL +1 -1
- topologicpy-0.7.21.dist-info/RECORD +0 -34
- {topologicpy-0.7.21.dist-info → topologicpy-0.7.23.dist-info}/LICENSE +0 -0
- {topologicpy-0.7.21.dist-info → topologicpy-0.7.23.dist-info}/top_level.txt +0 -0
topologicpy/ANN.py
CHANGED
@@ -480,6 +480,7 @@ class ANN():
|
|
480
480
|
it controls the shuffling of the data before splitting it into training and testing sets.
|
481
481
|
This means that every time you run your code with the same randomState value and the same dataset, you will get the same split of the data.
|
482
482
|
The default is 42 which is just a randomly picked integer number. Specify None for random sampling.
|
483
|
+
|
483
484
|
Returns
|
484
485
|
-------
|
485
486
|
dict
|
@@ -517,7 +518,7 @@ class ANN():
|
|
517
518
|
----------
|
518
519
|
|
519
520
|
Returns
|
520
|
-
|
521
|
+
-------
|
521
522
|
list
|
522
523
|
The list of names of available sample datasets
|
523
524
|
"""
|
@@ -805,7 +806,6 @@ class ANN():
|
|
805
806
|
'training_r2' (R^2 for regression tasks only)
|
806
807
|
'validation_r2' (R^2 for regression tasks only)
|
807
808
|
|
808
|
-
|
809
809
|
"""
|
810
810
|
|
811
811
|
return {
|
@@ -1126,8 +1126,5 @@ class ANN():
|
|
1126
1126
|
print("ANN.Load - Error: The specified path does not exist. Returning None.")
|
1127
1127
|
return None
|
1128
1128
|
model.load(path)
|
1129
|
-
return model
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1129
|
+
return model
|
1133
1130
|
|
topologicpy/Cell.py
CHANGED
@@ -298,7 +298,7 @@ class Cell():
|
|
298
298
|
bottomFace = face
|
299
299
|
topFace = Topology.Translate(face, faceNormal[0]*thickness, faceNormal[1]*thickness, faceNormal[2]*thickness)
|
300
300
|
|
301
|
-
cellFaces = [bottomFace, topFace]
|
301
|
+
cellFaces = [Face.Invert(bottomFace), topFace]
|
302
302
|
bottomEdges = Topology.Edges(bottomFace)
|
303
303
|
for bottomEdge in bottomEdges:
|
304
304
|
topEdge = Topology.Translate(bottomEdge, faceNormal[0]*thickness, faceNormal[1]*thickness, faceNormal[2]*thickness)
|
@@ -1408,7 +1408,6 @@ class Cell():
|
|
1408
1408
|
icosahedron = Topology.Place(icosahedron, originA=Vertex.Origin(), originB=origin)
|
1409
1409
|
return icosahedron
|
1410
1410
|
|
1411
|
-
|
1412
1411
|
@staticmethod
|
1413
1412
|
def InternalBoundaries(cell) -> list:
|
1414
1413
|
"""
|
@@ -1837,9 +1836,12 @@ class Cell():
|
|
1837
1836
|
from topologicpy.Topology import Topology
|
1838
1837
|
|
1839
1838
|
shell = Shell.Roof(face=face, angle=angle, epsilon=epsilon, tolerance=tolerance)
|
1839
|
+
if not Topology.IsInstance(shell, "Shell"):
|
1840
|
+
print("Cell.Roof - Error: Could not create a roof cell. Returning None.")
|
1841
|
+
return None
|
1840
1842
|
faces = Topology.Faces(shell) + [face]
|
1841
1843
|
cell = Cell.ByFaces(faces, tolerance=tolerance)
|
1842
|
-
if not cell:
|
1844
|
+
if not Topology.IsInstance(cell, "Cell"):
|
1843
1845
|
print("Cell.Roof - Error: Could not create a roof cell. Returning None.")
|
1844
1846
|
return None
|
1845
1847
|
return cell
|
topologicpy/Cluster.py
CHANGED
@@ -253,7 +253,6 @@ class Cluster():
|
|
253
253
|
_ = cluster.Cells(None, cells)
|
254
254
|
return cells
|
255
255
|
|
256
|
-
|
257
256
|
@staticmethod
|
258
257
|
def DBSCAN(topologies, selectors=None, keys=["x", "y", "z"], epsilon: float = 0.5, minSamples: int = 2):
|
259
258
|
"""
|
@@ -878,7 +877,6 @@ class Cluster():
|
|
878
877
|
from topologicpy.Dictionary import Dictionary
|
879
878
|
from topologicpy.Topology import Topology
|
880
879
|
|
881
|
-
|
882
880
|
def k_means(data, vertices, k=4, maxIterations=100):
|
883
881
|
import random
|
884
882
|
def euclidean_distance(p, q):
|
@@ -914,8 +912,6 @@ class Cluster():
|
|
914
912
|
|
915
913
|
return {'clusters': clusters, 'clusters_v': clusters_v, 'centroids': centroids}
|
916
914
|
|
917
|
-
|
918
|
-
|
919
915
|
if not isinstance(topologies, list):
|
920
916
|
print("Cluster.K_Means - Error: The input topologies parameter is not a valid list. Returning None.")
|
921
917
|
return None
|
topologicpy/DGL.py
CHANGED
@@ -426,7 +426,6 @@ class _TAGConv(nn.Module):
|
|
426
426
|
# h will now be vector of dimension num_classes
|
427
427
|
return h
|
428
428
|
|
429
|
-
|
430
429
|
class _GraphConvReg(nn.Module):
|
431
430
|
def __init__(self, in_feats, h_feats, pooling):
|
432
431
|
super(_GraphConvReg, self).__init__()
|
@@ -467,7 +466,6 @@ class _GraphConvReg(nn.Module):
|
|
467
466
|
# h will now be vector of dimension num_classes
|
468
467
|
return h
|
469
468
|
|
470
|
-
|
471
469
|
class _GraphRegressorHoldout:
|
472
470
|
def __init__(self, hparams, trainingDataset, validationDataset=None, testingDataset=None):
|
473
471
|
#device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
@@ -574,7 +572,6 @@ class _GraphRegressorHoldout:
|
|
574
572
|
self.validate()
|
575
573
|
self.validation_loss_list.append(torch.sqrt(self.validation_loss).item())
|
576
574
|
|
577
|
-
|
578
575
|
def validate(self):
|
579
576
|
device = torch.device("cpu")
|
580
577
|
self.model.eval()
|
@@ -772,7 +769,6 @@ class _GraphRegressorKFold:
|
|
772
769
|
# Perform optimization
|
773
770
|
self.optimizer.step()
|
774
771
|
|
775
|
-
|
776
772
|
epoch_training_loss_list.append(torch.sqrt(loss).item())
|
777
773
|
self.validate()
|
778
774
|
epoch_validation_loss_list.append(torch.sqrt(self.validation_loss).item())
|
@@ -1306,7 +1302,6 @@ class _GraphClassifierKFold:
|
|
1306
1302
|
path = path+".pt"
|
1307
1303
|
torch.save(self.model, path)
|
1308
1304
|
|
1309
|
-
|
1310
1305
|
class GCN_NC(nn.Module):
|
1311
1306
|
def __init__(self, in_feats, h_feats, num_classes):
|
1312
1307
|
super(GCN_NC, self).__init__()
|
@@ -1472,7 +1467,6 @@ class _NodeClassifier:
|
|
1472
1467
|
path = path+".pt"
|
1473
1468
|
torch.save(self.model, path)
|
1474
1469
|
|
1475
|
-
|
1476
1470
|
class DGL:
|
1477
1471
|
@staticmethod
|
1478
1472
|
def Accuracy(actual, predicted, mantissa: int = 6):
|
@@ -2295,6 +2289,7 @@ class DGL:
|
|
2295
2289
|
A list of length 3 containing the fraction to use for training, validation and test. If None, we will use [0.8, 0.1, 0.1]. The default is [0.8, 0.1, 0.1]
|
2296
2290
|
randomState : int or array_like , optional
|
2297
2291
|
Random seed used to initialize the pseudo-random number generator. Can be any integer between 0 and 2**32 - 1 inclusive, an array (or other sequence) of such integers, or None (the default). If seed is None, then RandomState will try to read data from /dev/urandom (or the Windows analogue) if available or seed from the clock otherwise.
|
2292
|
+
|
2298
2293
|
Returns
|
2299
2294
|
-------
|
2300
2295
|
dict
|
@@ -2805,7 +2800,6 @@ class DGL:
|
|
2805
2800
|
'Losses' (Regressor and K-fold only)
|
2806
2801
|
'min Loss' (Regressor and K-fold only)
|
2807
2802
|
|
2808
|
-
|
2809
2803
|
"""
|
2810
2804
|
from topologicpy.Helper import Helper
|
2811
2805
|
|
@@ -3026,8 +3020,6 @@ class DGL:
|
|
3026
3020
|
|
3027
3021
|
return round(total_true_positives / (total_true_positives + total_false_negatives), mantissa)
|
3028
3022
|
|
3029
|
-
|
3030
|
-
|
3031
3023
|
'''
|
3032
3024
|
@staticmethod
|
3033
3025
|
def TrainRegressor(hparams, trainingDataset, validationDataset=None, testingDataset=None, overwrite=False):
|
topologicpy/Dictionary.py
CHANGED
@@ -153,14 +153,14 @@ class Dictionary():
|
|
153
153
|
return topologic.Dictionary.ByKeysValues(stl_keys, stl_values) # Hook to Core
|
154
154
|
|
155
155
|
@staticmethod
|
156
|
-
def ByMergedDictionaries(dictionaries):
|
156
|
+
def ByMergedDictionaries(*dictionaries):
|
157
157
|
"""
|
158
158
|
Creates a dictionary by merging the list of input dictionaries.
|
159
159
|
|
160
160
|
Parameters
|
161
161
|
----------
|
162
|
-
dictionaries : list
|
163
|
-
The input list of dictionaries to be
|
162
|
+
dictionaries : list or comma separated dictionaries
|
163
|
+
The input list of dictionaries to be merged.
|
164
164
|
|
165
165
|
Returns
|
166
166
|
-------
|
@@ -169,23 +169,35 @@ class Dictionary():
|
|
169
169
|
|
170
170
|
"""
|
171
171
|
from topologicpy.Topology import Topology
|
172
|
-
|
172
|
+
from topologicpy.Helper import Helper
|
173
|
+
|
174
|
+
if isinstance(dictionaries, tuple):
|
175
|
+
dictionaries = Helper.Flatten(list(dictionaries))
|
176
|
+
if isinstance(dictionaries, list):
|
177
|
+
new_dictionaries = [d for d in dictionaries if Topology.IsInstance(d, "Dictionary")]
|
178
|
+
if len(new_dictionaries) == 0:
|
179
|
+
print("Dictionary.ByMergedDictionaries - Error: the input dictionaries parameter does not contain any valid dictionaries. Returning None.")
|
180
|
+
return None
|
181
|
+
if len(new_dictionaries) == 1:
|
182
|
+
print("Dictionary.ByMergedDictionaries - Error: the input dictionaries parameter contains only one dictionary. Returning input dictionary.")
|
183
|
+
return new_dictionaries[0]
|
184
|
+
if not isinstance(new_dictionaries, list):
|
173
185
|
print("Dictionary.ByMergedDictionaries - Error: The input dictionaries parameter is not a valid list. Returning None.")
|
174
186
|
return None
|
175
|
-
|
176
|
-
for d in
|
187
|
+
return_dictionaries = []
|
188
|
+
for d in new_dictionaries:
|
177
189
|
if Topology.IsInstance(d, "Dictionary"):
|
178
|
-
|
190
|
+
return_dictionaries.append(d)
|
179
191
|
elif isinstance(d, dict):
|
180
|
-
|
181
|
-
if len(
|
192
|
+
return_dictionaries.append(Dictionary.ByPythonDictionary(d))
|
193
|
+
if len(return_dictionaries) == 0:
|
182
194
|
print("Dictionary.ByMergedDictionaries - Error: The input dictionaries parameter does not contain valid dictionaries. Returning None.")
|
183
195
|
return None
|
184
|
-
elif len(
|
196
|
+
elif len(return_dictionaries) == 1:
|
185
197
|
print("Dictionary.ByMergedDictionaries - Warning: The input dictionaries parameter contains only one valid dictionary. Returning that dictionary.")
|
186
198
|
return new_dictionaries[0]
|
187
199
|
else:
|
188
|
-
dictionaries =
|
200
|
+
dictionaries = return_dictionaries
|
189
201
|
sinkKeys = []
|
190
202
|
sinkValues = []
|
191
203
|
d = dictionaries[0]
|
@@ -669,8 +681,6 @@ class Dictionary():
|
|
669
681
|
elif Topology.IsInstance(dictionary, "Dictionary"):
|
670
682
|
keys = dictionary.Keys()
|
671
683
|
returnList = []
|
672
|
-
if not keys:
|
673
|
-
return None
|
674
684
|
for key in keys:
|
675
685
|
try:
|
676
686
|
if isinstance(dictionary, dict):
|
@@ -680,6 +690,7 @@ class Dictionary():
|
|
680
690
|
else:
|
681
691
|
attr = None
|
682
692
|
except:
|
693
|
+
print(f"Dictionary.Values - Error: Encountered an error in a key in the dictionary ({key}). Returning None.")
|
683
694
|
return None
|
684
695
|
returnList.append(attr)
|
685
696
|
return returnList
|
topologicpy/Edge.py
CHANGED
@@ -85,12 +85,8 @@ class Edge():
|
|
85
85
|
|
86
86
|
"""
|
87
87
|
from topologicpy.Vertex import Vertex
|
88
|
-
from topologicpy.Wire import Wire
|
89
|
-
from topologicpy.Cluster import Cluster
|
90
88
|
from topologicpy.Topology import Topology
|
91
89
|
from topologicpy.Vector import Vector
|
92
|
-
import numpy as np
|
93
|
-
|
94
90
|
|
95
91
|
def process_edges(edge1, edge2, tolerance=0.0001):
|
96
92
|
start1 = Edge.StartVertex(edge1)
|
@@ -222,7 +218,6 @@ class Edge():
|
|
222
218
|
edge = Topology.Translate(edge, n[0], n[1], n[2])
|
223
219
|
return edge
|
224
220
|
|
225
|
-
|
226
221
|
@staticmethod
|
227
222
|
def ByStartVertexEndVertex(vertexA, vertexB, tolerance: float = 0.0001, silent=False):
|
228
223
|
"""
|
@@ -988,7 +983,6 @@ class Edge():
|
|
988
983
|
|
989
984
|
return normal_vector
|
990
985
|
|
991
|
-
|
992
986
|
def calculate_normal_line(start_vertex, end_vertex):
|
993
987
|
# Calculate the normal vector of the line
|
994
988
|
normal_vector = calculate_normal(start_vertex, end_vertex)
|
topologicpy/Face.py
CHANGED
@@ -677,7 +677,6 @@ class Face():
|
|
677
677
|
face = None
|
678
678
|
return face
|
679
679
|
|
680
|
-
|
681
680
|
@staticmethod
|
682
681
|
def ByWiresCluster(externalBoundary, internalBoundariesCluster = None, tolerance: float = 0.0001, silent: bool = False):
|
683
682
|
"""
|
@@ -770,7 +769,7 @@ class Face():
|
|
770
769
|
elif placement.lower() == "upperright":
|
771
770
|
arrow = Topology.Translate(arrow, -radius, -radius, 0)
|
772
771
|
arrow = Topology.Place(arrow, originA=Vertex.Origin(), originB=origin)
|
773
|
-
arrow = Topology.Orient(arrow, origin=origin,
|
772
|
+
arrow = Topology.Orient(arrow, origin=origin, dirA=[0,0,1], dirB=direction)
|
774
773
|
return arrow
|
775
774
|
|
776
775
|
@staticmethod
|
@@ -925,7 +924,7 @@ class Face():
|
|
925
924
|
The desired tolerance. The default is 0.0001.
|
926
925
|
|
927
926
|
Returns
|
928
|
-
|
927
|
+
-------
|
929
928
|
topologic_core.Face
|
930
929
|
The created Einstein tile.
|
931
930
|
|
@@ -937,7 +936,9 @@ class Face():
|
|
937
936
|
if not Topology.IsInstance(wire, "Wire"):
|
938
937
|
print("Face.Einstein - Error: Could not create base wire for the Einstein tile. Returning None.")
|
939
938
|
return None
|
940
|
-
|
939
|
+
f = Face.ByWire(wire, tolerance=tolerance)
|
940
|
+
f = Topology.Orient(f, dirA=Face.Normal(f), dirB=direction)
|
941
|
+
return f
|
941
942
|
|
942
943
|
@staticmethod
|
943
944
|
def Ellipse(origin= None, inputMode: int = 1, width: float = 2.0, length: float = 1.0, focalLength: float = 0.866025, eccentricity: float = 0.866025, majorAxisLength: float = 1.0, minorAxisLength: float = 0.5, sides: float = 32, fromAngle: float = 0.0, toAngle: float = 360.0, close: bool = True, direction: list = [0, 0, 1], placement: str = "center", tolerance: float = 0.0001):
|
@@ -1060,10 +1061,6 @@ class Face():
|
|
1060
1061
|
from topologicpy.Topology import Topology
|
1061
1062
|
|
1062
1063
|
eb = face.ExternalBoundary()
|
1063
|
-
f_dir = Face.Normal(face)
|
1064
|
-
w_dir = Wire.Normal(eb)
|
1065
|
-
if Vector.IsAntiParallel(f_dir, w_dir):
|
1066
|
-
eb = Wire.Reverse(eb)
|
1067
1064
|
return eb
|
1068
1065
|
|
1069
1066
|
@staticmethod
|
@@ -1106,7 +1103,6 @@ class Face():
|
|
1106
1103
|
return False
|
1107
1104
|
return True
|
1108
1105
|
|
1109
|
-
|
1110
1106
|
@staticmethod
|
1111
1107
|
def Fillet(face, radius: float = 0, radiusKey: str = None, tolerance: float = 0.0001, silent: bool = False):
|
1112
1108
|
"""
|
@@ -1707,7 +1703,11 @@ class Face():
|
|
1707
1703
|
print("Face.Normal - Error: The input face parameter is not a valid face. Returning None.")
|
1708
1704
|
return None
|
1709
1705
|
|
1710
|
-
vertices = Topology.Vertices(face)
|
1706
|
+
#vertices = Topology.Vertices(face)
|
1707
|
+
v1 = Face.VertexByParameters(face, u=0, v=0)
|
1708
|
+
v2 = Face.VertexByParameters(face, u=1, v=0)
|
1709
|
+
v3 = Face.VertexByParameters(face, u=1, v=1)
|
1710
|
+
vertices = [v1, v2, v3]
|
1711
1711
|
vertices = [Vertex.Coordinates(v, mantissa=mantissa) for v in vertices]
|
1712
1712
|
|
1713
1713
|
if len(vertices) < 3:
|
@@ -1996,20 +1996,20 @@ class Face():
|
|
1996
1996
|
@staticmethod
|
1997
1997
|
def Simplify(face, tolerance=0.0001):
|
1998
1998
|
"""
|
1999
|
-
|
2000
|
-
|
2001
|
-
|
2002
|
-
|
2003
|
-
|
2004
|
-
|
2005
|
-
|
2006
|
-
|
2007
|
-
|
1999
|
+
Simplifies the input face edges based on the Douglas Peucker algorthim. See https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm
|
2000
|
+
Part of this code was contributed by gaoxipeng. See https://github.com/wassimj/topologicpy/issues/35
|
2001
|
+
|
2002
|
+
Parameters
|
2003
|
+
----------
|
2004
|
+
face : topologic_core.Face
|
2005
|
+
The input face.
|
2006
|
+
tolerance : float , optional
|
2007
|
+
The desired tolerance. The default is 0.0001. Edges shorter than this length will be removed.
|
2008
2008
|
|
2009
|
-
|
2010
|
-
|
2011
|
-
|
2012
|
-
|
2009
|
+
Returns
|
2010
|
+
-------
|
2011
|
+
topologic_core.Face
|
2012
|
+
The simplified face.
|
2013
2013
|
"""
|
2014
2014
|
from topologicpy.Wire import Wire
|
2015
2015
|
from topologicpy.Topology import Topology
|
@@ -2232,6 +2232,7 @@ class Face():
|
|
2232
2232
|
The list of triangles of the input face.
|
2233
2233
|
|
2234
2234
|
"""
|
2235
|
+
from topologicpy.Vector import Vector
|
2235
2236
|
from topologicpy.Wire import Wire
|
2236
2237
|
from topologicpy.Topology import Topology
|
2237
2238
|
|
@@ -2250,7 +2251,7 @@ class Face():
|
|
2250
2251
|
The desired tolerance. The default is 0.0001.
|
2251
2252
|
|
2252
2253
|
Returns
|
2253
|
-
|
2254
|
+
-------
|
2254
2255
|
topologic_core.Shell
|
2255
2256
|
The shell of triangular meshes.
|
2256
2257
|
|
@@ -2285,7 +2286,7 @@ class Face():
|
|
2285
2286
|
except:
|
2286
2287
|
warnings.warn("Face.Triangulate - Error: Could not import gmsh. Please try to install gmsh manually. Returning None.")
|
2287
2288
|
return None
|
2288
|
-
|
2289
|
+
|
2289
2290
|
from topologicpy.Vertex import Vertex
|
2290
2291
|
from topologicpy.Wire import Wire
|
2291
2292
|
from topologicpy.Face import Face
|
@@ -2398,7 +2399,15 @@ class Face():
|
|
2398
2399
|
finalFaces.append(f)
|
2399
2400
|
else:
|
2400
2401
|
finalFaces.append(f)
|
2401
|
-
|
2402
|
+
face_normal = Face.Normal(face)
|
2403
|
+
return_faces = []
|
2404
|
+
for ff in finalFaces:
|
2405
|
+
normal = Face.Normal(ff)
|
2406
|
+
if abs(Vector.Angle(normal, face_normal)) > 2:
|
2407
|
+
return_faces.append(Face.Invert(ff))
|
2408
|
+
else:
|
2409
|
+
return_faces.append(ff)
|
2410
|
+
return return_faces
|
2402
2411
|
|
2403
2412
|
@staticmethod
|
2404
2413
|
def TrimByWire(face, wire, reverse: bool = False):
|
topologicpy/Graph.py
CHANGED
@@ -65,7 +65,6 @@ except:
|
|
65
65
|
except:
|
66
66
|
warnings.warn("Graph - Error: Could not import tqdm.")
|
67
67
|
|
68
|
-
|
69
68
|
GraphQueueItem = namedtuple('GraphQueueItem', ['edges'])
|
70
69
|
|
71
70
|
class WorkerProcessPool(object):
|
@@ -119,7 +118,6 @@ class WorkerProcessPool(object):
|
|
119
118
|
for p in self.process_list:
|
120
119
|
p.join()
|
121
120
|
|
122
|
-
|
123
121
|
class WorkerProcess(Process):
|
124
122
|
"""
|
125
123
|
Creates a 2D navigation graph from a subset of sources and the list of destinations.
|
@@ -170,7 +168,6 @@ class WorkerProcess(Process):
|
|
170
168
|
edges_str = [Topology.BREPString(s) for s in edges]
|
171
169
|
self.message_queue.put(GraphQueueItem(edges_str))
|
172
170
|
|
173
|
-
|
174
171
|
class MergingProcess(Process):
|
175
172
|
"""
|
176
173
|
Receive message from other processes and merging the result
|
@@ -191,7 +188,6 @@ class MergingProcess(Process):
|
|
191
188
|
except Exception as e:
|
192
189
|
print(str(e))
|
193
190
|
|
194
|
-
|
195
191
|
class _Tree:
|
196
192
|
def __init__(self, node="", *children):
|
197
193
|
self.node = node
|
@@ -221,7 +217,6 @@ class _Tree:
|
|
221
217
|
def __len__(self):
|
222
218
|
return len(self.children)
|
223
219
|
|
224
|
-
|
225
220
|
class _DrawTree(object):
|
226
221
|
def __init__(self, tree, parent=None, depth=0, number=1):
|
227
222
|
self.x = -1.0
|
@@ -1468,7 +1463,6 @@ class Graph:
|
|
1468
1463
|
predicates += ['hasspace', 'hasbuilding', 'hasstorey']
|
1469
1464
|
bot_types += ['Site', 'Building', 'Storey']
|
1470
1465
|
|
1471
|
-
|
1472
1466
|
namespaces = botGraph.namespaces()
|
1473
1467
|
|
1474
1468
|
for ns in namespaces:
|
@@ -1981,7 +1975,6 @@ class Graph:
|
|
1981
1975
|
graphs.append(Graph.ByVerticesEdges(vertices, edges))
|
1982
1976
|
return {'graphs':graphs, 'labels':labels}
|
1983
1977
|
|
1984
|
-
|
1985
1978
|
@staticmethod
|
1986
1979
|
def ByIFCFile(file, includeTypes: list = [], excludeTypes: list = [],
|
1987
1980
|
includeRels: list = [], excludeRels: list = [],
|
@@ -2284,7 +2277,6 @@ class Graph:
|
|
2284
2277
|
return None
|
2285
2278
|
return Graph.ByIFCFile(ifc_file, includeTypes=includeTypes, excludeTypes=excludeTypes, includeRels=includeRels, excludeRels=excludeRels, xMin=xMin, yMin=yMin, zMin=zMin, xMax=xMax, yMax=yMax, zMax=zMax)
|
2286
2279
|
|
2287
|
-
|
2288
2280
|
@staticmethod
|
2289
2281
|
def ByMeshData(vertices, edges, vertexDictionaries=None, edgeDictionaries=None, tolerance=0.0001):
|
2290
2282
|
"""
|
@@ -2620,7 +2612,6 @@ class Graph:
|
|
2620
2612
|
_ = tempe.SetDictionary(tempd)
|
2621
2613
|
edges.append(tempe)
|
2622
2614
|
|
2623
|
-
|
2624
2615
|
cells = []
|
2625
2616
|
_ = topology.Cells(None, cells)
|
2626
2617
|
if any([viaSharedTopologies, viaSharedApertures, toExteriorTopologies, toExteriorApertures, toContents]):
|
@@ -4999,7 +4990,6 @@ class Graph:
|
|
4999
4990
|
|
5000
4991
|
"""
|
5001
4992
|
|
5002
|
-
|
5003
4993
|
from topologicpy.Vertex import Vertex
|
5004
4994
|
from topologicpy.Edge import Edge
|
5005
4995
|
from topologicpy.Helper import Helper
|
@@ -5735,7 +5725,6 @@ class Graph:
|
|
5735
5725
|
|
5736
5726
|
midpoint = (v.children[0].x + v.children[-1].x) / 2
|
5737
5727
|
|
5738
|
-
|
5739
5728
|
w = v.lbrother()
|
5740
5729
|
if w:
|
5741
5730
|
v.x = w.x + distance
|
@@ -5778,7 +5767,6 @@ class Graph:
|
|
5778
5767
|
default_ancestor = v
|
5779
5768
|
return default_ancestor
|
5780
5769
|
|
5781
|
-
|
5782
5770
|
def move_subtree(wl, wr, shift):
|
5783
5771
|
subtrees = wr.number - wl.number
|
5784
5772
|
wr.change -= shift / subtrees
|
@@ -5787,7 +5775,6 @@ class Graph:
|
|
5787
5775
|
wr.x += shift
|
5788
5776
|
wr.mod += shift
|
5789
5777
|
|
5790
|
-
|
5791
5778
|
def execute_shifts(v):
|
5792
5779
|
shift = change = 0
|
5793
5780
|
for w in v.children[::-1]:
|
@@ -5796,14 +5783,12 @@ class Graph:
|
|
5796
5783
|
change += w.change
|
5797
5784
|
shift += w.shift + change
|
5798
5785
|
|
5799
|
-
|
5800
5786
|
def ancestor(vil, v, default_ancestor):
|
5801
5787
|
if vil.ancestor in v.parent.children:
|
5802
5788
|
return vil.ancestor
|
5803
5789
|
else:
|
5804
5790
|
return default_ancestor
|
5805
5791
|
|
5806
|
-
|
5807
5792
|
def second_walk(v, m=0, depth=0, min=None):
|
5808
5793
|
v.x += m
|
5809
5794
|
v.y = depth
|
@@ -5816,7 +5801,6 @@ class Graph:
|
|
5816
5801
|
|
5817
5802
|
return min
|
5818
5803
|
|
5819
|
-
|
5820
5804
|
def edge_list_to_adjacency_matrix(edge_list):
|
5821
5805
|
"""Converts an edge list to an adjacency matrix.
|
5822
5806
|
|
@@ -5843,7 +5827,6 @@ class Graph:
|
|
5843
5827
|
|
5844
5828
|
return adjacency_matrix
|
5845
5829
|
|
5846
|
-
|
5847
5830
|
def tree_from_edge_list(edge_list, root_index=0):
|
5848
5831
|
|
5849
5832
|
adj_matrix = edge_list_to_adjacency_matrix(edge_list)
|
@@ -5982,7 +5965,6 @@ class Graph:
|
|
5982
5965
|
pos[:, 0] = pos[:, 0] * np.pi * 1.98
|
5983
5966
|
pos[:, 1] = pos[:, 1] / np.max(pos[:, 1])
|
5984
5967
|
|
5985
|
-
|
5986
5968
|
new_pos = np.zeros((num_nodes, 2))
|
5987
5969
|
new_pos[:, 0] = pos[:, 1] * np.cos(pos[:, 0])
|
5988
5970
|
new_pos[:, 1] = pos[:, 1] * np.sin(pos[:, 0])
|
@@ -6033,7 +6015,6 @@ class Graph:
|
|
6033
6015
|
flat_graph = Graph.ByMeshData(positions, edges, v_dicts, e_dicts, tolerance=tolerance)
|
6034
6016
|
return flat_graph
|
6035
6017
|
|
6036
|
-
|
6037
6018
|
@staticmethod
|
6038
6019
|
def GlobalClusteringCoefficient(graph):
|
6039
6020
|
"""
|
@@ -6043,6 +6024,7 @@ class Graph:
|
|
6043
6024
|
----------
|
6044
6025
|
graph : topologic_core.Graph
|
6045
6026
|
The input graph.
|
6027
|
+
|
6046
6028
|
Returns
|
6047
6029
|
-------
|
6048
6030
|
int
|
@@ -8159,6 +8141,7 @@ class Graph:
|
|
8159
8141
|
If set, the returned list of vertices is sorted according to the dicitonary values stored under this key. The default is None.
|
8160
8142
|
reverse : bool , optional
|
8161
8143
|
If set to True, the vertices are sorted in reverse order (only if vertexKey is set). Otherwise, they are not. The default is False.
|
8144
|
+
|
8162
8145
|
Returns
|
8163
8146
|
-------
|
8164
8147
|
list
|
topologicpy/Grid.py
CHANGED
topologicpy/Helper.py
CHANGED
topologicpy/Honeybee.py
CHANGED
@@ -212,8 +212,33 @@ class Honeybee:
|
|
212
212
|
|
213
213
|
Parameters
|
214
214
|
----------
|
215
|
-
|
216
|
-
|
215
|
+
tpBuilding : topologic_core.CellComplex or topologic_core.Cell
|
216
|
+
The input building topology.
|
217
|
+
tpShadingFaceCluster : topologic_core.Cluster , optional
|
218
|
+
The input cluster for shading faces. The default is None.
|
219
|
+
buildingName : str , optional
|
220
|
+
The desired name of the building. The default is "Generic_Building".
|
221
|
+
defaultProgramIdentifier: str , optional
|
222
|
+
The desired default program identifier. The default is "Generic Office Program".
|
223
|
+
defaultConstructionSetIdentifier: str , optional
|
224
|
+
The desired default construction set identifier. The default is "Default Generic Construction Set".
|
225
|
+
coolingSetpoint : float , optional
|
226
|
+
The desired HVAC cooling set point in degrees Celsius. The default is 25.
|
227
|
+
heatingSetpoint : float , optional
|
228
|
+
The desired HVAC heating set point in degrees Celsius. The default is 20.
|
229
|
+
humidifyingSetpoint : float , optional
|
230
|
+
The desired HVAC humidifying set point in percentage. The default is 55.
|
231
|
+
roomNameKey : str , optional
|
232
|
+
The dictionary key under which the room name is stored. The default is "TOPOLOGIC_name".
|
233
|
+
roomTypeKey : str , optional
|
234
|
+
The dictionary key under which the room type is stored. The default is "TOPOLOGIC_type".
|
235
|
+
apertureTypeKey : str , optional
|
236
|
+
The dictionary key under which the aperture type is stored. The default is "TOPOLOGIC_type".
|
237
|
+
addSensorGrid : bool , optional
|
238
|
+
If set to True a sensor grid is add to horizontal surfaces. The default is False.
|
239
|
+
mantissa : int , optional
|
240
|
+
The desired length of the mantissa. The default is 6.
|
241
|
+
|
217
242
|
Returns
|
218
243
|
-------
|
219
244
|
HBModel
|
topologicpy/Plotly.py
CHANGED