topologicpy 0.5.8__py3-none-any.whl → 0.5.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- topologicpy/Color.py +33 -3
- topologicpy/DGL.py +122 -18
- topologicpy/Dictionary.py +3 -0
- topologicpy/EnergyModel.py +18 -37
- topologicpy/Graph.py +111 -43
- topologicpy/Topology.py +30 -16
- topologicpy/__init__.py +1 -1
- {topologicpy-0.5.8.dist-info → topologicpy-0.5.9.dist-info}/METADATA +2 -12
- {topologicpy-0.5.8.dist-info → topologicpy-0.5.9.dist-info}/RECORD +12 -12
- {topologicpy-0.5.8.dist-info → topologicpy-0.5.9.dist-info}/LICENSE +0 -0
- {topologicpy-0.5.8.dist-info → topologicpy-0.5.9.dist-info}/WHEEL +0 -0
- {topologicpy-0.5.8.dist-info → topologicpy-0.5.9.dist-info}/top_level.txt +0 -0
topologicpy/Color.py
CHANGED
@@ -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
|
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.")
|
topologicpy/DGL.py
CHANGED
@@ -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
|
topologicpy/Dictionary.py
CHANGED
@@ -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):
|
topologicpy/EnergyModel.py
CHANGED
@@ -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.
|
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,
|
topologicpy/Graph.py
CHANGED
@@ -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
|
-
|
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
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
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
|
-
|
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
|
-
|
6627
|
-
|
6628
|
-
|
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()
|
topologicpy/Topology.py
CHANGED
@@ -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
|
topologicpy/__init__.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: topologicpy
|
3
|
-
Version: 0.5.
|
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:
|
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
|
|
@@ -2,14 +2,14 @@ topologicpy/Aperture.py,sha256=vENYlFaM6Pu-xCJB1YsW1I1_u5yDj-A70aU3bo3lpFA,2819
|
|
2
2
|
topologicpy/Cell.py,sha256=qA-53s0ZDKzjaasRSuXuK-a55pZMORGHCw3uJ83k1Is,98603
|
3
3
|
topologicpy/CellComplex.py,sha256=en_cLuUIB1YkHdtUo3fkB3XTIfsA0YRqZTSPqG6qGLQ,47389
|
4
4
|
topologicpy/Cluster.py,sha256=Lg6d6wQ-hbPu-YAsprJmjXki8PTFcTnRgHmk9gjx60k,54978
|
5
|
-
topologicpy/Color.py,sha256=
|
5
|
+
topologicpy/Color.py,sha256=AnbSF-_8c7Zp0NKmHF3ydFxYJFA6IaPxuPKhQkamPfg,18454
|
6
6
|
topologicpy/Context.py,sha256=bgwslZSu8Ijuz3fusdhP6XcDnCdwGhtbI0-uhVjB36U,2977
|
7
|
-
topologicpy/DGL.py,sha256
|
8
|
-
topologicpy/Dictionary.py,sha256=
|
7
|
+
topologicpy/DGL.py,sha256=mpHcfAL8hWGKQFODRv_Qr1KezAP4fmXMvItmgSyimrA,143369
|
8
|
+
topologicpy/Dictionary.py,sha256=pvZL9N-pqyYGH6iODETvSd0nNOfHzxB6DkkgUTylZFs,26918
|
9
9
|
topologicpy/Edge.py,sha256=ZWR2icdFd7dMe8v-RPLAvg1C29hFFsMDBDlp85hluQk,50261
|
10
|
-
topologicpy/EnergyModel.py,sha256=
|
10
|
+
topologicpy/EnergyModel.py,sha256=SrUF1bShYJdryPcpi6rnECnqurXh09N7e4qCNkB9REc,51396
|
11
11
|
topologicpy/Face.py,sha256=xcVn0QfhSrxriDlp7h9NurqNh40KSTSUFlMGKf5V5y8,90780
|
12
|
-
topologicpy/Graph.py,sha256=
|
12
|
+
topologicpy/Graph.py,sha256=OiPLS4kuOHGv2maCDwM6amhEmq_EI-qhYf8l673Bs6g,372759
|
13
13
|
topologicpy/Grid.py,sha256=5Wi7nF6axNqhr4WrWk1c1fb7nftG02-BzxTYneeGr88,17389
|
14
14
|
topologicpy/Helper.py,sha256=dsMU4BAt6zKsYG-YiT_OE4kX2rq3dtl3AqMMd35-6DA,18250
|
15
15
|
topologicpy/Honeybee.py,sha256=p5OZi8tGPxUNH91_8peChEkYJdg5vpRyeqHVz8S9OS0,20356
|
@@ -19,11 +19,11 @@ topologicpy/Plotly.py,sha256=WfYMljK6drw98Q6DRCYCeCtu5X0bhVyIr_NxYea8oUE,94962
|
|
19
19
|
topologicpy/Polyskel.py,sha256=86B92P50crA5OU1wJHYm-21aATkgc2rfkINJ0FwtIek,16465
|
20
20
|
topologicpy/Shell.py,sha256=iB6xltLq9naiArVKfzHdAhv07kwQHOPYniHh944JHcM,76277
|
21
21
|
topologicpy/Speckle.py,sha256=3148ucY8YUrlEsUA3nryKmQqz2zcS3OCtAcxcYpzKkk,14775
|
22
|
-
topologicpy/Topology.py,sha256=
|
22
|
+
topologicpy/Topology.py,sha256=GYBlNEXP9pgZtzP6bVGr_u-ak5_93f29kqGXXUy4HVU,309634
|
23
23
|
topologicpy/Vector.py,sha256=3GayjTGJDhg6yuchN86yHWUV9hTyu-kp_HaWuBXu6fc,30476
|
24
24
|
topologicpy/Vertex.py,sha256=Te0RmdRQba1I21FcrAqlbJblUzJ07Xk44FKJiNtlgkw,66492
|
25
25
|
topologicpy/Wire.py,sha256=bD8uhOzsH6_NWgDtGtW84PNKWscsVOpmbYul9k8ShfU,131871
|
26
|
-
topologicpy/__init__.py,sha256=
|
26
|
+
topologicpy/__init__.py,sha256=46qRjTP5apsz37sasV3Q2WBe2Wi0BssqQCdFK0EhTFA,1444
|
27
27
|
topologicpy/bin/linux/topologic/__init__.py,sha256=XlFReDf3FWlYdM9uXtanYPIafgPb6GVTQczS_xJAXD0,60
|
28
28
|
topologicpy/bin/linux/topologic/libTKBO-6bdf205d.so.7.7.0,sha256=ANok9DQKcnWcLd9T_LAt-i-X4nsYYy16q9kQlcTre1E,2996488
|
29
29
|
topologicpy/bin/linux/topologic/libTKBRep-2960a069.so.7.7.0,sha256=OJ3XesL79du8LeBHrsleGPXub6OpJdOilxha0mwjqQo,1378768
|
@@ -84,8 +84,8 @@ topologicpy/bin/windows/topologic/topologic.cp310-win_amd64.pyd,sha256=F0sPLuMpD
|
|
84
84
|
topologicpy/bin/windows/topologic/topologic.cp311-win_amd64.pyd,sha256=aBAJQj3OmJ58MOAF1ZIFybL_5fFK7FNR9hrIps6b6pc,1551872
|
85
85
|
topologicpy/bin/windows/topologic/topologic.cp38-win_amd64.pyd,sha256=aLgNf54nbJmGc7Tdmkuy-V0m6B9zLxabIbpRwAy7cBA,1551360
|
86
86
|
topologicpy/bin/windows/topologic/topologic.cp39-win_amd64.pyd,sha256=_8cp205hiRxkFHtzQQOweA4DhCPk8caH4kTVLWGQeVw,1411584
|
87
|
-
topologicpy-0.5.
|
88
|
-
topologicpy-0.5.
|
89
|
-
topologicpy-0.5.
|
90
|
-
topologicpy-0.5.
|
91
|
-
topologicpy-0.5.
|
87
|
+
topologicpy-0.5.9.dist-info/LICENSE,sha256=RUmXeeqj63bBySLJjEfhwb9OE7M8h9K6HuOBF3ASVyI,35697
|
88
|
+
topologicpy-0.5.9.dist-info/METADATA,sha256=oXQy1lAyNEUFLJ3Owg8sWLoQi8X_mOBqlgmbp7NU-Lo,7044
|
89
|
+
topologicpy-0.5.9.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
90
|
+
topologicpy-0.5.9.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
|
91
|
+
topologicpy-0.5.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|