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