topologicpy 0.5.7__tar.gz → 0.5.9__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 (98) hide show
  1. {topologicpy-0.5.7/src/topologicpy.egg-info → topologicpy-0.5.9}/PKG-INFO +2 -12
  2. {topologicpy-0.5.7 → topologicpy-0.5.9}/pyproject.toml +2 -12
  3. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Color.py +33 -3
  4. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/DGL.py +122 -18
  5. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Dictionary.py +3 -0
  6. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/EnergyModel.py +18 -37
  7. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Face.py +21 -14
  8. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Graph.py +111 -43
  9. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Topology.py +90 -32
  10. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/__init__.py +1 -1
  11. {topologicpy-0.5.7 → topologicpy-0.5.9/src/topologicpy.egg-info}/PKG-INFO +2 -12
  12. topologicpy-0.5.9/src/topologicpy.egg-info/requires.txt +6 -0
  13. topologicpy-0.5.7/src/topologicpy.egg-info/requires.txt +0 -16
  14. {topologicpy-0.5.7 → topologicpy-0.5.9}/LICENSE +0 -0
  15. {topologicpy-0.5.7 → topologicpy-0.5.9}/MANIFEST.in +0 -0
  16. {topologicpy-0.5.7 → topologicpy-0.5.9}/README.md +0 -0
  17. {topologicpy-0.5.7 → topologicpy-0.5.9}/setup.cfg +0 -0
  18. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Aperture.py +0 -0
  19. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Cell.py +0 -0
  20. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/CellComplex.py +0 -0
  21. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Cluster.py +0 -0
  22. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Context.py +0 -0
  23. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Edge.py +0 -0
  24. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Grid.py +0 -0
  25. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Helper.py +0 -0
  26. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Honeybee.py +0 -0
  27. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Matrix.py +0 -0
  28. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Neo4j.py +0 -0
  29. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Plotly.py +0 -0
  30. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Polyskel.py +0 -0
  31. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Shell.py +0 -0
  32. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Speckle.py +0 -0
  33. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Vector.py +0 -0
  34. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Vertex.py +0 -0
  35. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/Wire.py +0 -0
  36. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/__init__.py +0 -0
  37. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKBO-6bdf205d.so.7.7.0 +0 -0
  38. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKBRep-2960a069.so.7.7.0 +0 -0
  39. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKBool-c44b74bd.so.7.7.0 +0 -0
  40. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKFillet-9a670ba0.so.7.7.0 +0 -0
  41. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKG2d-8f31849e.so.7.7.0 +0 -0
  42. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKG3d-4c6bce57.so.7.7.0 +0 -0
  43. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKGeomAlgo-26066fd9.so.7.7.0 +0 -0
  44. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKGeomBase-2116cabe.so.7.7.0 +0 -0
  45. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKMath-72572fa8.so.7.7.0 +0 -0
  46. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKMesh-2a060427.so.7.7.0 +0 -0
  47. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKOffset-6cab68ff.so.7.7.0 +0 -0
  48. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKPrim-eb1262b3.so.7.7.0 +0 -0
  49. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKShHealing-e67e5cc7.so.7.7.0 +0 -0
  50. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKTopAlgo-e4c96c33.so.7.7.0 +0 -0
  51. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKernel-fb7fe3b7.so.7.7.0 +0 -0
  52. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libgcc_s-32c1665e.so.1 +0 -0
  53. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libstdc++-672d7b41.so.6.0.30 +0 -0
  54. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/topologic.cpython-310-x86_64-linux-gnu.so +0 -0
  55. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/topologic.cpython-311-x86_64-linux-gnu.so +0 -0
  56. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/topologic.cpython-38-x86_64-linux-gnu.so +0 -0
  57. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/topologic.cpython-39-x86_64-linux-gnu.so +0 -0
  58. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKBO-6bdf205d.so.7.7.0 +0 -0
  59. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKBRep-2960a069.so.7.7.0 +0 -0
  60. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKBool-c44b74bd.so.7.7.0 +0 -0
  61. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKFillet-9a670ba0.so.7.7.0 +0 -0
  62. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKG2d-8f31849e.so.7.7.0 +0 -0
  63. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKG3d-4c6bce57.so.7.7.0 +0 -0
  64. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKGeomAlgo-26066fd9.so.7.7.0 +0 -0
  65. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKGeomBase-2116cabe.so.7.7.0 +0 -0
  66. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKMath-72572fa8.so.7.7.0 +0 -0
  67. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKMesh-2a060427.so.7.7.0 +0 -0
  68. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKOffset-6cab68ff.so.7.7.0 +0 -0
  69. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKPrim-eb1262b3.so.7.7.0 +0 -0
  70. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKShHealing-e67e5cc7.so.7.7.0 +0 -0
  71. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKTopAlgo-e4c96c33.so.7.7.0 +0 -0
  72. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKernel-fb7fe3b7.so.7.7.0 +0 -0
  73. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libgcc_s-32c1665e.so.1 +0 -0
  74. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libstdc++-672d7b41.so.6.0.30 +0 -0
  75. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/macos/topologic/__init__.py +0 -0
  76. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKBO-f6b191de.dll +0 -0
  77. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKBRep-e56a600e.dll +0 -0
  78. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKBool-7b8d47ae.dll +0 -0
  79. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKFillet-0ddbf0a8.dll +0 -0
  80. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKG2d-2e2dee3d.dll +0 -0
  81. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKG3d-6674513d.dll +0 -0
  82. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKGeomAlgo-d240e370.dll +0 -0
  83. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKGeomBase-df87aba5.dll +0 -0
  84. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKMath-45bd625a.dll +0 -0
  85. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKMesh-d6e826b1.dll +0 -0
  86. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKOffset-79b9cc94.dll +0 -0
  87. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKPrim-aa430a86.dll +0 -0
  88. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKShHealing-bb48be89.dll +0 -0
  89. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKTopAlgo-7d0d1e22.dll +0 -0
  90. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKernel-08c8cfbb.dll +0 -0
  91. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/__init__.py +0 -0
  92. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/topologic.cp310-win_amd64.pyd +0 -0
  93. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/topologic.cp311-win_amd64.pyd +0 -0
  94. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/topologic.cp38-win_amd64.pyd +0 -0
  95. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/topologic.cp39-win_amd64.pyd +0 -0
  96. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy.egg-info/SOURCES.txt +0 -0
  97. {topologicpy-0.5.7 → topologicpy-0.5.9}/src/topologicpy.egg-info/dependency_links.txt +0 -0
  98. {topologicpy-0.5.7 → topologicpy-0.5.9}/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.5.7
3
+ Version: 0.5.9
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
@@ -13,21 +13,11 @@ Requires-Python: <3.12,>=3.8
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: numpy
16
- Requires-Dist: pandas
17
16
  Requires-Dist: scipy
18
- Requires-Dist: scikit-learn
19
- Requires-Dist: ifcopenshell
20
- Requires-Dist: ladybug
21
- Requires-Dist: honeybee
22
- Requires-Dist: honeybee-energy
23
- Requires-Dist: networkx
24
- Requires-Dist: openstudio
17
+ Requires-Dist: pandas
25
18
  Requires-Dist: tqdm
26
19
  Requires-Dist: plotly
27
- Requires-Dist: pyvis
28
20
  Requires-Dist: lark
29
- Requires-Dist: webcolors
30
- Requires-Dist: rdflib
31
21
 
32
22
  # topologicpy
33
23
 
@@ -3,7 +3,7 @@ requires = ["setuptools>=61"]
3
3
  build-backend = "setuptools.build_meta"
4
4
  [project]
5
5
  name = "topologicpy"
6
- version = "0.5.7"
6
+ version = "0.5.9"
7
7
  authors = [
8
8
  { name="Wassim Jabi", email="wassim.jabi@gmail.com" },
9
9
  ]
@@ -17,21 +17,11 @@ classifiers = [
17
17
  ]
18
18
  dependencies = [
19
19
  "numpy",
20
- "pandas",
21
20
  "scipy",
22
- "scikit-learn",
23
- "ifcopenshell",
24
- "ladybug",
25
- "honeybee",
26
- "honeybee-energy",
27
- "networkx",
28
- "openstudio",
21
+ "pandas",
29
22
  "tqdm",
30
23
  "plotly",
31
- "pyvis",
32
24
  "lark",
33
- "webcolors",
34
- "rdflib",
35
25
  ]
36
26
  [project.urls]
37
27
  "Homepage" = "https://github.com/wassimj/TopologicPy"
@@ -35,7 +35,23 @@ class Color:
35
35
  list
36
36
  The color expressed as an [r, g, b] or an [r, g, b, a] list.
37
37
  """
38
- import webcolors
38
+ import warnings
39
+ import os
40
+ try:
41
+ import webcolors
42
+ except:
43
+ print("Color.ByCSSNamedColor - Information: Installing required webcolors library.")
44
+ try:
45
+ os.system("pip install webcolors")
46
+ except:
47
+ os.system("pip install webcolors --user")
48
+ try:
49
+ import webcolors
50
+ print("Color.ByCSSNamedColor - Information: webcolors library installed correctly.")
51
+ except:
52
+ warnings.warn("Color.ByCSSNamedColor - Error: Could not import webcolors library. Please manually install webcolors. Returning None.")
53
+ return None
54
+
39
55
  if not alpha == None:
40
56
  if not 0.0 <= alpha <= 1.0:
41
57
  print("Color.ByCSSNamedColor - Error: alpha is not within the valid range of 0 to 1. Returning None.")
@@ -262,9 +278,23 @@ class Color:
262
278
  str
263
279
  The CSS named color that most closely matches the input color.
264
280
  """
265
-
266
- import webcolors
267
281
  import numbers
282
+ import warnings
283
+ import os
284
+ try:
285
+ import webcolors
286
+ except:
287
+ print("Color.CSSNamedColor - Information: Installing required webcolors library.")
288
+ try:
289
+ os.system("pip install webcolors")
290
+ except:
291
+ os.system("pip install webcolors --user")
292
+ try:
293
+ import webcolors
294
+ print("Color.CSSNamedColor - Information: webcolors library installed correctly.")
295
+ except:
296
+ warnings.warn("Color.CSSNamedColor - Error: Could not import webcolors library. Please manually install webcolors. Returning None.")
297
+ return None
268
298
 
269
299
  if not isinstance(color, list):
270
300
  print("Color.CSSNamedColor - Error: The input color parameter is not a valid list. Returning None.")
@@ -94,24 +94,6 @@ except:
94
94
  except:
95
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.")
96
96
 
97
- try:
98
- from sklearn import metrics
99
- from sklearn.model_selection import KFold
100
- from sklearn.metrics import accuracy_score
101
- except:
102
- print("DGL - Installing required scikit-learn (sklearn) library.")
103
- try:
104
- os.system("pip install scikit-learn")
105
- except:
106
- os.system("pip install scikit-learn --user")
107
- try:
108
- from sklearn import metrics
109
- from sklearn.model_selection import KFold
110
- from sklearn.metrics import accuracy_score
111
- print("DGL - scikit-learn (sklearn) library installed correctly.")
112
- except:
113
- raise Exception("DGL - Error: Could not import scikit-learn (sklearn).")
114
-
115
97
  try:
116
98
  from tqdm.auto import tqdm
117
99
  except:
@@ -715,6 +697,20 @@ class _GraphRegressorKFold:
715
697
 
716
698
 
717
699
  def train(self):
700
+ try:
701
+ from sklearn.model_selection import KFold
702
+ except:
703
+ print("DGL - Installing required scikit-learn (sklearn) library.")
704
+ try:
705
+ os.system("pip install scikit-learn")
706
+ except:
707
+ os.system("pip install scikit-learn --user")
708
+ try:
709
+ from sklearn.model_selection import KFold
710
+ print("DGL - scikit-learn (sklearn) library installed correctly.")
711
+ except:
712
+ warnings.warn("DGL - Error: Could not import scikit-learn (sklearn). Please try to install scikit-learn manually. Returning None.")
713
+ return None
718
714
  device = torch.device("cpu")
719
715
 
720
716
  # The number of folds (This should come from the hparams)
@@ -904,6 +900,22 @@ class _GraphClassifierHoldout:
904
900
  batch_size=hparams.batch_size,
905
901
  drop_last=False)
906
902
  def train(self):
903
+
904
+ try:
905
+ from sklearn.metrics import accuracy_score
906
+ except:
907
+ print("DGL - Installing required scikit-learn (sklearn) library.")
908
+ try:
909
+ os.system("pip install scikit-learn")
910
+ except:
911
+ os.system("pip install scikit-learn --user")
912
+ try:
913
+ from sklearn.metrics import accuracy_score
914
+ print("DGL - scikit-learn (sklearn) library installed correctly.")
915
+ except:
916
+ warnings.warn("DGL - Error: Could not import scikit-learn (sklearn). Please try to install scikit-learn manually. Returning None.")
917
+ return None
918
+
907
919
  #device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
908
920
  device = torch.device("cpu")
909
921
  # Init the loss and accuracy reporting lists
@@ -951,6 +963,20 @@ class _GraphClassifierHoldout:
951
963
  self.validation_loss_list.append(self.validation_loss)
952
964
 
953
965
  def validate(self):
966
+ try:
967
+ from sklearn.metrics import accuracy_score
968
+ except:
969
+ print("DGL - Installing required scikit-learn (sklearn) library.")
970
+ try:
971
+ os.system("pip install scikit-learn")
972
+ except:
973
+ os.system("pip install scikit-learn --user")
974
+ try:
975
+ from sklearn.metrics import accuracy_score
976
+ print("DGL - scikit-learn (sklearn) library installed correctly.")
977
+ except:
978
+ warnings.warn("DGL - Error: Could not import scikit-learn (sklearn). Please try to install scikit-learn manually. Returning None.")
979
+ return None
954
980
  #device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
955
981
  device = torch.device("cpu")
956
982
  temp_loss_list = []
@@ -969,6 +995,20 @@ class _GraphClassifierHoldout:
969
995
  self.validation_loss = np.mean(temp_loss_list).item()
970
996
 
971
997
  def test(self):
998
+ try:
999
+ from sklearn.metrics import accuracy_score
1000
+ except:
1001
+ print("DGL - Installing required scikit-learn (sklearn) library.")
1002
+ try:
1003
+ os.system("pip install scikit-learn")
1004
+ except:
1005
+ os.system("pip install scikit-learn --user")
1006
+ try:
1007
+ from sklearn.metrics import accuracy_score
1008
+ print("DGL - scikit-learn (sklearn) library installed correctly.")
1009
+ except:
1010
+ warnings.warn("DGL - Error: Could not import scikit-learn (sklearn). Please try to install scikit-learn manually. Returning None.")
1011
+ return None
972
1012
  if self.test_dataloader:
973
1013
  temp_loss_list = []
974
1014
  temp_acc_list = []
@@ -1073,6 +1113,23 @@ class _GraphClassifierKFold:
1073
1113
  lr=self.hparams.lr, maximize=self.hparams.maximize, weight_decay=self.hparams.weight_decay)
1074
1114
 
1075
1115
  def train(self):
1116
+
1117
+ try:
1118
+ from sklearn.model_selection import KFold
1119
+ from sklearn.metrics import accuracy_score
1120
+ except:
1121
+ print("DGL - Installing required scikit-learn (sklearn) library.")
1122
+ try:
1123
+ os.system("pip install scikit-learn")
1124
+ except:
1125
+ os.system("pip install scikit-learn --user")
1126
+ try:
1127
+ from sklearn.model_selection import KFold
1128
+ from sklearn.metrics import accuracy_score
1129
+ print("DGL - scikit-learn (sklearn) library installed correctly.")
1130
+ except:
1131
+ warnings.warn("DGL - Error: Could not import scikit-learn (sklearn). Please try to install scikit-learn manually. Returning None.")
1132
+ return None
1076
1133
  # The number of folds (This should come from the hparams)
1077
1134
  k_folds = self.hparams.k_folds
1078
1135
 
@@ -1176,6 +1233,20 @@ class _GraphClassifierKFold:
1176
1233
  self.validation_loss_list = self.validation_loss_list[ind]
1177
1234
 
1178
1235
  def validate(self):
1236
+ try:
1237
+ from sklearn.metrics import accuracy_score
1238
+ except:
1239
+ print("DGL - Installing required scikit-learn (sklearn) library.")
1240
+ try:
1241
+ os.system("pip install scikit-learn")
1242
+ except:
1243
+ os.system("pip install scikit-learn --user")
1244
+ try:
1245
+ from sklearn.metrics import accuracy_score
1246
+ print("DGL - scikit-learn (sklearn) library installed correctly.")
1247
+ except:
1248
+ warnings.warn("DGL - Error: Could not import scikit-learn (sklearn). Please try to install scikit-learn manually. Returning None.")
1249
+ return None
1179
1250
  temp_loss_list = []
1180
1251
  temp_acc_list = []
1181
1252
  self.model.eval()
@@ -1192,6 +1263,22 @@ class _GraphClassifierKFold:
1192
1263
  self.validation_loss = np.mean(temp_loss_list).item()
1193
1264
 
1194
1265
  def test(self):
1266
+
1267
+ try:
1268
+ from sklearn.metrics import accuracy_score
1269
+ except:
1270
+ print("DGL - Installing required scikit-learn (sklearn) library.")
1271
+ try:
1272
+ os.system("pip install scikit-learn")
1273
+ except:
1274
+ os.system("pip install scikit-learn --user")
1275
+ try:
1276
+ from sklearn.metrics import accuracy_score
1277
+ print("DGL - scikit-learn (sklearn) library installed correctly.")
1278
+ except:
1279
+ warnings.warn("DGL - Error: Could not import scikit-learn (sklearn). Please try to install scikit-learn manually. Returning None.")
1280
+ return None
1281
+
1195
1282
  if self.testingDataset:
1196
1283
  self.test_dataloader = GraphDataLoader(self.testingDataset,
1197
1284
  batch_size=len(self.testingDataset),
@@ -1724,6 +1811,23 @@ class DGL:
1724
1811
 
1725
1812
  """
1726
1813
 
1814
+ try:
1815
+ from sklearn import metrics
1816
+ from sklearn.metrics import accuracy_score
1817
+ except:
1818
+ print("DGL - Installing required scikit-learn (sklearn) library.")
1819
+ try:
1820
+ os.system("pip install scikit-learn")
1821
+ except:
1822
+ os.system("pip install scikit-learn --user")
1823
+ try:
1824
+ from sklearn import metrics
1825
+ from sklearn.metrics import accuracy_score
1826
+ print("DGL - scikit-learn (sklearn) library installed correctly.")
1827
+ except:
1828
+ warnings.warn("DGL - Error: Could not import scikit-learn (sklearn). Please try to install scikit-learn manually. Returning None.")
1829
+ return None
1830
+
1727
1831
  if not isinstance(actual, list):
1728
1832
  print("DGL.ConfusionMatrix - ERROR: The actual input is not a list. Returning None")
1729
1833
  return None
@@ -622,6 +622,9 @@ class Dictionary(topologic.Dictionary):
622
622
  if not isinstance(dictionary, topologic.Dictionary) and not isinstance(dictionary, dict):
623
623
  print("Dictionary.ValueAtKey - Error: The input dictionary parameter is not a valid topologic or python dictionary. Returning None.")
624
624
  return None
625
+ if not isinstance(key, str):
626
+ print("Dictionary.ValueAtKey - Error: The input key parameter is not a valid str. Returning None.")
627
+ return None
625
628
  if isinstance(dictionary, dict):
626
629
  attr = dictionary[key]
627
630
  elif isinstance(dictionary, topologic.Dictionary):
@@ -37,22 +37,6 @@ except:
37
37
  except:
38
38
  warnings.warn("EnergyModel - Error: Could not import tqdm.")
39
39
 
40
- try:
41
- import openstudio
42
- openstudio.Logger.instance().standardOutLogger().setLogLevel(openstudio.Fatal)
43
- except:
44
- print("EnergyModel - Installing required openstudio library.")
45
- try:
46
- os.system("pip install openstudio")
47
- except:
48
- os.system("pip install openstudio --user")
49
- try:
50
- import openstudio
51
- openstudio.Logger.instance().standardOutLogger().setLogLevel(openstudio.Fatal)
52
- print("EnergyModel - openstudio library installed correctly.")
53
- except:
54
- warnings.warn("EnergyModel - Error: Could not import openstudio.")
55
-
56
40
  class EnergyModel:
57
41
  '''
58
42
  @staticmethod
@@ -99,8 +83,25 @@ class EnergyModel:
99
83
  The OSM model.
100
84
 
101
85
  """
86
+ try:
87
+ import openstudio
88
+ openstudio.Logger.instance().standardOutLogger().setLogLevel(openstudio.Fatal)
89
+ except:
90
+ print("EnergyModel.ByOSMPath - Information: Installing required openstudio library.")
91
+ try:
92
+ os.system("pip install openstudio")
93
+ except:
94
+ os.system("pip install openstudio --user")
95
+ try:
96
+ import openstudio
97
+ openstudio.Logger.instance().standardOutLogger().setLogLevel(openstudio.Fatal)
98
+ print("EnergyModel.ByOSMPath - Information: openstudio library installed correctly.")
99
+ except:
100
+ warnings.warn("EnergyModel - Error: Could not import openstudio.Please try to install openstudio manually. Returning None.")
101
+ return None
102
+
102
103
  if not path:
103
- print("EnergyModel.ByImportedOSM - Error: The input path is not valid. Returning None.")
104
+ print("EnergyModel.ByOSMPath - Error: The input path is not valid. Returning None.")
104
105
  return None
105
106
  translator = openstudio.osversion.VersionTranslator()
106
107
  osmPath = openstudio.openstudioutilitiescore.toPath(path)
@@ -111,26 +112,6 @@ class EnergyModel:
111
112
  else:
112
113
  osModel = osModel.get()
113
114
  return osModel
114
-
115
- @staticmethod
116
- def ByImportedOSM(path: str):
117
- """
118
- DEPRECATED. DO NOT USE. Instead use Topology.ByOSMPath or Topology.ByOSMFile
119
- Creates an EnergyModel from the input OSM file path.
120
-
121
- Parameters
122
- ----------
123
- path : string
124
- The path to the input .OSM file.
125
-
126
- Returns
127
- -------
128
- openstudio.openstudiomodelcore.Model
129
- The OSM model.
130
-
131
- """
132
- print("Topology.ByImportedOSM - WARNING: This method is DEPRECATED. DO NOT USE. Instead use Topology.ByOSMPath")
133
- return EnergyModel.ByOSMPath(path=path)
134
115
 
135
116
  @staticmethod
136
117
  def ByTopology(building : topologic.Topology,
@@ -1786,7 +1786,7 @@ class Face(Topology):
1786
1786
  return Face.ByWire(wire, tolerance=tolerance)
1787
1787
 
1788
1788
  @staticmethod
1789
- def Triangulate(face:topologic.Face, mode: str = "classic", meshSize: float = None, tolerance: float = 0.0001) -> list:
1789
+ def Triangulate(face:topologic.Face, mode: int = 0, meshSize: float = None, tolerance: float = 0.0001) -> list:
1790
1790
  """
1791
1791
  Triangulates the input face and returns a list of faces.
1792
1792
 
@@ -1796,10 +1796,18 @@ class Face(Topology):
1796
1796
  The input face.
1797
1797
  tolerance : float , optional
1798
1798
  The desired tolerance. The default is 0.0001.
1799
- mode : str , optional
1800
- The desired mode of meshing. Two options are available: "classic" and "mesh". They are case insensitive.
1801
- The "mesh" option uses the gmsh library.
1802
- WARNING: The "mesh" option can be very time consuming and can create very heavy geometry.
1799
+ mode : int , optional
1800
+ The desired mode of meshing algorithm. Several options are available:
1801
+ 0: Classic
1802
+ 1: MeshAdapt
1803
+ 3: Initial Mesh Only
1804
+ 5: Delaunay
1805
+ 6: Frontal-Delaunay
1806
+ 7: BAMG
1807
+ 8: Fontal-Delaunay for Quads
1808
+ 9: Packing of Parallelograms
1809
+ All options other than 0 (Classic) use the gmsh library. See https://gmsh.info/doc/texinfo/gmsh.html#Mesh-options
1810
+ WARNING: The options that use gmsh can be very time consuming and can create very heavy geometry.
1803
1811
  meshSize : float , optional
1804
1812
  The desired size of the mesh when using the "mesh" option. If set to None, it will be
1805
1813
  calculated automatically and set to 10% of the overall size of the face.
@@ -1810,14 +1818,11 @@ class Face(Topology):
1810
1818
  The list of triangles of the input face.
1811
1819
 
1812
1820
  """
1813
- from topologicpy.Vertex import Vertex
1814
1821
  from topologicpy.Wire import Wire
1815
- from topologicpy.Shell import Shell
1816
1822
  from topologicpy.Topology import Topology
1817
- from topologicpy.Dictionary import Dictionary
1818
1823
 
1819
1824
  # This function was contributed by Yidan Xue.
1820
- def generate_gmsh(face, meshSize = None, tolerance = 0.0001):
1825
+ def generate_gmsh(face, mode="mesh", meshSize = None, tolerance = 0.0001):
1821
1826
  """
1822
1827
  Creates a gmsh of triangular meshes from the input face.
1823
1828
 
@@ -1921,7 +1926,9 @@ class Face(Topology):
1921
1926
 
1922
1927
  gmsh.model.geo.addPlaneSurface([i+1 for i in range(current_wire_number)])
1923
1928
  gmsh.model.geo.synchronize()
1924
-
1929
+ if mode not in [1,3,5,6,7,8,9]:
1930
+ mode = 6
1931
+ gmsh.option.setNumber("Mesh.Algorithm", mode)
1925
1932
  gmsh.model.mesh.generate(2) # For a 2D mesh
1926
1933
  nodeTags, nodeCoords, nodeParams = gmsh.model.mesh.getNodes(-1, -1)
1927
1934
  elemTypes, elemTags, elemNodeTags = gmsh.model.mesh.getElements(-1, -1)
@@ -1955,9 +1962,7 @@ class Face(Topology):
1955
1962
  normal = Face.Normal(face)
1956
1963
  flatFace = Topology.Flatten(face, origin=origin, direction=normal)
1957
1964
 
1958
- if "mesh" in mode.lower():
1959
- shell_faces = generate_gmsh(flatFace, meshSize = meshSize, tolerance = tolerance)
1960
- else:
1965
+ if mode == 0:
1961
1966
  shell_faces = []
1962
1967
  for i in range(0,5,1):
1963
1968
  try:
@@ -1965,7 +1970,9 @@ class Face(Topology):
1965
1970
  break
1966
1971
  except:
1967
1972
  continue
1968
-
1973
+ else:
1974
+ shell_faces = generate_gmsh(flatFace, mode = mode, meshSize = meshSize, tolerance = tolerance)
1975
+
1969
1976
  if len(shell_faces) < 1:
1970
1977
  return []
1971
1978
  finalFaces = []