topologicpy 0.5.8__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.8/src/topologicpy.egg-info → topologicpy-0.5.9}/PKG-INFO +2 -12
  2. {topologicpy-0.5.8 → topologicpy-0.5.9}/pyproject.toml +2 -12
  3. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Color.py +33 -3
  4. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/DGL.py +122 -18
  5. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Dictionary.py +3 -0
  6. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/EnergyModel.py +18 -37
  7. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Graph.py +111 -43
  8. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Topology.py +30 -16
  9. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/__init__.py +1 -1
  10. {topologicpy-0.5.8 → topologicpy-0.5.9/src/topologicpy.egg-info}/PKG-INFO +2 -12
  11. topologicpy-0.5.9/src/topologicpy.egg-info/requires.txt +6 -0
  12. topologicpy-0.5.8/src/topologicpy.egg-info/requires.txt +0 -16
  13. {topologicpy-0.5.8 → topologicpy-0.5.9}/LICENSE +0 -0
  14. {topologicpy-0.5.8 → topologicpy-0.5.9}/MANIFEST.in +0 -0
  15. {topologicpy-0.5.8 → topologicpy-0.5.9}/README.md +0 -0
  16. {topologicpy-0.5.8 → topologicpy-0.5.9}/setup.cfg +0 -0
  17. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Aperture.py +0 -0
  18. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Cell.py +0 -0
  19. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/CellComplex.py +0 -0
  20. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Cluster.py +0 -0
  21. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Context.py +0 -0
  22. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Edge.py +0 -0
  23. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Face.py +0 -0
  24. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Grid.py +0 -0
  25. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Helper.py +0 -0
  26. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Honeybee.py +0 -0
  27. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Matrix.py +0 -0
  28. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Neo4j.py +0 -0
  29. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Plotly.py +0 -0
  30. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Polyskel.py +0 -0
  31. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Shell.py +0 -0
  32. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Speckle.py +0 -0
  33. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Vector.py +0 -0
  34. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Vertex.py +0 -0
  35. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/Wire.py +0 -0
  36. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/__init__.py +0 -0
  37. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKBO-6bdf205d.so.7.7.0 +0 -0
  38. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKBRep-2960a069.so.7.7.0 +0 -0
  39. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKBool-c44b74bd.so.7.7.0 +0 -0
  40. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKFillet-9a670ba0.so.7.7.0 +0 -0
  41. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKG2d-8f31849e.so.7.7.0 +0 -0
  42. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKG3d-4c6bce57.so.7.7.0 +0 -0
  43. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKGeomAlgo-26066fd9.so.7.7.0 +0 -0
  44. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKGeomBase-2116cabe.so.7.7.0 +0 -0
  45. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKMath-72572fa8.so.7.7.0 +0 -0
  46. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKMesh-2a060427.so.7.7.0 +0 -0
  47. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKOffset-6cab68ff.so.7.7.0 +0 -0
  48. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKPrim-eb1262b3.so.7.7.0 +0 -0
  49. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKShHealing-e67e5cc7.so.7.7.0 +0 -0
  50. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKTopAlgo-e4c96c33.so.7.7.0 +0 -0
  51. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libTKernel-fb7fe3b7.so.7.7.0 +0 -0
  52. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libgcc_s-32c1665e.so.1 +0 -0
  53. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/libstdc++-672d7b41.so.6.0.30 +0 -0
  54. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/topologic.cpython-310-x86_64-linux-gnu.so +0 -0
  55. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/topologic.cpython-311-x86_64-linux-gnu.so +0 -0
  56. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/topologic.cpython-38-x86_64-linux-gnu.so +0 -0
  57. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic/topologic.cpython-39-x86_64-linux-gnu.so +0 -0
  58. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKBO-6bdf205d.so.7.7.0 +0 -0
  59. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKBRep-2960a069.so.7.7.0 +0 -0
  60. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKBool-c44b74bd.so.7.7.0 +0 -0
  61. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKFillet-9a670ba0.so.7.7.0 +0 -0
  62. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKG2d-8f31849e.so.7.7.0 +0 -0
  63. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKG3d-4c6bce57.so.7.7.0 +0 -0
  64. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKGeomAlgo-26066fd9.so.7.7.0 +0 -0
  65. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKGeomBase-2116cabe.so.7.7.0 +0 -0
  66. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKMath-72572fa8.so.7.7.0 +0 -0
  67. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKMesh-2a060427.so.7.7.0 +0 -0
  68. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKOffset-6cab68ff.so.7.7.0 +0 -0
  69. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKPrim-eb1262b3.so.7.7.0 +0 -0
  70. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKShHealing-e67e5cc7.so.7.7.0 +0 -0
  71. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKTopAlgo-e4c96c33.so.7.7.0 +0 -0
  72. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libTKernel-fb7fe3b7.so.7.7.0 +0 -0
  73. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libgcc_s-32c1665e.so.1 +0 -0
  74. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/linux/topologic.libs/libstdc++-672d7b41.so.6.0.30 +0 -0
  75. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/macos/topologic/__init__.py +0 -0
  76. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKBO-f6b191de.dll +0 -0
  77. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKBRep-e56a600e.dll +0 -0
  78. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKBool-7b8d47ae.dll +0 -0
  79. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKFillet-0ddbf0a8.dll +0 -0
  80. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKG2d-2e2dee3d.dll +0 -0
  81. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKG3d-6674513d.dll +0 -0
  82. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKGeomAlgo-d240e370.dll +0 -0
  83. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKGeomBase-df87aba5.dll +0 -0
  84. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKMath-45bd625a.dll +0 -0
  85. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKMesh-d6e826b1.dll +0 -0
  86. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKOffset-79b9cc94.dll +0 -0
  87. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKPrim-aa430a86.dll +0 -0
  88. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKShHealing-bb48be89.dll +0 -0
  89. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKTopAlgo-7d0d1e22.dll +0 -0
  90. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/TKernel-08c8cfbb.dll +0 -0
  91. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/__init__.py +0 -0
  92. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/topologic.cp310-win_amd64.pyd +0 -0
  93. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/topologic.cp311-win_amd64.pyd +0 -0
  94. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/topologic.cp38-win_amd64.pyd +0 -0
  95. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy/bin/windows/topologic/topologic.cp39-win_amd64.pyd +0 -0
  96. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy.egg-info/SOURCES.txt +0 -0
  97. {topologicpy-0.5.8 → topologicpy-0.5.9}/src/topologicpy.egg-info/dependency_links.txt +0 -0
  98. {topologicpy-0.5.8 → 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.8
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.8"
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,
@@ -66,33 +66,7 @@ except:
66
66
  except:
67
67
  warnings.warn("Graph - Error: Could not import tqdm.")
68
68
 
69
- try:
70
- from pyvis.network import Network
71
- except:
72
- print("Graph - Installing required pyvis library.")
73
- try:
74
- os.system("pip install pyvis")
75
- except:
76
- os.system("pip install pyvis --user")
77
- try:
78
- from pyvis.network import Network
79
- print("Graph - pyvis library installed correctly.")
80
- except:
81
- rwarnings.warn("Graph - Error: Could not import pyvis")
82
69
 
83
- try:
84
- import networkx as nx
85
- except:
86
- print("Graph - Installing required networkx library.")
87
- try:
88
- os.system("pip install networkx")
89
- except:
90
- os.system("pip install networkx --user")
91
- try:
92
- import networkx as nx
93
- print("Graph - networkx library installed correctly.")
94
- except:
95
- warnings.warn("Graph - Error: Could not import networkx.")
96
70
 
97
71
  class _Tree:
98
72
  def __init__(self, node="", *children):
@@ -643,7 +617,7 @@ class Graph:
643
617
  from rdflib import URIRef, Literal, Namespace
644
618
  from rdflib.namespace import RDF, RDFS
645
619
  except:
646
- print("Graph.BOTGraph - Installing required rdflib library.")
620
+ print("Graph.BOTGraph - Information: Installing required rdflib library.")
647
621
  try:
648
622
  os.system("pip install rdflib")
649
623
  except:
@@ -652,7 +626,7 @@ class Graph:
652
626
  from rdflib import Graph as RDFGraph
653
627
  from rdflib import URIRef, Literal, Namespace
654
628
  from rdflib.namespace import RDF, RDFS
655
- print("Graph.BOTGraph - rdflib library installed correctly.")
629
+ print("Graph.BOTGraph - Information: rdflib library installed correctly.")
656
630
  except:
657
631
  warnings.warn("Graph.BOTGraph - Error: Could not import rdflib. Please try to install rdflib manually. Returning None.")
658
632
  return None
@@ -1136,9 +1110,23 @@ class Graph:
1136
1110
  from topologicpy.Graph import Graph
1137
1111
  from topologicpy.Dictionary import Dictionary
1138
1112
  from topologicpy.Topology import Topology
1139
-
1140
- import rdflib
1141
1113
  import random
1114
+
1115
+ try:
1116
+ import rdflib
1117
+ except:
1118
+ print("Graph.BOTGraph - Information: Installing required rdflib library.")
1119
+ try:
1120
+ os.system("pip install rdflib")
1121
+ except:
1122
+ os.system("pip install rdflib --user")
1123
+ try:
1124
+ import rdflib
1125
+ print("Graph.BOTGraph - Information: rdflib library installed correctly.")
1126
+ except:
1127
+ warnings.warn("Graph.BOTGraph - Error: Could not import rdflib. Please try to install rdflib manually. Returning None.")
1128
+ return None
1129
+
1142
1130
  predicates = ['adjacentto', 'interfaceof', 'containselement', 'connectsto']
1143
1131
  bot_types = ['Space', 'Wall', 'Slab', 'Door', 'Window', 'Element']
1144
1132
 
@@ -1221,7 +1209,21 @@ class Graph:
1221
1209
  tolerance = 0.0001
1222
1210
  ):
1223
1211
 
1224
- from rdflib import Graph as RDFGraph
1212
+ try:
1213
+ from rdflib import Graph as RDFGraph
1214
+ except:
1215
+ print("Graph.ByBOTPath - Information: Installing required rdflib library.")
1216
+ try:
1217
+ os.system("pip install rdflib")
1218
+ except:
1219
+ os.system("pip install rdflib --user")
1220
+ try:
1221
+ from rdflib import Graph as RDFGraph
1222
+ print("Graph.ByBOTPath - Information: rdflib library installed correctly.")
1223
+ except:
1224
+ warnings.warn("Graph.ByBOTPath - Error: Could not import rdflib. Please try to install rdflib manually. Returning None.")
1225
+ return None
1226
+
1225
1227
  bot_graph = RDFGraph()
1226
1228
  bot_graph.parse(path)
1227
1229
  return Graph.ByBOTGraph(bot_graph,
@@ -1687,12 +1689,29 @@ class Graph:
1687
1689
  from topologicpy.Edge import Edge
1688
1690
  from topologicpy.Graph import Graph
1689
1691
  from topologicpy.Dictionary import Dictionary
1690
- import ifcopenshell
1691
- import ifcopenshell.util.placement
1692
- import ifcopenshell.util.element
1693
- import ifcopenshell.util.shape
1694
- import ifcopenshell.geom
1695
- import sys
1692
+ try:
1693
+ import ifcopenshell
1694
+ import ifcopenshell.util.placement
1695
+ import ifcopenshell.util.element
1696
+ import ifcopenshell.util.shape
1697
+ import ifcopenshell.geom
1698
+ except:
1699
+ print("Graph.ByIFCFile - Warning: Installing required ifcopenshell library.")
1700
+ try:
1701
+ os.system("pip install ifcopenshell")
1702
+ except:
1703
+ os.system("pip install ifcopenshell --user")
1704
+ try:
1705
+ import ifcopenshell
1706
+ import ifcopenshell.util.placement
1707
+ import ifcopenshell.util.element
1708
+ import ifcopenshell.util.shape
1709
+ import ifcopenshell.geom
1710
+ print("Graph.ByIFCFile - Warning: ifcopenshell library installed correctly.")
1711
+ except:
1712
+ warnings.warn("Graph.ByIFCFile - Error: Could not import ifcopenshell. Please try to install ifcopenshell manually. Returning None.")
1713
+ return None
1714
+
1696
1715
  import random
1697
1716
 
1698
1717
  def vertexAtKeyValue(vertices, key, value):
@@ -1892,7 +1911,28 @@ class Graph:
1892
1911
  The created graph.
1893
1912
 
1894
1913
  """
1895
- import ifcopenshell
1914
+ try:
1915
+ import ifcopenshell
1916
+ import ifcopenshell.util.placement
1917
+ import ifcopenshell.util.element
1918
+ import ifcopenshell.util.shape
1919
+ import ifcopenshell.geom
1920
+ except:
1921
+ print("Graph.ByIFCPath - Warning: Installing required ifcopenshell library.")
1922
+ try:
1923
+ os.system("pip install ifcopenshell")
1924
+ except:
1925
+ os.system("pip install ifcopenshell --user")
1926
+ try:
1927
+ import ifcopenshell
1928
+ import ifcopenshell.util.placement
1929
+ import ifcopenshell.util.element
1930
+ import ifcopenshell.util.shape
1931
+ import ifcopenshell.geom
1932
+ print("Graph.ByIFCPath - Warning: ifcopenshell library installed correctly.")
1933
+ except:
1934
+ warnings.warn("Graph.ByIFCPath - Error: Could not import ifcopenshell. Please try to install ifcopenshell manually. Returning None.")
1935
+ return None
1896
1936
  if not path:
1897
1937
  print("Graph.ByIFCPath - Error: the input path is not a valid path. Returning None.")
1898
1938
  return None
@@ -5779,7 +5819,7 @@ class Graph:
5779
5819
  print("Graph.IsBipartite - Error: The input graph is not a valid graph. Returning None.")
5780
5820
  return None
5781
5821
  order = Graph.Order(graph)
5782
- adjList = Graph.AdjacencyList(graph, tolerance)
5822
+ adjList = Graph.AdjacencyList(graph, tolerance=tolerance)
5783
5823
  return isBipartite(order, adjList)
5784
5824
 
5785
5825
  @staticmethod
@@ -6620,12 +6660,24 @@ class Graph:
6620
6660
 
6621
6661
  """
6622
6662
  from topologicpy.Vertex import Vertex
6623
- from topologicpy.Edge import Edge
6624
6663
  from topologicpy.Topology import Topology
6625
6664
  from topologicpy.Dictionary import Dictionary
6626
- import random
6627
- import sys
6628
- import subprocess
6665
+
6666
+ try:
6667
+ import networkx as nx
6668
+ except:
6669
+ print("Graph.NetworkXGraph - Information: Installing required networkx library.")
6670
+ try:
6671
+ os.system("pip install networkx")
6672
+ except:
6673
+ os.system("pip install networkx --user")
6674
+ try:
6675
+ import networkx as nx
6676
+ print("Graph.NetworkXGraph - Infromation: networkx library installed correctly.")
6677
+ except:
6678
+ warnings.warn("Graph - Error: Could not import networkx. Please try to install networkx manually. Returning None.")
6679
+ return None
6680
+
6629
6681
  if not isinstance(graph, topologic.Graph):
6630
6682
  print("Graph.NetworkXGraph - Error: The input graph is not a valid graph. Returning None.")
6631
6683
  return None
@@ -6931,6 +6983,22 @@ class Graph:
6931
6983
  from topologicpy.Dictionary import Dictionary
6932
6984
  from topologicpy.Color import Color
6933
6985
  from os.path import exists
6986
+
6987
+ try:
6988
+ from pyvis.network import Network
6989
+ except:
6990
+ print("Graph.PyvisGraph - Information: Installing required pyvis library.")
6991
+ try:
6992
+ os.system("pip install pyvis")
6993
+ except:
6994
+ os.system("pip install pyvis --user")
6995
+ try:
6996
+ from pyvis.network import Network
6997
+ print("Graph.PyvisGraph - Information: pyvis library installed correctly.")
6998
+ except:
6999
+ warnings.warn("Graph - Error: Could not import pyvis. Please try to install pyvis manually. Retruning None.")
7000
+ return None
7001
+
6934
7002
  net = Network(height=str(height)+"px", width="100%", bgcolor=backgroundColor, font_color=fontColor, select_menu=selectMenu, filter_menu=filterMenu, cdn_resources="remote", notebook=notebook)
6935
7003
  if notebook == True:
6936
7004
  net.prep_notebook()
@@ -44,22 +44,6 @@ except:
44
44
  except:
45
45
  warnings.warn("Topology - Error: Could not import numpy.")
46
46
 
47
- try:
48
- import ifcopenshell
49
- import ifcopenshell.geom
50
- except:
51
- print("Topology - Installing required ifcopenshell library.")
52
- try:
53
- os.system("pip install ifcopenshell")
54
- except:
55
- os.system("pip install ifcopenshell --user")
56
- try:
57
- import ifcopenshell
58
- import ifcopenshell.geom
59
- print("Topology - ifcopenshell library installed successfully.")
60
- except:
61
- warnings.warn("Topology - Error: Could not import ifcopenshell.")
62
-
63
47
  try:
64
48
  from scipy.spatial import ConvexHull
65
49
  except:
@@ -74,6 +58,20 @@ except:
74
58
  except:
75
59
  warnings.warn("Topology - Error: Could not import scipy.")
76
60
 
61
+ try:
62
+ from tqdm.auto import tqdm
63
+ except:
64
+ print("Topology - Installing required tqdm library.")
65
+ try:
66
+ os.system("pip install tqdm")
67
+ except:
68
+ os.system("pip install tqdm --user")
69
+ try:
70
+ from tqdm.auto import tqdm
71
+ print("Topology - tqdm library installed correctly.")
72
+ except:
73
+ warnings.warn("Topology - Error: Could not import tqdm.")
74
+
77
75
  QueueItem = namedtuple('QueueItem', ['ID', 'sinkKeys', 'sinkValues'])
78
76
  SinkItem = namedtuple('SinkItem', ['ID', 'sink_str'])
79
77
 
@@ -1810,6 +1808,22 @@ class Topology():
1810
1808
  from topologicpy.Dictionary import Dictionary
1811
1809
  import uuid
1812
1810
 
1811
+ try:
1812
+ import ifcopenshell
1813
+ import ifcopenshell.geom
1814
+ except:
1815
+ print("Topology.ByIFCFile - Warning: Installing required ifcopenshell library.")
1816
+ try:
1817
+ os.system("pip install ifcopenshell")
1818
+ except:
1819
+ os.system("pip install ifcopenshell --user")
1820
+ try:
1821
+ import ifcopenshell
1822
+ import ifcopenshell.geom
1823
+ print("Topology.ByIFCFile - Warning: ifcopenshell library installed correctly.")
1824
+ except:
1825
+ warnings.warn("Topology.ByIFCFile - Error: Could not import ifcopenshell. Please try to install ifcopenshell manually. Returning None.")
1826
+ return None
1813
1827
  if not file:
1814
1828
  print("Topology.ByIFCFile - Error: the input file parameter is not a valid file. Returning None.")
1815
1829
  return None
@@ -18,7 +18,7 @@ import sys
18
18
  import os, re
19
19
  from sys import platform
20
20
 
21
- __version__ = '0.5.8'
21
+ __version__ = '0.5.9'
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.5.8
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
 
@@ -0,0 +1,6 @@
1
+ numpy
2
+ scipy
3
+ pandas
4
+ tqdm
5
+ plotly
6
+ lark
@@ -1,16 +0,0 @@
1
- numpy
2
- pandas
3
- scipy
4
- scikit-learn
5
- ifcopenshell
6
- ladybug
7
- honeybee
8
- honeybee-energy
9
- networkx
10
- openstudio
11
- tqdm
12
- plotly
13
- pyvis
14
- lark
15
- webcolors
16
- rdflib
File without changes
File without changes
File without changes
File without changes