topologicpy 0.4.98__tar.gz → 0.5.0__tar.gz

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.
Files changed (97) hide show
  1. {topologicpy-0.4.98/src/topologicpy.egg-info → topologicpy-0.5.0}/PKG-INFO +1 -1
  2. {topologicpy-0.4.98 → topologicpy-0.5.0}/pyproject.toml +1 -1
  3. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Cell.py +9 -5
  4. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/CellComplex.py +3 -2
  5. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Cluster.py +3 -2
  6. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/DGL.py +5 -4
  7. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/EnergyModel.py +3 -2
  8. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Face.py +2 -1
  9. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Graph.py +6 -5
  10. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Helper.py +2 -1
  11. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Honeybee.py +6 -5
  12. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Neo4j.py +2 -1
  13. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Plotly.py +4 -3
  14. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Polyskel.py +2 -1
  15. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Shell.py +3 -2
  16. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Topology.py +109 -6
  17. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Vector.py +2 -1
  18. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Vertex.py +26 -21
  19. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/__init__.py +1 -1
  20. {topologicpy-0.4.98 → topologicpy-0.5.0/src/topologicpy.egg-info}/PKG-INFO +1 -1
  21. {topologicpy-0.4.98 → topologicpy-0.5.0}/LICENSE +0 -0
  22. {topologicpy-0.4.98 → topologicpy-0.5.0}/MANIFEST.in +0 -0
  23. {topologicpy-0.4.98 → topologicpy-0.5.0}/README.md +0 -0
  24. {topologicpy-0.4.98 → topologicpy-0.5.0}/setup.cfg +0 -0
  25. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Aperture.py +0 -0
  26. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Color.py +0 -0
  27. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Context.py +0 -0
  28. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Dictionary.py +0 -0
  29. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Edge.py +0 -0
  30. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Grid.py +0 -0
  31. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Matrix.py +0 -0
  32. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Speckle.py +0 -0
  33. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/Wire.py +0 -0
  34. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/__init__.py +0 -0
  35. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libTKBO-6bdf205d.so.7.7.0 +0 -0
  36. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libTKBRep-2960a069.so.7.7.0 +0 -0
  37. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libTKBool-c44b74bd.so.7.7.0 +0 -0
  38. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libTKFillet-9a670ba0.so.7.7.0 +0 -0
  39. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libTKG2d-8f31849e.so.7.7.0 +0 -0
  40. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libTKG3d-4c6bce57.so.7.7.0 +0 -0
  41. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libTKGeomAlgo-26066fd9.so.7.7.0 +0 -0
  42. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libTKGeomBase-2116cabe.so.7.7.0 +0 -0
  43. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libTKMath-72572fa8.so.7.7.0 +0 -0
  44. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libTKMesh-2a060427.so.7.7.0 +0 -0
  45. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libTKOffset-6cab68ff.so.7.7.0 +0 -0
  46. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libTKPrim-eb1262b3.so.7.7.0 +0 -0
  47. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libTKShHealing-e67e5cc7.so.7.7.0 +0 -0
  48. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libTKTopAlgo-e4c96c33.so.7.7.0 +0 -0
  49. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libTKernel-fb7fe3b7.so.7.7.0 +0 -0
  50. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libgcc_s-32c1665e.so.1 +0 -0
  51. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/libstdc++-672d7b41.so.6.0.30 +0 -0
  52. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/topologic.cpython-310-x86_64-linux-gnu.so +0 -0
  53. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/topologic.cpython-311-x86_64-linux-gnu.so +0 -0
  54. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/topologic.cpython-38-x86_64-linux-gnu.so +0 -0
  55. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic/topologic.cpython-39-x86_64-linux-gnu.so +0 -0
  56. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libTKBO-6bdf205d.so.7.7.0 +0 -0
  57. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libTKBRep-2960a069.so.7.7.0 +0 -0
  58. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libTKBool-c44b74bd.so.7.7.0 +0 -0
  59. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libTKFillet-9a670ba0.so.7.7.0 +0 -0
  60. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libTKG2d-8f31849e.so.7.7.0 +0 -0
  61. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libTKG3d-4c6bce57.so.7.7.0 +0 -0
  62. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libTKGeomAlgo-26066fd9.so.7.7.0 +0 -0
  63. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libTKGeomBase-2116cabe.so.7.7.0 +0 -0
  64. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libTKMath-72572fa8.so.7.7.0 +0 -0
  65. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libTKMesh-2a060427.so.7.7.0 +0 -0
  66. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libTKOffset-6cab68ff.so.7.7.0 +0 -0
  67. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libTKPrim-eb1262b3.so.7.7.0 +0 -0
  68. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libTKShHealing-e67e5cc7.so.7.7.0 +0 -0
  69. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libTKTopAlgo-e4c96c33.so.7.7.0 +0 -0
  70. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libTKernel-fb7fe3b7.so.7.7.0 +0 -0
  71. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libgcc_s-32c1665e.so.1 +0 -0
  72. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/linux/topologic.libs/libstdc++-672d7b41.so.6.0.30 +0 -0
  73. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/macos/topologic/__init__.py +0 -0
  74. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/TKBO-f6b191de.dll +0 -0
  75. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/TKBRep-e56a600e.dll +0 -0
  76. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/TKBool-7b8d47ae.dll +0 -0
  77. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/TKFillet-0ddbf0a8.dll +0 -0
  78. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/TKG2d-2e2dee3d.dll +0 -0
  79. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/TKG3d-6674513d.dll +0 -0
  80. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/TKGeomAlgo-d240e370.dll +0 -0
  81. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/TKGeomBase-df87aba5.dll +0 -0
  82. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/TKMath-45bd625a.dll +0 -0
  83. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/TKMesh-d6e826b1.dll +0 -0
  84. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/TKOffset-79b9cc94.dll +0 -0
  85. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/TKPrim-aa430a86.dll +0 -0
  86. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/TKShHealing-bb48be89.dll +0 -0
  87. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/TKTopAlgo-7d0d1e22.dll +0 -0
  88. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/TKernel-08c8cfbb.dll +0 -0
  89. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/__init__.py +0 -0
  90. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/topologic.cp310-win_amd64.pyd +0 -0
  91. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/topologic.cp311-win_amd64.pyd +0 -0
  92. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/topologic.cp38-win_amd64.pyd +0 -0
  93. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy/bin/windows/topologic/topologic.cp39-win_amd64.pyd +0 -0
  94. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy.egg-info/SOURCES.txt +0 -0
  95. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy.egg-info/dependency_links.txt +0 -0
  96. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy.egg-info/requires.txt +0 -0
  97. {topologicpy-0.4.98 → topologicpy-0.5.0}/src/topologicpy.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.4.98
3
+ Version: 0.5.0
4
4
  Summary: An Advanced Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
5
5
  Author-email: Wassim Jabi <wassim.jabi@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/wassimj/TopologicPy
@@ -3,7 +3,7 @@ requires = ["setuptools>=61"]
3
3
  build-backend = "setuptools.build_meta"
4
4
  [project]
5
5
  name = "topologicpy"
6
- version = "0.4.98"
6
+ version = "0.5.0"
7
7
  authors = [
8
8
  { name="Wassim Jabi", email="wassim.jabi@gmail.com" },
9
9
  ]
@@ -19,6 +19,7 @@ from topologicpy.Wire import Wire
19
19
  from topologicpy.Topology import Topology
20
20
  import math
21
21
  import os
22
+ import warnings
22
23
 
23
24
  try:
24
25
  import numpy as np
@@ -32,7 +33,7 @@ except:
32
33
  import numpy as np
33
34
  print("Cell - numpy library installed correctly.")
34
35
  except:
35
- raise Exception("Cell - Error: Could not import numpy.")
36
+ warnings.warn("Cell - Error: Could not import numpy.")
36
37
 
37
38
  class Cell(Topology):
38
39
  @staticmethod
@@ -1045,13 +1046,16 @@ class Cell(Topology):
1045
1046
  pentagons.append(Topology.Rotate(pen, origin=o, x=e_dir[0], y=e_dir[1], z=e_dir[2], degree=116.565))
1046
1047
 
1047
1048
  cluster = Cluster.ByTopologies(pentagons)
1048
- vertices = Topology.Vertices(cluster)
1049
+
1050
+ cluster2 = Topology.Rotate(cluster, origin=Vertex.Origin(), x=1,y=0,z=0,degree=180)
1051
+ cluster2 = Topology.Rotate(cluster2, origin=Vertex.Origin(), x=0,y=0,z=1,degree=36)
1052
+ vertices = Topology.Vertices(cluster2)
1049
1053
  zList = [Vertex.Z(v) for v in vertices]
1050
1054
  zList = list(set(zList))
1051
1055
  zList.sort()
1052
- zOffset = zList[1]+zList[2]
1053
- cluster2 = Topology.Rotate(cluster, origin=Vertex.Origin(), x=1,y=0,z=0,degree=180)
1054
- cluster2 = Topology.Translate(cluster2, 0, 0, zOffset)
1056
+ zoffset1 = zList[-1] - zList[0]
1057
+ zoffset2 = zList[1] - zList[0]
1058
+ cluster2 = Topology.Translate(cluster2, 0, 0, -zoffset1-zoffset2)
1055
1059
  pentagons += Topology.Faces(cluster2)
1056
1060
  dodecahedron = Cell.ByFaces(pentagons, tolerance=tolerance)
1057
1061
  centroid = Topology.Centroid(dodecahedron)
@@ -18,6 +18,7 @@ import topologic
18
18
  import math
19
19
  import os
20
20
  from topologicpy.Topology import Topology
21
+ import warnings
21
22
 
22
23
  try:
23
24
  import numpy as np
@@ -31,7 +32,7 @@ except:
31
32
  import numpy as np
32
33
  print("CellComplex - numpy library installed correctly.")
33
34
  except:
34
- raise Exception("CellComplex - Error: Could not import numpy.")
35
+ warnings.warn("CellComplex - Error: Could not import numpy.")
35
36
  try:
36
37
  from scipy.spatial import Delaunay
37
38
  from scipy.spatial import Voronoi
@@ -45,7 +46,7 @@ except:
45
46
  from scipy.spatial import Delaunay
46
47
  from scipy.spatial import Voronoi
47
48
  except:
48
- raise Exception("CellComplex - Error: Could not import scipy.")
49
+ warnings.warn("CellComplex - Error: Could not import scipy.")
49
50
 
50
51
  class CellComplex(Topology):
51
52
  @staticmethod
@@ -17,6 +17,7 @@
17
17
  from topologicpy.Topology import Topology
18
18
  import topologic
19
19
  import os
20
+ import warnings
20
21
 
21
22
  try:
22
23
  import numpy as np
@@ -30,7 +31,7 @@ except:
30
31
  import numpy as np
31
32
  print("Cluster - numpy library installed correctly.")
32
33
  except:
33
- raise Exception("Cluster - Error: Could not import numpy.")
34
+ warnings.warn("Cluster - Error: Could not import numpy.")
34
35
 
35
36
  try:
36
37
  from scipy.spatial.distance import pdist, squareform
@@ -44,7 +45,7 @@ except:
44
45
  from scipy.spatial.distance import pdist, squareform
45
46
  print("Cluster - scipy library installed correctly.")
46
47
  except:
47
- raise Exception("Cluster - Error: Could not import scipy.")
48
+ warnings.warn("Cluster - Error: Could not import scipy.")
48
49
 
49
50
  class Cluster(Topology):
50
51
  @staticmethod
@@ -17,6 +17,7 @@
17
17
  import os
18
18
  import random
19
19
  import copy
20
+ import warnings
20
21
  os.environ["DGLBACKEND"] = "pytorch"
21
22
 
22
23
  try:
@@ -31,7 +32,7 @@ except:
31
32
  import numpy as np
32
33
  print("DGL - numpy library installed correctly.")
33
34
  except:
34
- raise Exception("DGL - Error: Could not import numpy.")
35
+ warnings.warn("DGL - Error: Could not import numpy.")
35
36
 
36
37
  try:
37
38
  import pandas as pd
@@ -45,7 +46,7 @@ except:
45
46
  import pandas as pd
46
47
  print("DGL - pandas library installed correctly.")
47
48
  except:
48
- raise Exception("DGL - Error: Could not import pandas.")
49
+ warnings.warn("DGL - Error: Could not import pandas.")
49
50
 
50
51
  try:
51
52
  import torch
@@ -67,7 +68,7 @@ except:
67
68
  from torch.utils.data import DataLoader, ConcatDataset
68
69
  print("DGL - torch library installed correctly.")
69
70
  except:
70
- raise Exception("DGL - Error: Could not import torch.")
71
+ warnings.warn("DGL - Error: Could not import torch.")
71
72
 
72
73
  try:
73
74
  import dgl
@@ -91,7 +92,7 @@ except:
91
92
  from dgl import save_graphs, load_graphs
92
93
  print("DGL - dgl library installed correctly.")
93
94
  except:
94
- raise Exception("DGL - Error: Could not import dgl. The installation of the correct version of the dgl library is not trivial and is highly dependent on your hardward and software configuration. Please consult the dgl installation instructions.")
95
+ warnings.warn("DGL - Error: Could not import dgl. The installation of the correct version of the dgl library is not trivial and is highly dependent on your hardward and software configuration. Please consult the dgl installation instructions.")
95
96
 
96
97
  try:
97
98
  from sklearn import metrics
@@ -21,6 +21,7 @@ from collections import OrderedDict
21
21
  import os
22
22
  from os.path import exists
23
23
  from datetime import datetime
24
+ import warnings
24
25
 
25
26
  try:
26
27
  from tqdm.auto import tqdm
@@ -34,7 +35,7 @@ except:
34
35
  from tqdm.auto import tqdm
35
36
  print("EnergyModel - tqdm library installed correctly.")
36
37
  except:
37
- raise Exception("EnergyModel - Error: Could not import tqdm.")
38
+ warnings.warn("EnergyModel - Error: Could not import tqdm.")
38
39
 
39
40
  try:
40
41
  import openstudio
@@ -50,7 +51,7 @@ except:
50
51
  openstudio.Logger.instance().standardOutLogger().setLogLevel(openstudio.Fatal)
51
52
  print("EnergyModel - openstudio library installed correctly.")
52
53
  except:
53
- raise Exception("EnergyModel - Error: Could not import openstudio.")
54
+ warnings.warn("EnergyModel - Error: Could not import openstudio.")
54
55
 
55
56
  class EnergyModel:
56
57
  '''
@@ -20,6 +20,7 @@ from topologicpy.Wire import Wire
20
20
  from topologicpy.Topology import Topology
21
21
  import math
22
22
  import os
23
+ import warnings
23
24
 
24
25
  try:
25
26
  import numpy as np
@@ -33,7 +34,7 @@ except:
33
34
  import numpy as np
34
35
  print("Face - numpy library installed correctly.")
35
36
  except:
36
- raise Exception("Face - Error: Could not import numpy.")
37
+ warnings.warn("Face - Error: Could not import numpy.")
37
38
 
38
39
  class Face(Topology):
39
40
  @staticmethod
@@ -22,6 +22,7 @@ from topologicpy.Vertex import Vertex
22
22
  import random
23
23
  import time
24
24
  import os
25
+ import warnings
25
26
 
26
27
  try:
27
28
  import numpy as np
@@ -35,7 +36,7 @@ except:
35
36
  import numpy as np
36
37
  print("Graph - numpy library installed correctly.")
37
38
  except:
38
- raise Exception("Graph - Error: Could not import numpy.")
39
+ warnings.warn("Graph - Error: Could not import numpy.")
39
40
 
40
41
  try:
41
42
  import pandas as pd
@@ -49,7 +50,7 @@ except:
49
50
  import pandas as pd
50
51
  print("Graph - pandas library installed correctly.")
51
52
  except:
52
- raise Exception("Graph - Error: Could not import pandas.")
53
+ warnings.warn("Graph - Error: Could not import pandas.")
53
54
 
54
55
  try:
55
56
  from tqdm.auto import tqdm
@@ -63,7 +64,7 @@ except:
63
64
  from tqdm.auto import tqdm
64
65
  print("Graph - tqdm library installed correctly.")
65
66
  except:
66
- raise Exception("Graph - Error: Could not import tqdm.")
67
+ warnings.warn("Graph - Error: Could not import tqdm.")
67
68
 
68
69
  try:
69
70
  from pyvis.network import Network
@@ -77,7 +78,7 @@ except:
77
78
  from pyvis.network import Network
78
79
  print("Graph - pyvis library installed correctly.")
79
80
  except:
80
- raise Exception("Graph - Error: Could not import pyvis")
81
+ rwarnings.warn("Graph - Error: Could not import pyvis")
81
82
 
82
83
  try:
83
84
  import networkx as nx
@@ -91,7 +92,7 @@ except:
91
92
  import networkx as nx
92
93
  print("Graph - networkx library installed correctly.")
93
94
  except:
94
- raise Exception("Graph - Error: Could not import networkx.")
95
+ warnings.warn("Graph - Error: Could not import networkx.")
95
96
 
96
97
  class _Tree:
97
98
  def __init__(self, node="", *children):
@@ -16,6 +16,7 @@
16
16
 
17
17
  import topologicpy
18
18
  import os
19
+ import warnings
19
20
 
20
21
  try:
21
22
  import numpy as np
@@ -31,7 +32,7 @@ except:
31
32
  import numpy.linalg as la
32
33
  print("Helper - numpy library installed correctly.")
33
34
  except:
34
- raise Exception("Helper - Error: Could not import numpy.")
35
+ warnings.warn("Helper - Error: Could not import numpy.")
35
36
 
36
37
  class Helper:
37
38
  @staticmethod
@@ -15,6 +15,7 @@
15
15
  # this program. If not, see <https://www.gnu.org/licenses/>.
16
16
 
17
17
  import os
18
+ import warnings
18
19
 
19
20
  try:
20
21
  import honeybee.facetype
@@ -39,7 +40,7 @@ except:
39
40
  from honeybee.aperture import Aperture as HBAperture
40
41
  from honeybee.door import Door as HBDoor
41
42
  except:
42
- raise Exception("Honeybee - ERROR: Could not import honeybee")
43
+ warnings.warn("Honeybee - ERROR: Could not import honeybee")
43
44
 
44
45
  try:
45
46
  import honeybee_energy.lib.constructionsets as constr_set_lib
@@ -64,7 +65,7 @@ except:
64
65
  from honeybee_energy.load.setpoint import Setpoint
65
66
  from honeybee_energy.load.hotwater import ServiceHotWater
66
67
  except:
67
- raise Exception("Honeybee - Error: Could not import honeybee-energy")
68
+ warnings.warn("Honeybee - Error: Could not import honeybee-energy")
68
69
 
69
70
  try:
70
71
  from honeybee_radiance.sensorgrid import SensorGrid
@@ -77,7 +78,7 @@ except:
77
78
  try:
78
79
  from honeybee_radiance.sensorgrid import SensorGrid
79
80
  except:
80
- raise Exception("Honeybee - Error: Could not import honeybee-radiance")
81
+ warnings.warn("Honeybee - Error: Could not import honeybee-radiance")
81
82
 
82
83
  try:
83
84
  from ladybug.dt import Time
@@ -90,7 +91,7 @@ except:
90
91
  try:
91
92
  from ladybug.dt import Time
92
93
  except:
93
- raise Exception("Honeybee - Error: Could not import ladybug")
94
+ warnings.warn("Honeybee - Error: Could not import ladybug")
94
95
 
95
96
  try:
96
97
  from ladybug_geometry.geometry3d.face import Face3D
@@ -105,7 +106,7 @@ except:
105
106
  from ladybug_geometry.geometry3d.face import Face3D
106
107
  from ladybug_geometry.geometry3d.pointvector import Point3D, Vector3D
107
108
  except:
108
- raise Exception("Honeybee - Error: Could not import ladybug-geometry")
109
+ warnings.warn("Honeybee - Error: Could not import ladybug-geometry")
109
110
 
110
111
  import json
111
112
  import topologic
@@ -17,6 +17,7 @@
17
17
  import time
18
18
  import random
19
19
  import os
20
+ import warnings
20
21
 
21
22
  try:
22
23
  import py2neo
@@ -33,7 +34,7 @@ except:
33
34
  from py2neo import NodeMatcher,RelationshipMatcher
34
35
  from py2neo.data import spatial as sp
35
36
  except:
36
- raise Exception("Neo4j - Error: Could not import py2neo")
37
+ warnings.warn("Neo4j - Error: Could not import py2neo")
37
38
 
38
39
  class Neo4j:
39
40
 
@@ -20,6 +20,7 @@ import topologic
20
20
  from topologicpy.Wire import Wire
21
21
  from topologicpy.Face import Face
22
22
  import os
23
+ import warnings
23
24
 
24
25
  try:
25
26
  import numpy as np
@@ -32,7 +33,7 @@ except:
32
33
  try:
33
34
  import numpy as np
34
35
  except:
35
- raise Exception("Plotly - Error: Could not import numpy.")
36
+ warnings.warn("Plotly - Error: Could not import numpy.")
36
37
 
37
38
  try:
38
39
  import pandas as pd
@@ -45,7 +46,7 @@ except:
45
46
  try:
46
47
  import pandas as pd
47
48
  except:
48
- raise Exception("Plotly - Error: Could not import pandas.")
49
+ warnings.warn("Plotly - Error: Could not import pandas.")
49
50
 
50
51
  try:
51
52
  import plotly
@@ -62,7 +63,7 @@ except:
62
63
  import plotly.graph_objects as go
63
64
  import plotly.offline as ofl
64
65
  except:
65
- raise Exception("Plotly - Error: Could not import plotly.")
66
+ warnings.warn("Plotly - Error: Could not import plotly.")
66
67
 
67
68
  class Plotly:
68
69
  @staticmethod
@@ -20,6 +20,7 @@ import heapq
20
20
  from itertools import *
21
21
  from collections import namedtuple
22
22
  import os
23
+ import warnings
23
24
 
24
25
  try:
25
26
  from euclid3 import *
@@ -32,7 +33,7 @@ except:
32
33
  try:
33
34
  from euclid3 import *
34
35
  except:
35
- raise Exception("Polyskel - ERROR: Could not import euclid3.")
36
+ warnings.warn("Polyskel - ERROR: Could not import euclid3.")
36
37
 
37
38
  log = logging.getLogger("__name__")
38
39
 
@@ -18,6 +18,7 @@ import topologic
18
18
  from topologicpy.Topology import Topology
19
19
  import math
20
20
  import os
21
+ import warnings
21
22
 
22
23
  try:
23
24
  from tqdm.auto import tqdm
@@ -31,7 +32,7 @@ except:
31
32
  from tqdm.auto import tqdm
32
33
  print("Shell - tqdm library installed correctly.")
33
34
  except:
34
- raise Exception("Shell - Error: Could not import tqdm.")
35
+ warnings.warn("Shell - Error: Could not import tqdm.")
35
36
 
36
37
  try:
37
38
  from scipy.spatial import Delaunay
@@ -46,7 +47,7 @@ except:
46
47
  from scipy.spatial import Delaunay
47
48
  from scipy.spatial import Voronoi
48
49
  except:
49
- raise Exception("Shell - Error: Could not import scipy.")
50
+ warnings.warn("Shell - Error: Could not import scipy.")
50
51
 
51
52
  class Shell(Topology):
52
53
  @staticmethod
@@ -17,7 +17,7 @@
17
17
  import topologic
18
18
  from topologicpy.Aperture import Aperture
19
19
  from topologicpy.Dictionary import Dictionary
20
-
20
+ import warnings
21
21
  import uuid
22
22
  import json
23
23
  import os
@@ -42,7 +42,7 @@ except:
42
42
  from numpy.linalg import norm
43
43
  print("Topology - numpy library installed successfully.")
44
44
  except:
45
- raise Exception("Topology - Error: Could not import numpy.")
45
+ warnings.warn("Topology - Error: Could not import numpy.")
46
46
 
47
47
  try:
48
48
  import ifcopenshell
@@ -58,7 +58,7 @@ except:
58
58
  import ifcopenshell.geom
59
59
  print("Topology - ifcopenshell library installed successfully.")
60
60
  except:
61
- raise Exception("Topology - Error: Could not import ifcopenshell.")
61
+ warnings.warn("Topology - Error: Could not import ifcopenshell.")
62
62
 
63
63
  try:
64
64
  from scipy.spatial import ConvexHull
@@ -72,7 +72,7 @@ except:
72
72
  from scipy.spatial import ConvexHull
73
73
  print("Topology - scipy library installed successfully.")
74
74
  except:
75
- raise Exception ("Topology - Error: Could not import scipy.")
75
+ warnings.warn("Topology - Error: Could not import scipy.")
76
76
 
77
77
  QueueItem = namedtuple('QueueItem', ['ID', 'sinkKeys', 'sinkValues'])
78
78
  SinkItem = namedtuple('SinkItem', ['ID', 'sink_str'])
@@ -278,8 +278,8 @@ class Topology():
278
278
  ----------
279
279
  topology : topologic.Topology
280
280
  The input topology.
281
- conntents : list
282
- The input list of contents.
281
+ conntents : list or topologic.Topology
282
+ The input list of contents (of type topologic.Topology). A single topology is also accepted as input.
283
283
  subTopologyType : string , optional
284
284
  The subtopology type to which to add the contents. This can be "cellcomplex", "cell", "shell", "face", "wire", "edge", or "vertex". It is case insensitive. If set to None, the contents will be added to the input topology. The default is None.
285
285
  tolerance : float , optional
@@ -296,6 +296,8 @@ class Topology():
296
296
  return None
297
297
  if not contents:
298
298
  return topology
299
+ if not isinstance(contents, list):
300
+ contents = [contents]
299
301
  if not isinstance(contents, list):
300
302
  print("Topology.AddContent - Error: the input contents parameter is not a list. Returning None.")
301
303
  return None
@@ -5454,6 +5456,56 @@ class Topology():
5454
5456
  _ = topology.SetDictionary(dictionary)
5455
5457
  return topology
5456
5458
 
5459
+ @staticmethod
5460
+ def SetSnapshot(topology, snapshot=None, timestamp=None, key="timestamp", silent=False):
5461
+ from datetime import datetime
5462
+ def is_valid_timestamp(timestamp):
5463
+ if isinstance(timestamp, datetime):
5464
+ return True
5465
+ elif isinstance(timestamp, str):
5466
+ try:
5467
+ # Split the timestamp string into date and time parts
5468
+ date_part, time_part = timestamp.split(' ')
5469
+ # Parse the date part
5470
+ date_obj = datetime.strptime(date_part, '%Y-%m-%d')
5471
+ # Split the time part into hours, minutes, and seconds
5472
+ hours, minutes, seconds = map(float, time_part.split(':'))
5473
+ # Check if seconds are within valid range
5474
+ if seconds < 0 or seconds >= 60:
5475
+ return False
5476
+ # Create a datetime object with the parsed date and time parts
5477
+ datetime_obj = datetime(date_obj.year, date_obj.month, date_obj.day, int(hours), int(minutes), int(seconds))
5478
+ return True
5479
+ except ValueError:
5480
+ return False
5481
+ else:
5482
+ return False
5483
+
5484
+ if not isinstance(topology, topologic.Topology):
5485
+ if not silent:
5486
+ print("Topology.SetSnapshot - Error: The input topology parameter is not a valid topology. Returning None.")
5487
+ return None
5488
+ if not isinstance(snapshot, topologic.Topology):
5489
+ snapshot = Topology.Copy(topology)
5490
+ d = Topology.Dictionary(topology)
5491
+ snapshot = Topology.SetDictionary(snapshot, d)
5492
+ if not isinstance(snapshot, topologic.Topology):
5493
+ if not silent:
5494
+ print("Topology.SetSnapshot - Error: The input snapshot parameter is not a valid topology. Returning None.")
5495
+ return None
5496
+ if timestamp == None:
5497
+ timestamp = datetime.now()
5498
+ if not is_valid_timestamp(timestamp):
5499
+ if not silent:
5500
+ print("Topology.SetSnapshot - Error: The input timestamp parameter is not a valid timestamp. Returning None.")
5501
+ return None
5502
+
5503
+ d = Topology.Dictionary(snapshot)
5504
+ d = Dictionary.SetValueAtKey(d, key, str(timestamp))
5505
+ snapshot = Topology.SetDictionary(snapshot, d)
5506
+ topology = Topology.AddContent(topology, snapshot)
5507
+ return topology
5508
+
5457
5509
  @staticmethod
5458
5510
  def SharedTopologies(topologyA, topologyB):
5459
5511
  """
@@ -5895,6 +5947,57 @@ class Topology():
5895
5947
  unsortedTopologies.append(topologies[i])
5896
5948
  return {"sorted":sortedTopologies, "unsorted":unsortedTopologies}
5897
5949
 
5950
+ @staticmethod
5951
+ def Snapshots(topology, key="timestamp", start=None, end=None, silent=False):
5952
+ from datetime import datetime
5953
+ def is_valid_timestamp(timestamp):
5954
+ if isinstance(timestamp, datetime):
5955
+ return True
5956
+ elif isinstance(timestamp, str):
5957
+ try:
5958
+ # Split the timestamp string into date and time parts
5959
+ date_part, time_part = timestamp.split(' ')
5960
+ # Parse the date part
5961
+ date_obj = datetime.strptime(date_part, '%Y-%m-%d')
5962
+ # Split the time part into hours, minutes, and seconds
5963
+ hours, minutes, seconds = map(float, time_part.split(':'))
5964
+ # Check if seconds are within valid range
5965
+ if seconds < 0 or seconds >= 60:
5966
+ return False
5967
+ # Create a datetime object with the parsed date and time parts
5968
+ return datetime(date_obj.year, date_obj.month, date_obj.day, int(hours), int(minutes), int(seconds))
5969
+ except ValueError:
5970
+ return False
5971
+ else:
5972
+ return False
5973
+
5974
+ if not isinstance(topology, topologic.Topology):
5975
+ if not silent:
5976
+ print("Topology.Snapshots - Error: The input topology parameter is not a valid topology. Returning None.")
5977
+ return None
5978
+ if start == None:
5979
+ start = datetime.datetime(year=1900, month=1, day=1) # Set the start date to a date in the distant past
5980
+ if end == None:
5981
+ end = datetime.now() # Set the end date to the present.
5982
+ if not is_valid_timestamp(start):
5983
+ if not silent:
5984
+ print("Topology.Snapshots - Error: The input start parameter is not a valid timestamp. Returning None.")
5985
+ return None
5986
+ if not is_valid_timestamp(end):
5987
+ if not silent:
5988
+ print("Topology.Snapshots - Error: The input end parameter is not a valid timestamp. Returning None.")
5989
+ return None
5990
+ contents = Topology.Contents(topology)
5991
+ snapshots = []
5992
+ for content in contents:
5993
+ d = Topology.Dictionary(content)
5994
+ timestamp = Dictionary.ValueAtKey(d, key)
5995
+ timestamp = is_valid_timestamp(timestamp)
5996
+ if not timestamp == False:
5997
+ if start <= timestamp <= end:
5998
+ snapshots.append(content)
5999
+ return snapshots
6000
+
5898
6001
  @staticmethod
5899
6002
  def Spin(topology, origin=None, triangulate=True, direction=[0,0,1], degree=360, sides=16,
5900
6003
  tolerance=0.0001, silent=False):
@@ -16,6 +16,7 @@
16
16
 
17
17
  import math
18
18
  import os
19
+ import warnings
19
20
 
20
21
  try:
21
22
  import numpy as np
@@ -33,7 +34,7 @@ except:
33
34
  from numpy import pi, arctan2, rad2deg
34
35
  print("Vector - numpy library installed successfully.")
35
36
  except:
36
- raise Exception("Vector - Error: Could not import numpy.")
37
+ warnings.warn("Vector - Error: Could not import numpy.")
37
38
 
38
39
  class Vector(list):
39
40
  @staticmethod
@@ -20,6 +20,7 @@ from topologicpy.Face import Face
20
20
  from topologicpy.Topology import Topology
21
21
  import collections
22
22
  import os
23
+ import warnings
23
24
 
24
25
  try:
25
26
  import numpy as np
@@ -33,7 +34,7 @@ except:
33
34
  import numpy as np
34
35
  print("Vertex - numpy library installed successfully.")
35
36
  except:
36
- raise Exception("Vertex - Error: Could not import numpy.")
37
+ warnings.warn("Vertex - Error: Could not import numpy.")
37
38
 
38
39
  class Vertex(Topology):
39
40
  @staticmethod
@@ -1476,31 +1477,35 @@ class Vertex(Topology):
1476
1477
  """
1477
1478
  from topologicpy.Face import Face
1478
1479
 
1479
- def project_point_onto_plane(point, plane_coeffs):
1480
+ def project_point_onto_plane(point, plane_coeffs, direction_vector):
1480
1481
  """
1481
- Project a point onto a plane defined by its equation coefficients (a, b, c, d).
1482
-
1483
- Args:
1484
- point: A tuple or list containing the coordinates of the point (x, y, z).
1485
- plane_coeffs: A tuple or list containing the plane equation coefficients (a, b, c, d).
1486
-
1482
+ Project a 3D point onto a plane defined by its coefficients and using a direction vector.
1483
+
1484
+ Parameters:
1485
+ point (tuple or list): The 3D point coordinates (x, y, z).
1486
+ plane_coeffs (tuple or list): The coefficients of the plane equation (a, b, c, d).
1487
+ direction_vector (tuple or list): The direction vector (vx, vy, vz).
1488
+
1487
1489
  Returns:
1488
- projected_point: A tuple containing the coordinates of the projected point (x_proj, y_proj, z_proj).
1490
+ tuple: The projected point coordinates (x_proj, y_proj, z_proj).
1489
1491
  """
1492
+ # Unpack point coordinates
1490
1493
  x, y, z = point
1494
+
1495
+ # Unpack plane coefficients
1491
1496
  a, b, c, d = plane_coeffs
1492
-
1497
+
1498
+ # Unpack direction vector
1499
+ vx, vy, vz = direction_vector
1500
+
1493
1501
  # Calculate the distance from the point to the plane
1494
- if (a**2 + b**2 + c**2) == 0:
1495
- distance = 0
1496
- else:
1497
- distance = (a * x + b * y + c * z + d) / (a**2 + b**2 + c**2)
1498
-
1499
- # Calculate the coordinates of the projected point
1500
- x_proj = round(x - distance * a, mantissa)
1501
- y_proj = round(y - distance * b, mantissa)
1502
- z_proj = round(z - distance * c, mantissa)
1503
-
1502
+ distance = (a * x + b * y + c * z + d) / (a * vx + b * vy + c * vz)
1503
+
1504
+ # Calculate the projected point coordinates
1505
+ x_proj = x - distance * vx
1506
+ y_proj = y - distance * vy
1507
+ z_proj = z - distance * vz
1508
+
1504
1509
  return [x_proj, y_proj, z_proj]
1505
1510
 
1506
1511
  if not isinstance(vertex, topologic.Vertex):
@@ -1508,7 +1513,7 @@ class Vertex(Topology):
1508
1513
  if not isinstance(face, topologic.Face):
1509
1514
  return None
1510
1515
  eq = Face.PlaneEquation(face, mantissa= mantissa)
1511
- pt = project_point_onto_plane(Vertex.Coordinates(vertex), [eq["a"], eq["b"], eq["c"], eq["d"]])
1516
+ pt = project_point_onto_plane(Vertex.Coordinates(vertex), [eq["a"], eq["b"], eq["c"], eq["d"]], direction)
1512
1517
  return Vertex.ByCoordinates(pt[0], pt[1], pt[2])
1513
1518
 
1514
1519
  @staticmethod
@@ -18,7 +18,7 @@ import sys
18
18
  import os, re
19
19
  from sys import platform
20
20
 
21
- __version__ = '0.4.98'
21
+ __version__ = '0.5.0'
22
22
  __version_info__ = tuple([ int(num) for num in __version__.split('.')])
23
23
 
24
24
  if platform == 'win32':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.4.98
3
+ Version: 0.5.0
4
4
  Summary: An Advanced Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
5
5
  Author-email: Wassim Jabi <wassim.jabi@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/wassimj/TopologicPy
File without changes
File without changes
File without changes
File without changes