nastasiasnk commited on
Commit
d4666b7
1 Parent(s): d96001e

Update imports_utils.py

Browse files
Files changed (1) hide show
  1. imports_utils.py +29 -28
imports_utils.py CHANGED
@@ -316,34 +316,35 @@ def accessibilityToLivability (DistanceMatrix,accessibilityInputs, SubdomainAttr
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
 
 
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