topologicpy 0.4.62__tar.gz → 0.4.64__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 (81) hide show
  1. {topologicpy-0.4.62/src/topologicpy.egg-info → topologicpy-0.4.64}/PKG-INFO +11 -1
  2. {topologicpy-0.4.62 → topologicpy-0.4.64}/pyproject.toml +11 -1
  3. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Cell.py +16 -1
  4. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/CellComplex.py +15 -1
  5. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Cluster.py +30 -3
  6. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/DGL.py +54 -32
  7. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/EnergyModel.py +16 -13
  8. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Face.py +15 -1
  9. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Graph.py +64 -66
  10. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Helper.py +17 -2
  11. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Honeybee.py +31 -19
  12. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Neo4j.py +7 -4
  13. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Plotly.py +72 -23
  14. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Polyskel.py +7 -7
  15. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Shell.py +24 -31
  16. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Topology.py +59 -51
  17. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Vector.py +19 -3
  18. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Vertex.py +16 -3
  19. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Wire.py +0 -1
  20. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/__init__.py +1 -1
  21. {topologicpy-0.4.62 → topologicpy-0.4.64/src/topologicpy.egg-info}/PKG-INFO +11 -1
  22. topologicpy-0.4.64/src/topologicpy.egg-info/requires.txt +13 -0
  23. topologicpy-0.4.62/src/topologicpy.egg-info/requires.txt +0 -3
  24. {topologicpy-0.4.62 → topologicpy-0.4.64}/LICENSE +0 -0
  25. {topologicpy-0.4.62 → topologicpy-0.4.64}/MANIFEST.in +0 -0
  26. {topologicpy-0.4.62 → topologicpy-0.4.64}/README.md +0 -0
  27. {topologicpy-0.4.62 → topologicpy-0.4.64}/setup.cfg +0 -0
  28. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Aperture.py +0 -0
  29. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Color.py +0 -0
  30. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Context.py +0 -0
  31. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Dictionary.py +0 -0
  32. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Edge.py +0 -0
  33. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Grid.py +0 -0
  34. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Matrix.py +0 -0
  35. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/Speckle.py +0 -0
  36. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic/__init__.py +0 -0
  37. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic/topologic.cpython-310-x86_64-linux-gnu.so +0 -0
  38. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic/topologic.cpython-311-x86_64-linux-gnu.so +0 -0
  39. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic/topologic.cpython-38-x86_64-linux-gnu.so +0 -0
  40. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic/topologic.cpython-39-x86_64-linux-gnu.so +0 -0
  41. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libTKBO-6bdf205d.so.7.7.0 +0 -0
  42. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libTKBRep-2960a069.so.7.7.0 +0 -0
  43. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libTKBool-c44b74bd.so.7.7.0 +0 -0
  44. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libTKFillet-9a670ba0.so.7.7.0 +0 -0
  45. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libTKG2d-8f31849e.so.7.7.0 +0 -0
  46. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libTKG3d-4c6bce57.so.7.7.0 +0 -0
  47. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libTKGeomAlgo-26066fd9.so.7.7.0 +0 -0
  48. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libTKGeomBase-2116cabe.so.7.7.0 +0 -0
  49. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libTKMath-72572fa8.so.7.7.0 +0 -0
  50. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libTKMesh-2a060427.so.7.7.0 +0 -0
  51. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libTKOffset-6cab68ff.so.7.7.0 +0 -0
  52. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libTKPrim-eb1262b3.so.7.7.0 +0 -0
  53. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libTKShHealing-e67e5cc7.so.7.7.0 +0 -0
  54. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libTKTopAlgo-e4c96c33.so.7.7.0 +0 -0
  55. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libTKernel-fb7fe3b7.so.7.7.0 +0 -0
  56. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libgcc_s-32c1665e.so.1 +0 -0
  57. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/linux/topologic.libs/libstdc++-672d7b41.so.6.0.30 +0 -0
  58. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/macos/topologic/__init__.py +0 -0
  59. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/TKBO-f6b191de.dll +0 -0
  60. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/TKBRep-e56a600e.dll +0 -0
  61. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/TKBool-7b8d47ae.dll +0 -0
  62. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/TKFillet-0ddbf0a8.dll +0 -0
  63. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/TKG2d-2e2dee3d.dll +0 -0
  64. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/TKG3d-6674513d.dll +0 -0
  65. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/TKGeomAlgo-d240e370.dll +0 -0
  66. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/TKGeomBase-df87aba5.dll +0 -0
  67. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/TKMath-45bd625a.dll +0 -0
  68. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/TKMesh-d6e826b1.dll +0 -0
  69. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/TKOffset-79b9cc94.dll +0 -0
  70. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/TKPrim-aa430a86.dll +0 -0
  71. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/TKShHealing-bb48be89.dll +0 -0
  72. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/TKTopAlgo-7d0d1e22.dll +0 -0
  73. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/TKernel-08c8cfbb.dll +0 -0
  74. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/__init__.py +0 -0
  75. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/topologic.cp310-win_amd64.pyd +0 -0
  76. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/topologic.cp311-win_amd64.pyd +0 -0
  77. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/topologic.cp38-win_amd64.pyd +0 -0
  78. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy/bin/windows/topologic/topologic.cp39-win_amd64.pyd +0 -0
  79. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy.egg-info/SOURCES.txt +0 -0
  80. {topologicpy-0.4.62 → topologicpy-0.4.64}/src/topologicpy.egg-info/dependency_links.txt +0 -0
  81. {topologicpy-0.4.62 → topologicpy-0.4.64}/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.62
3
+ Version: 0.4.64
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,8 +13,18 @@ Requires-Python: >=3.8
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: numpy
16
+ Requires-Dist: pandas
17
+ 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
16
25
  Requires-Dist: tqdm
17
26
  Requires-Dist: plotly
27
+ Requires-Dist: pyvis
18
28
 
19
29
  # topologicpy
20
30
 
@@ -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.62"
6
+ version = "0.4.64"
7
7
  authors = [
8
8
  { name="Wassim Jabi", email="wassim.jabi@gmail.com" },
9
9
  ]
@@ -17,8 +17,18 @@ classifiers = [
17
17
  ]
18
18
  dependencies = [
19
19
  "numpy",
20
+ "pandas",
21
+ "scipy",
22
+ "scikit-learn",
23
+ "ifcopenshell",
24
+ "ladybug",
25
+ "honeybee",
26
+ "honeybee-energy",
27
+ "networkx",
28
+ "openstudio",
20
29
  "tqdm",
21
30
  "plotly",
31
+ "pyvis",
22
32
  ]
23
33
  [project.urls]
24
34
  "Homepage" = "https://github.com/wassimj/TopologicPy"
@@ -3,7 +3,22 @@ import topologic
3
3
  from topologicpy.Wire import Wire
4
4
  from topologicpy.Topology import Topology
5
5
  import math
6
-
6
+ import os
7
+
8
+ try:
9
+ import numpy as np
10
+ except:
11
+ print("Cell - Installing required numpy library.")
12
+ try:
13
+ os.system("pip install numpy")
14
+ except:
15
+ os.system("pip install numpy --user")
16
+ try:
17
+ import numpy as np
18
+ print("Cell - numpy library installed correctly.")
19
+ except:
20
+ raise Exception("Cell - Error: Could not import numpy.")
21
+
7
22
  class Cell(Topology):
8
23
  @staticmethod
9
24
  def Area(cell: topologic.Cell, mantissa: int = 6) -> float:
@@ -1,6 +1,20 @@
1
1
  import topologic
2
- import warnings
3
2
  import math
3
+ import os
4
+
5
+ try:
6
+ import numpy as np
7
+ except:
8
+ print("CellComplex - Installing required numpy library.")
9
+ try:
10
+ os.system("pip install numpy")
11
+ except:
12
+ os.system("pip install numpy --user")
13
+ try:
14
+ import numpy as np
15
+ print("CellComplex - numpy library installed correctly.")
16
+ except:
17
+ raise Exception("CellComplex - Error: Could not import numpy.")
4
18
 
5
19
  class CellComplex(topologic.CellComplex):
6
20
  @staticmethod
@@ -1,5 +1,35 @@
1
1
  import topologicpy
2
2
  import topologic
3
+ import os
4
+
5
+ try:
6
+ import numpy as np
7
+ except:
8
+ print("Cluster - Installing required numpy library.")
9
+ try:
10
+ os.system("pip install numpy")
11
+ except:
12
+ os.system("pip install numpy --user")
13
+ try:
14
+ import numpy as np
15
+ print("Cluster - numpy library installed correctly.")
16
+ except:
17
+ raise Exception("Cluster - Error: Could not import numpy.")
18
+
19
+ try:
20
+ from scipy.spatial.distance import pdist, squareform
21
+ except:
22
+ print("Cluster - Installing required scipy library.")
23
+ try:
24
+ os.system("pip install scipy")
25
+ except:
26
+ os.system("pip install scipy --user")
27
+ try:
28
+ from scipy.spatial.distance import pdist, squareform
29
+ print("Cluster - scipy library installed correctly.")
30
+ except:
31
+ raise Exception("Cluster - Error: Could not import scipy.")
32
+
3
33
  class Cluster(topologic.Cluster):
4
34
  @staticmethod
5
35
  def ByFormula(formula, xRange=None, yRange=None, xString="X", yString="Y"):
@@ -208,9 +238,6 @@ class Cluster(topologic.Cluster):
208
238
  from topologicpy.Topology import Topology
209
239
  from topologicpy.Dictionary import Dictionary
210
240
 
211
- import numpy as np
212
- from scipy.spatial.distance import pdist, squareform
213
-
214
241
  def dbscan_3d_indices(data, eps, min_samples):
215
242
  """
216
243
  DBSCAN clustering algorithm for 3D points.
@@ -1,33 +1,36 @@
1
- import topologicpy
2
- import topologic
3
- from topologicpy.Dictionary import Dictionary
4
1
  import os
5
2
  import random
6
- import time
7
- from datetime import datetime
8
3
  import copy
9
- import sys
10
- import subprocess
11
4
  os.environ["DGLBACKEND"] = "pytorch"
12
5
 
13
6
  try:
14
7
  import numpy as np
15
8
  except:
16
- call = [sys.executable, '-m', 'pip', 'install', 'numpy', '-t', sys.path[0]]
17
- subprocess.run(call)
9
+ print("DGL - Installing required numpy library.")
10
+ try:
11
+ os.system("pip install numpy")
12
+ except:
13
+ os.system("pip install numpy --user")
18
14
  try:
19
15
  import numpy as np
16
+ print("DGL - numpy library installed correctly.")
20
17
  except:
21
- print("DGL - Error: Could not import numpy.")
18
+ raise Exception("DGL - Error: Could not import numpy.")
19
+
22
20
  try:
23
21
  import pandas as pd
24
22
  except:
25
- call = [sys.executable, '-m', 'pip', 'install', 'pandas', '-t', sys.path[0]]
26
- subprocess.run(call)
23
+ print("DGL - Installing required pandas library.")
24
+ try:
25
+ os.system("pip install pandas")
26
+ except:
27
+ os.system("pip install pandas --user")
27
28
  try:
28
29
  import pandas as pd
30
+ print("DGL - pandas library installed correctly.")
29
31
  except:
30
- print("DGL - Error: Could not import pandas")
32
+ raise Exception("DGL - Error: Could not import pandas.")
33
+
31
34
  try:
32
35
  import torch
33
36
  import torch.nn as nn
@@ -35,16 +38,21 @@ try:
35
38
  from torch.utils.data.sampler import SubsetRandomSampler
36
39
  from torch.utils.data import DataLoader, ConcatDataset
37
40
  except:
38
- call = [sys.executable, '-m', 'pip', 'install', 'torch', '-t', sys.path[0]]
39
- subprocess.run(call)
41
+ print("DGL - Installing required torch library.")
42
+ try:
43
+ os.system("pip install torch")
44
+ except:
45
+ os.system("pip install torch --user")
40
46
  try:
41
47
  import torch
42
48
  import torch.nn as nn
43
49
  import torch.nn.functional as F
44
50
  from torch.utils.data.sampler import SubsetRandomSampler
45
51
  from torch.utils.data import DataLoader, ConcatDataset
52
+ print("DGL - torch library installed correctly.")
46
53
  except:
47
- print("DGL - Error: Could not import torch")
54
+ raise Exception("DGL - Error: Could not import torch.")
55
+
48
56
  try:
49
57
  import dgl
50
58
  from dgl.data import DGLDataset
@@ -52,37 +60,54 @@ try:
52
60
  from dgl.nn import GINConv, GraphConv, SAGEConv, TAGConv
53
61
  from dgl import save_graphs, load_graphs
54
62
  except:
55
- call = [sys.executable, '-m', 'pip', 'install', 'dgl', 'dglgo', '-f', 'https://data.dgl.ai/wheels/repo.html', '--upgrade', '-t', sys.path[0]]
56
- subprocess.run(call)
63
+ print("DGL - Installing required dgl library.")
64
+ try:
65
+ os.system("pip install dgl -f https://data.dgl.ai/wheels/repo.html")
66
+ os.system("pip install dglgo -f https://data.dgl.ai/wheels-test/repo.html")
67
+ except:
68
+ os.system("pip install dgl -f https://data.dgl.ai/wheels/repo.html --user")
69
+ os.system("pip install dglgo -f https://data.dgl.ai/wheels-test/repo.html --user")
57
70
  try:
58
71
  import dgl
59
72
  from dgl.data import DGLDataset
60
- from dgl.nn import GraphConv
73
+ from dgl.dataloading import GraphDataLoader
74
+ from dgl.nn import GINConv, GraphConv, SAGEConv, TAGConv
61
75
  from dgl import save_graphs, load_graphs
76
+ print("DGL - dgl library installed correctly.")
62
77
  except:
63
- print("DGL - Error: Could not import dgl")
78
+ 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.")
79
+
64
80
  try:
65
- import sklearn
81
+ from sklearn import metrics
66
82
  from sklearn.model_selection import KFold
67
83
  from sklearn.metrics import accuracy_score
68
84
  except:
69
- call = [sys.executable, '-m', 'pip', 'install', 'scikit-learn', '-t', sys.path[0]]
70
- subprocess.run(call)
85
+ print("DGL - Installing required scikit-learn (sklearn) library.")
86
+ try:
87
+ os.system("pip install scikit-learn")
88
+ except:
89
+ os.system("pip install scikit-learn --user")
71
90
  try:
72
- import sklearn
91
+ from sklearn import metrics
73
92
  from sklearn.model_selection import KFold
74
93
  from sklearn.metrics import accuracy_score
94
+ print("DGL - scikit-learn (sklearn) library installed correctly.")
75
95
  except:
76
- print("DGL - Error: Could not import sklearn")
96
+ raise Exception("DGL - Error: Could not import scikit-learn (sklearn).")
97
+
77
98
  try:
78
99
  from tqdm.auto import tqdm
79
100
  except:
80
- call = [sys.executable, '-m', 'pip', 'install', 'tqdm', '-t', sys.path[0]]
81
- subprocess.run(call)
101
+ print("DGL - Installing required tqdm library.")
102
+ try:
103
+ os.system("pip install tqdm")
104
+ except:
105
+ os.system("pip install tqdm --user")
82
106
  try:
83
107
  from tqdm.auto import tqdm
108
+ print("DGL - tqdm library installed correctly.")
84
109
  except:
85
- print("DGL - Error: Could not import tqdm")
110
+ raise Exception("DGL - Error: Could not import tqdm.")
86
111
 
87
112
  class _Dataset(DGLDataset):
88
113
  def __init__(self, graphs, labels, node_attr_key, edge_attr_key):
@@ -1431,8 +1456,6 @@ class DGL:
1431
1456
  The dictionary containing the performance measures. The keys in the dictionary are: 'mae', 'mape', 'mse', 'r', 'r2', 'rmse', .
1432
1457
  """
1433
1458
 
1434
- import numpy as np
1435
-
1436
1459
  if not isinstance(actual, list):
1437
1460
  print("DGL.Performance - ERROR: The actual input is not a list. Returning None")
1438
1461
  return None
@@ -1683,8 +1706,7 @@ class DGL:
1683
1706
  The created confusion matrix.
1684
1707
 
1685
1708
  """
1686
- from sklearn import metrics
1687
- import numpy
1709
+
1688
1710
  if not isinstance(actual, list):
1689
1711
  print("DGL.ConfusionMatrix - ERROR: The actual input is not a list. Returning None")
1690
1712
  return None
@@ -1,40 +1,43 @@
1
1
  import topologicpy
2
2
  import topologic
3
- from topologicpy.Topology import Topology
4
- from topologicpy.Dictionary import Dictionary
5
3
 
6
4
  import shutil
7
5
  import math
8
6
  from collections import OrderedDict
9
7
  import os
10
8
  from os.path import exists
11
- import json
12
9
  from datetime import datetime
13
- import time
14
- import sys
15
- import subprocess
10
+
11
+
16
12
  try:
17
13
  from tqdm.auto import tqdm
18
14
  except:
19
- import sys, subprocess
20
- call = [sys.executable, '-m', 'pip', 'install', 'tqdm', '-t', sys.path[0]]
21
- subprocess.run(call)
15
+ print("EnergyModel - Installing required tqdm library.")
16
+ try:
17
+ os.system("pip install tqdm")
18
+ except:
19
+ os.system("pip install tqdm --user")
22
20
  try:
23
21
  from tqdm.auto import tqdm
22
+ print("EnergyModel - tqdm library installed correctly.")
24
23
  except:
25
- print("EnergyModel - ERROR: Could not import tqdm")
24
+ raise Exception("EnergyModel - Error: Could not import tqdm.")
26
25
 
27
26
  try:
28
27
  import openstudio
29
28
  openstudio.Logger.instance().standardOutLogger().setLogLevel(openstudio.Fatal)
30
29
  except:
31
- call = [sys.executable, '-m', 'pip', 'install', 'openstudio', '-t', sys.path[0]]
32
- subprocess.run(call)
30
+ print("EnergyModel - Installing required openstudio library.")
31
+ try:
32
+ os.system("pip install openstudio")
33
+ except:
34
+ os.system("pip install openstudio --user")
33
35
  try:
34
36
  import openstudio
35
37
  openstudio.Logger.instance().standardOutLogger().setLogLevel(openstudio.Fatal)
38
+ print("EnergyModel - openstudio library installed correctly.")
36
39
  except:
37
- print("EnergyModel - ERROR: Could not import openstudio")
40
+ raise Exception("EnergyModel - Error: Could not import openstudio.")
38
41
 
39
42
  class EnergyModel:
40
43
  '''
@@ -3,6 +3,21 @@ import topologic
3
3
  from topologicpy.Vector import Vector
4
4
  from topologicpy.Wire import Wire
5
5
  import math
6
+ import os
7
+
8
+ try:
9
+ import numpy as np
10
+ except:
11
+ print("Face - Installing required numpy library.")
12
+ try:
13
+ os.system("pip install numpy")
14
+ except:
15
+ os.system("pip install numpy --user")
16
+ try:
17
+ import numpy as np
18
+ print("Face - numpy library installed correctly.")
19
+ except:
20
+ raise Exception("Face - Error: Could not import numpy.")
6
21
 
7
22
  class Face(topologic.Face):
8
23
  @staticmethod
@@ -1644,7 +1659,6 @@ class Face(topologic.Face):
1644
1659
 
1645
1660
  @staticmethod
1646
1661
  def RectangleByPlaneEquation(origin: topologic.Vertex = None, width: float = 1.0, length: float = 1.0, placement: str = "center", equation: dict = None, tolerance: float = 0.0001) -> topologic.Face:
1647
- import numpy as np
1648
1662
  from topologicpy.Vertex import Vertex
1649
1663
  # Extract coefficients of the plane equation
1650
1664
  a = equation['a']
@@ -8,35 +8,77 @@ import random
8
8
  import time
9
9
  import sys
10
10
  import subprocess
11
+ import os
12
+
11
13
  try:
12
- from tqdm.auto import tqdm
14
+ import numpy as np
13
15
  except:
14
- call = [sys.executable, '-m', 'pip', 'install', 'tqdm', '-t', sys.path[0]]
15
- subprocess.run(call)
16
+ print("Graph - Installing required numpy library.")
16
17
  try:
17
- from tqdm.auto import tqdm
18
+ os.system("pip install numpy")
18
19
  except:
19
- print("Graph - Error: Could not import tqdm")
20
+ os.system("pip install numpy --user")
21
+ try:
22
+ import numpy as np
23
+ print("Graph - numpy library installed correctly.")
24
+ except:
25
+ raise Exception("Graph - Error: Could not import numpy.")
20
26
 
21
27
  try:
22
- import numpy as np
28
+ import pandas as pd
23
29
  except:
24
- call = [sys.executable, '-m', 'pip', 'install', 'numpy', '-t', sys.path[0]]
25
- subprocess.run(call)
30
+ print("Graph - Installing required pandas library.")
26
31
  try:
27
- import numpy as np
32
+ os.system("pip install pandas")
33
+ except:
34
+ os.system("pip install pandas --user")
35
+ try:
36
+ import pandas as pd
37
+ print("Graph - pandas library installed correctly.")
38
+ except:
39
+ raise Exception("Graph - Error: Could not import pandas.")
40
+
41
+ try:
42
+ from tqdm.auto import tqdm
43
+ except:
44
+ print("Graph - Installing required tqdm library.")
45
+ try:
46
+ os.system("pip install tqdm")
47
+ except:
48
+ os.system("pip install tqdm --user")
49
+ try:
50
+ from tqdm.auto import tqdm
51
+ print("Graph - tqdm library installed correctly.")
28
52
  except:
29
- print("Graph - Error: Could not import numpy")
53
+ raise Exception("Graph - Error: Could not import tqdm.")
30
54
 
31
55
  try:
32
56
  from pyvis.network import Network
33
57
  except:
34
- call = [sys.executable, '-m', 'pip', 'install', 'pyvis', '-t', sys.path[0]]
35
- subprocess.run(call)
58
+ print("Graph - Installing required pyvis library.")
59
+ try:
60
+ os.system("pip install pyvis")
61
+ except:
62
+ os.system("pip install pyvis --user")
36
63
  try:
37
64
  from pyvis.network import Network
65
+ print("Graph - pyvis library installed correctly.")
66
+ except:
67
+ raise Exception("Graph - Error: Could not import pyvis")
68
+
69
+ try:
70
+ import networkx as nx
71
+ except:
72
+ print("Graph - Installing required networkx library.")
73
+ try:
74
+ os.system("pip install networkx")
75
+ except:
76
+ os.system("pip install networkx --user")
77
+ try:
78
+ import networkx as nx
79
+ print("Graph - networkx library installed correctly.")
38
80
  except:
39
- print("Graph - Error: Could not import pyvis")
81
+ raise Exception("Graph - Error: Could not import networkx.")
40
82
 
41
83
  class _Tree:
42
84
  def __init__(self, node="", *children):
@@ -472,16 +514,6 @@ class Graph:
472
514
  returnList[index] = returnList[index]+1
473
515
  return returnList
474
516
 
475
- try:
476
- from tqdm.auto import tqdm
477
- except:
478
- call = [sys.executable, '-m', 'pip', 'install', 'tqdm', '-t', sys.path[0]]
479
- subprocess.run(call)
480
- try:
481
- from tqdm.auto import tqdm
482
- except:
483
- print("Graph.BetweenessCentrality - Error: Could not import tqdm")
484
-
485
517
  if not isinstance(graph, topologic.Graph):
486
518
  print("Graph.BetweenessCentrality - Error: The input graph is not a valid graph. Returning None.")
487
519
  return None
@@ -551,7 +583,7 @@ class Graph:
551
583
  The created graph.
552
584
 
553
585
  """
554
- import pandas as pd
586
+
555
587
  # Read the adjacency matrix from CSV file using pandas
556
588
  adjacency_matrix_df = pd.read_csv(path, header=None)
557
589
 
@@ -682,7 +714,6 @@ class Graph:
682
714
  from topologicpy.Edge import Edge
683
715
  from topologicpy.Topology import Topology
684
716
  from topologicpy.Dictionary import Dictionary
685
- import pandas as pd
686
717
  import os
687
718
  from os.path import exists, isdir
688
719
  import yaml
@@ -2791,18 +2822,6 @@ class Graph:
2791
2822
  The closeness centrality of the input list of vertices within the input graph. The values are in the range 0 to 1.
2792
2823
 
2793
2824
  """
2794
- import sys
2795
- import subprocess
2796
-
2797
- try:
2798
- from tqdm.auto import tqdm
2799
- except:
2800
- call = [sys.executable, '-m', 'pip', 'install', 'tqdm', '-t', sys.path[0]]
2801
- subprocess.run(call)
2802
- try:
2803
- from tqdm.auto import tqdm
2804
- except:
2805
- print("DGL - Error: Could not import tqdm")
2806
2825
 
2807
2826
  if not isinstance(graph, topologic.Graph):
2808
2827
  print("Graph.ClosenessCentrality - Error: The input graph is not a valid graph. Returning None.")
@@ -3188,7 +3207,6 @@ class Graph:
3188
3207
  ----------
3189
3208
  path : str
3190
3209
  The desired path to the output folder where the graphs, edges, and nodes CSV files will be saved.
3191
- import pandas as pd
3192
3210
 
3193
3211
  Returns
3194
3212
  -------
@@ -3196,7 +3214,6 @@ class Graph:
3196
3214
  True if the graph has been successfully exported. False otherwise.
3197
3215
 
3198
3216
  """
3199
- import pandas as pd
3200
3217
 
3201
3218
  # Convert the adjacency matrix (nested list) to a DataFrame
3202
3219
  adjacency_matrix_df = pd.DataFrame(adjacencyMatrix)
@@ -3327,7 +3344,6 @@ class Graph:
3327
3344
  import os
3328
3345
  import math
3329
3346
  import random
3330
- import pandas as pd
3331
3347
  import os
3332
3348
  from os.path import exists
3333
3349
 
@@ -4517,16 +4533,6 @@ class Graph:
4517
4533
  if not isinstance(graph, topologic.Graph):
4518
4534
  print("Graph.NetworkXGraph - Error: The input graph is not a valid graph. Returning None.")
4519
4535
  return None
4520
- try:
4521
- import networkx as nx
4522
- except:
4523
- call = [sys.executable, '-m', 'pip', 'install', 'networkx', '-t', sys.path[0]]
4524
- subprocess.run(call)
4525
- try:
4526
- import networkx as nx
4527
- except:
4528
- print("Graph.NetworkXGraph - ERROR: Could not import networkx. Returning None.")
4529
- return None
4530
4536
 
4531
4537
  nxGraph = nx.Graph()
4532
4538
  vertices = Graph.Vertices(graph)
@@ -5009,7 +5015,7 @@ class Graph:
5009
5015
  @staticmethod
5010
5016
  def Show(graph, vertexColor="black", vertexSize=6, vertexLabelKey=None, vertexGroupKey=None, vertexGroups=[], showVertices=True, showVertexLegend=False, edgeColor="black", edgeWidth=1, edgeLabelKey=None, edgeGroupKey=None, edgeGroups=[], showEdges=True, showEdgeLegend=False, colorScale='viridis', renderer="notebook",
5011
5017
  width=950, height=500, xAxis=False, yAxis=False, zAxis=False, axisSize=1, backgroundColor='rgba(0,0,0,0)', marginLeft=0, marginRight=0, marginTop=20, marginBottom=0,
5012
- camera=None, target=None, up=None, tolerance=0.0001):
5018
+ camera=[-1.25, -1.25, 1.25], center=[0, 0, 0], up=[0, 0, 1], projection="perspective", tolerance=0.0001):
5013
5019
  """
5014
5020
  Shows the graph using Plotly.
5015
5021
 
@@ -5088,11 +5094,14 @@ class Graph:
5088
5094
  marginBottom : int , optional
5089
5095
  The size in pixels of the bottom margin. The default value is 0.
5090
5096
  camera : list , optional
5091
- The desired location of the camera. The default is [0,0,0].
5092
- target : list , optional
5093
- The desired camera target. The default is [0,0,0].
5097
+ The desired location of the camera). The default is [-1.25,-1.25,1.25].
5098
+ center : list , optional
5099
+ The desired center (camera target). The default is [0,0,0].
5094
5100
  up : list , optional
5095
5101
  The desired up vector. The default is [0,0,1].
5102
+ projection : str , optional
5103
+ The desired type of projection. The options are "orthographic" or "perspective". It is case insensitive. The default is "perspective"
5104
+
5096
5105
  tolerance : float , optional
5097
5106
  The desired tolerance. The default is 0.0001.
5098
5107
 
@@ -5110,7 +5119,7 @@ class Graph:
5110
5119
  data= Plotly.DataByGraph(graph, vertexColor=vertexColor, vertexSize=vertexSize, vertexLabelKey=vertexLabelKey, vertexGroupKey=vertexGroupKey, vertexGroups=vertexGroups, showVertices=showVertices, showVertexLegend=showVertexLegend, edgeColor=edgeColor, edgeWidth=edgeWidth, edgeLabelKey=edgeLabelKey, edgeGroupKey=edgeGroupKey, edgeGroups=edgeGroups, showEdges=showEdges, showEdgeLegend=showEdgeLegend, colorScale=colorScale)
5111
5120
  fig = Plotly.FigureByData(data, width=width, height=height, xAxis=xAxis, yAxis=yAxis, zAxis=zAxis, axisSize=axisSize, backgroundColor=backgroundColor,
5112
5121
  marginLeft=marginLeft, marginRight=marginRight, marginTop=marginTop, marginBottom=marginBottom, tolerance=tolerance)
5113
- Plotly.Show(fig, renderer=renderer, camera=camera, target=target, up=up)
5122
+ Plotly.Show(fig, renderer=renderer, camera=camera, center=center, up=up, projection=projection)
5114
5123
 
5115
5124
  @staticmethod
5116
5125
  def Size(graph):
@@ -5342,17 +5351,6 @@ class Graph:
5342
5351
  from topologicpy.Wire import Wire
5343
5352
  from topologicpy.Cluster import Cluster
5344
5353
  from topologicpy.Topology import Topology
5345
- import sys
5346
- import subprocess
5347
- try:
5348
- from tqdm.auto import tqdm
5349
- except:
5350
- call = [sys.executable, '-m', 'pip', 'install', 'tqdm', '-t', sys.path[0]]
5351
- subprocess.run(call)
5352
- try:
5353
- from tqdm.auto import tqdm
5354
- except:
5355
- print("Graph.VisibilityGraph - Error: Could not import tqdm")
5356
5354
 
5357
5355
  def addEdge(edge, edges, viewpointsA, viewpointsB, tolerance=0.0001):
5358
5356
  # Add edge to edges only if its end points are in vertices
@@ -1,7 +1,22 @@
1
1
  import topologicpy
2
- import numpy as np
3
- import numpy.linalg as la
4
2
  import math
3
+ import os
4
+
5
+ try:
6
+ import numpy as np
7
+ import numpy.linalg as la
8
+ except:
9
+ print("Helper - Installing required numpy library.")
10
+ try:
11
+ os.system("pip install numpy")
12
+ except:
13
+ os.system("pip install numpy --user")
14
+ try:
15
+ import numpy as np
16
+ import numpy.linalg as la
17
+ print("Helper - numpy library installed correctly.")
18
+ except:
19
+ raise Exception("Helper - Error: Could not import numpy.")
5
20
 
6
21
  class Helper:
7
22
  @staticmethod