Spaces:
Sleeping
Sleeping
nastasiasnk
commited on
Commit
•
cc63a78
1
Parent(s):
fdcef48
Update imports_utils.py
Browse files- imports_utils.py +15 -19
imports_utils.py
CHANGED
@@ -1,24 +1,5 @@
|
|
1 |
-
|
2 |
-
|
3 |
import sys
|
4 |
|
5 |
-
"""
|
6 |
-
# delete (if it already exists) , clone repro
|
7 |
-
!rm -rf RECODE_speckle_utils
|
8 |
-
!git clone https://github.com/SerjoschDuering/RECODE_speckle_utils
|
9 |
-
sys.path.append('/content/RECODE_speckle_utils')
|
10 |
-
"""
|
11 |
-
|
12 |
-
|
13 |
-
# import from repro
|
14 |
-
|
15 |
-
#import speckle_utils
|
16 |
-
|
17 |
-
#import data_utils
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
#import other libaries
|
23 |
from specklepy.api.client import SpeckleClient
|
24 |
from specklepy.api.credentials import get_default_account, get_local_accounts
|
@@ -245,3 +226,18 @@ def fetchDistanceMatrices (stream_distance_matrices):
|
|
245 |
return distance_matrices
|
246 |
|
247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import sys
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
#import other libaries
|
4 |
from specklepy.api.client import SpeckleClient
|
5 |
from specklepy.api.credentials import get_default_account, get_local_accounts
|
|
|
226 |
return distance_matrices
|
227 |
|
228 |
|
229 |
+
|
230 |
+
|
231 |
+
def splitDictByStrFragmentInColumnName(original_dict, substrings):
|
232 |
+
result_dicts = {substring: {} for substring in substrings}
|
233 |
+
for key, nested_dict in original_dict.items():
|
234 |
+
for subkey, value in nested_dict.items():
|
235 |
+
for substring in substrings:
|
236 |
+
if substring in subkey:
|
237 |
+
if key not in result_dicts[substring]:
|
238 |
+
result_dicts[substring][key] = {}
|
239 |
+
result_dicts[substring][key][subkey] = value
|
240 |
+
|
241 |
+
return result_dicts
|
242 |
+
|
243 |
+
|