topologicpy 0.7.38__py3-none-any.whl → 0.7.40__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 +2 -18
- topologicpy/Face.py +4 -8
- topologicpy/Graph.py +5 -5
- topologicpy/Grid.py +0 -2
- topologicpy/Helper.py +0 -34
- topologicpy/Neo4j.py +5 -3
- topologicpy/Polyskel.py +5 -1
- topologicpy/PyG.py +2067 -0
- topologicpy/Shell.py +2 -2
- topologicpy/Topology.py +0 -22
- topologicpy/Wire.py +3 -7
- topologicpy/version.py +1 -1
- {topologicpy-0.7.38.dist-info → topologicpy-0.7.40.dist-info}/METADATA +1 -1
- {topologicpy-0.7.38.dist-info → topologicpy-0.7.40.dist-info}/RECORD +17 -16
- {topologicpy-0.7.38.dist-info → topologicpy-0.7.40.dist-info}/LICENSE +0 -0
- {topologicpy-0.7.38.dist-info → topologicpy-0.7.40.dist-info}/WHEEL +0 -0
- {topologicpy-0.7.38.dist-info → topologicpy-0.7.40.dist-info}/top_level.txt +0 -0
topologicpy/ANN.py
CHANGED
@@ -471,27 +471,11 @@ class ANN():
|
|
471
471
|
----------
|
472
472
|
name : str
|
473
473
|
The name of the dataset. This can be one of ['breast_cancer', 'california_housing', 'digits', 'iris', 'wine']
|
474
|
-
|
475
|
-
trainRatio : float , optional
|
476
|
-
The ratio of the data to use for training and validation vs. the ratio to use for testing. The default is 0.6
|
477
|
-
which means that 60% of the data will be used for training and validation while 40% of the data will be reserved for testing.
|
478
|
-
randomState : int , optional
|
479
|
-
The randomState parameter is used to ensure reproducibility of the results. When you set the randomState parameter to a specific integer value,
|
480
|
-
it controls the shuffling of the data before splitting it into training and testing sets.
|
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
|
-
The default is 42 which is just a randomly picked integer number. Specify None for random sampling.
|
483
474
|
|
484
475
|
Returns
|
485
476
|
-------
|
486
|
-
|
487
|
-
|
488
|
-
XTrain, XTest, yTrain, yTest, inputSize, outputSize
|
489
|
-
XTrain is the list of features used for training
|
490
|
-
XTest is the list of features used for testing
|
491
|
-
yTrain is the list of targets used for training
|
492
|
-
yTest is the list of targets used for testing
|
493
|
-
inputSize is the size (length) of the input
|
494
|
-
outputSize is the size (length) of the output
|
477
|
+
sklearn.utils._bunch.Bunch
|
478
|
+
The created dataset.
|
495
479
|
"""
|
496
480
|
# Load dataset
|
497
481
|
if name == 'breast_cancer':
|
topologicpy/Face.py
CHANGED
@@ -521,8 +521,8 @@ class Face():
|
|
521
521
|
|
522
522
|
Returns
|
523
523
|
-------
|
524
|
-
topologic_core.
|
525
|
-
The created
|
524
|
+
topologic_core.Face
|
525
|
+
The created face.
|
526
526
|
|
527
527
|
"""
|
528
528
|
from topologicpy.Vertex import Vertex
|
@@ -2170,19 +2170,15 @@ class Face():
|
|
2170
2170
|
origin : topologic_core.Vertex , optional
|
2171
2171
|
The location of the origin of the squircle. The default is None which results in the squircle being placed at (0, 0, 0).
|
2172
2172
|
radius : float , optional
|
2173
|
-
The radius of the squircle. The default is 0.5.
|
2173
|
+
The desired radius of the squircle. The default is 0.5.
|
2174
2174
|
sides : int , optional
|
2175
|
-
The number of sides of the squircle. The default is 121.
|
2175
|
+
The desired number of sides of the squircle. The default is 121.
|
2176
2176
|
a : float , optional
|
2177
2177
|
The "a" factor affects the x position of the points to interpolate between a circle and a square.
|
2178
2178
|
A value of 1 will create a circle. Higher values will create a more square-like shape. The default is 2.0.
|
2179
2179
|
b : float , optional
|
2180
2180
|
The "b" factor affects the y position of the points to interpolate between a circle and a square.
|
2181
2181
|
A value of 1 will create a circle. Higher values will create a more square-like shape. The default is 2.0.
|
2182
|
-
radius : float , optional
|
2183
|
-
The desired radius of the squircle. The default is 0.5.
|
2184
|
-
sides : int , optional
|
2185
|
-
The desired number of sides for the squircle. The default is 100.
|
2186
2182
|
direction : list , optional
|
2187
2183
|
The vector representing the up direction of the circle. The default is [0, 0, 1].
|
2188
2184
|
placement : str , optional
|
topologicpy/Graph.py
CHANGED
@@ -2120,8 +2120,6 @@ class Graph:
|
|
2120
2120
|
|
2121
2121
|
def vertexByIFCObject(ifc_object, object_types, restrict=False):
|
2122
2122
|
settings = ifcopenshell.geom.settings()
|
2123
|
-
settings.set(settings.USE_BREP_DATA,False)
|
2124
|
-
settings.set(settings.SEW_SHELLS,True)
|
2125
2123
|
settings.set(settings.USE_WORLD_COORDS,True)
|
2126
2124
|
try:
|
2127
2125
|
shape = ifcopenshell.geom.create_shape(settings, ifc_object)
|
@@ -4686,6 +4684,8 @@ class Graph:
|
|
4686
4684
|
|
4687
4685
|
Parameters
|
4688
4686
|
----------
|
4687
|
+
adjacencyMatrix: list
|
4688
|
+
The input adjacency matrix.
|
4689
4689
|
path : str
|
4690
4690
|
The desired path to the output folder where the graphs, edges, and nodes CSV files will be saved.
|
4691
4691
|
|
@@ -4936,7 +4936,6 @@ class Graph:
|
|
4936
4936
|
The desired graph label column header. The default is "label".
|
4937
4937
|
graphFeaturesHeader : str , optional
|
4938
4938
|
The desired graph features column header. The default is "feat".
|
4939
|
-
|
4940
4939
|
edgeLabelKey : str , optional
|
4941
4940
|
The edge label dictionary key saved in each graph edge. The default is "label".
|
4942
4941
|
defaultEdgeLabel : int , optional
|
@@ -4971,7 +4970,6 @@ class Graph:
|
|
4971
4970
|
This value is ignored if an edgeMaskKey is foud.
|
4972
4971
|
bidirectional : bool , optional
|
4973
4972
|
If set to True, a reversed edge will also be saved for each edge in the graph. Otherwise, it will not. The default is True.
|
4974
|
-
|
4975
4973
|
nodeFeaturesKeys : list , optional
|
4976
4974
|
The list of features keys saved in the dicitonaries of nodes. The default is [].
|
4977
4975
|
nodeLabelKey : str , optional
|
@@ -7444,7 +7442,7 @@ class Graph:
|
|
7444
7442
|
The desired default vertex size. The default is 6.
|
7445
7443
|
vertexSizeKey : str , optional
|
7446
7444
|
If not set to None, the vertex size will be derived from the dictionary value set at this key. If set to "degree", the size of the vertex will be determined by its degree (number of neighbors). The default is None.
|
7447
|
-
vertexColor :
|
7445
|
+
vertexColor : str , optional
|
7448
7446
|
The desired default vertex color. his can be a named color or a hexadecimal value. The default is 'black'.
|
7449
7447
|
vertexColorKey : str , optional
|
7450
7448
|
If not set to None, the vertex color will be derived from the dictionary value set at this key. The default is None.
|
@@ -7884,6 +7882,8 @@ class Graph:
|
|
7884
7882
|
The dictionary key to use to display the edge label. The default is None.
|
7885
7883
|
edgeGroupKey : str , optional
|
7886
7884
|
The dictionary key to use to display the edge group. The default is None.
|
7885
|
+
edgeGroups : list , optional
|
7886
|
+
The list of edge groups against which to index the color of the edge. The default is [].
|
7887
7887
|
showEdges : bool , optional
|
7888
7888
|
If set to True the edges will be drawn. Otherwise, they will not be drawn. The default is True.
|
7889
7889
|
showEdgeLegend : bool , optional
|
topologicpy/Grid.py
CHANGED
@@ -307,8 +307,6 @@ class Grid():
|
|
307
307
|
----------
|
308
308
|
face : topologic_core.Face , optional
|
309
309
|
The input face. If set to None, the grid will be created on the XY plane. The default is None.
|
310
|
-
origin : topologic_core.Vertex , optional
|
311
|
-
The origin of the grid vertices. If set to None: if the face is set, the origin will be set to vertex at the face's 0,0 paratmer. If the face is set to None, the origin will be set to (0, 0, 0). The default is None.
|
312
310
|
uRange : list , optional
|
313
311
|
A list of *u* parameters for the *u* grid lines from the uOrigin. The default is [0.0,0.25,0.5,0.75,1.0].
|
314
312
|
vRange : list , optional
|
topologicpy/Helper.py
CHANGED
@@ -163,40 +163,6 @@ class Helper:
|
|
163
163
|
iterated_list.append(y)
|
164
164
|
return iterated_list
|
165
165
|
|
166
|
-
@staticmethod
|
167
|
-
def K_Means(data, k=4, maxIterations=100):
|
168
|
-
import random
|
169
|
-
def euclidean_distance(p, q):
|
170
|
-
return sum((pi - qi) ** 2 for pi, qi in zip(p, q)) ** 0.5
|
171
|
-
|
172
|
-
# Initialize k centroids randomly
|
173
|
-
centroids = random.sample(data, k)
|
174
|
-
|
175
|
-
for _ in range(maxIterations):
|
176
|
-
# Assign each data point to the nearest centroid
|
177
|
-
clusters = [[] for _ in range(k)]
|
178
|
-
for point in data:
|
179
|
-
distances = [euclidean_distance(point, centroid) for centroid in centroids]
|
180
|
-
nearest_centroid_index = distances.index(min(distances))
|
181
|
-
clusters[nearest_centroid_index].append(point)
|
182
|
-
|
183
|
-
# Compute the new centroids as the mean of the points in each cluster
|
184
|
-
new_centroids = []
|
185
|
-
for cluster in clusters:
|
186
|
-
if not cluster:
|
187
|
-
# If a cluster is empty, keep the previous centroid
|
188
|
-
new_centroids.append(centroids[clusters.index(cluster)])
|
189
|
-
else:
|
190
|
-
new_centroids.append([sum(dim) / len(cluster) for dim in zip(*cluster)])
|
191
|
-
|
192
|
-
# Check if the centroids have converged
|
193
|
-
if new_centroids == centroids:
|
194
|
-
break
|
195
|
-
|
196
|
-
centroids = new_centroids
|
197
|
-
|
198
|
-
return {'clusters': clusters, 'centroids': centroids}
|
199
|
-
|
200
166
|
@staticmethod
|
201
167
|
def MergeByThreshold(listA, threshold=0.0001):
|
202
168
|
"""
|
topologicpy/Neo4j.py
CHANGED
@@ -276,7 +276,7 @@ class Neo4j:
|
|
276
276
|
return Graph.ByVerticesEdges(vertices,edges)
|
277
277
|
|
278
278
|
@staticmethod
|
279
|
-
def AddGraph(neo4jGraph, graph, labelKey=None, relationshipKey=None,
|
279
|
+
def AddGraph(neo4jGraph, graph, labelKey=None, relationshipKey=None, mantissa: int = 6, tolerance: float = 0.0001):
|
280
280
|
"""
|
281
281
|
Adds the input topologic graph to the input neo4j graph
|
282
282
|
|
@@ -286,8 +286,10 @@ class Neo4j:
|
|
286
286
|
The input neo4j graph.
|
287
287
|
graph : topologic_core.Graph
|
288
288
|
The input topologic graph.
|
289
|
-
|
290
|
-
The
|
289
|
+
labelKey : str , optional
|
290
|
+
The label key in the dictionary under which to look for the label value.
|
291
|
+
relationshipKey: str , optional
|
292
|
+
The relationship key in the dictionary under which to look for the relationship value.
|
291
293
|
mantissa : int, optional
|
292
294
|
The desired length of the mantissa. The default is 6.
|
293
295
|
tolerance : float , optional
|
topologicpy/Polyskel.py
CHANGED
@@ -115,7 +115,11 @@ class Ray2:
|
|
115
115
|
return None # Rays are parallel and do not intersect
|
116
116
|
|
117
117
|
# Calculate the intersection point using vector algebra
|
118
|
-
|
118
|
+
denom = self.v.cross(other.v)
|
119
|
+
if not denom == 0:
|
120
|
+
t = (other.p - self.p).cross(other.v) / self.v.cross(other.v)
|
121
|
+
else:
|
122
|
+
return None
|
119
123
|
if t >= 0:
|
120
124
|
return self.p + self.v * t # Intersection point
|
121
125
|
else:
|