Spaces:
Sleeping
Sleeping
nastasiasnk
commited on
Commit
•
31c3bf8
1
Parent(s):
68472bb
Update imports_utils.py
Browse files- imports_utils.py +29 -3
imports_utils.py
CHANGED
@@ -316,8 +316,34 @@ def accessibilityToLivability (DistanceMatrix,accessibilityInputs, SubdomainAttr
|
|
316 |
|
317 |
return livability
|
318 |
|
319 |
-
|
320 |
-
|
321 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
322 |
|
323 |
|
|
|
316 |
|
317 |
return livability
|
318 |
|
319 |
+
def findUniqueDomains (livabilityMapperDict):
|
320 |
+
# find a set of unique domains, to which subdomains are aggregated
|
321 |
+
temp = []
|
322 |
+
for key, values in livabilityMapperDict.items():
|
323 |
+
domain = livabilityMapperDict[key]['domain']
|
324 |
+
for item in domain:
|
325 |
+
if ',' in item:
|
326 |
+
domain_list = item.split(',')
|
327 |
+
livabilityMapperDict[key]['domain'] = domain_list
|
328 |
+
for domain in domain_list:
|
329 |
+
temp.append(domain)
|
330 |
+
else:
|
331 |
+
if item != 0:
|
332 |
+
temp.append(item)
|
333 |
+
|
334 |
+
domainsUnique = list(set(temp))
|
335 |
+
return domainsUnique
|
336 |
+
|
337 |
+
|
338 |
+
def findUniqueSubdomains (landuseMapperDict):
|
339 |
+
# find a list of unique subdomains, to which land uses are aggregated
|
340 |
+
temp = []
|
341 |
+
for key, values in landuseMapperDict.items():
|
342 |
+
subdomain = str(landuseMapperDict[key]["subdomain livability"])
|
343 |
+
if subdomain != 0:
|
344 |
+
temp.append(subdomain)
|
345 |
+
|
346 |
+
subdomainsUnique = list(set(temp))
|
347 |
+
return subdomainsUnique
|
348 |
|
349 |
|