nastasiasnk commited on
Commit
28d21d7
1 Parent(s): 79b6783

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -27,14 +27,14 @@ landuse_attributes = fetch_all_database_pages(notion, landuseDatabaseId)
27
  livability_attributes = fetch_all_database_pages(notion, subdomainAttributesDatabaseId)
28
 
29
  # fetch the dictionary with landuse - domain pairs
30
- lu_domain_mapper ={}
31
  subdomains_unique = []
32
 
33
  for page in landuse_attributes:
34
  value_landuse = get_property_value(page, "LANDUSE")
35
  value_subdomain = get_property_value(page, "SUBDOMAIN_LIVEABILITY")
36
  if value_subdomain and value_landuse:
37
- lu_domain_mapper[value_landuse] = value_subdomain
38
  if value_subdomain != "":
39
  subdomains_unique.append(value_subdomain)
40
 
@@ -42,8 +42,7 @@ for page in landuse_attributes:
42
 
43
 
44
  # fetch the dictionary with subdomain attribute data
45
-
46
- attribute_mapper ={}
47
  domains_unique = []
48
 
49
  for page in livability_attributes:
@@ -53,7 +52,7 @@ for page in livability_attributes:
53
  max_points = get_property_value(page, "LIVABILITY MAX POINT")
54
  domain = get_property_value(page, "DOMAIN")
55
  if thresholds:
56
- attribute_mapper[subdomain] = {
57
  'sqmPerEmpl': [sqm_per_employee if sqm_per_employee != "" else 0],
58
  'thresholds': thresholds,
59
  'max_points': max_points,
@@ -83,8 +82,8 @@ def test(input_json):
83
 
84
  matrix = inputs['input']["matrix"]
85
  landuses = inputs['input']["landuse_areas"]
86
- attributeMapperDict = inputs['input']["attributeMapperDict"]
87
- landuseMapperDict = inputs['input']["landuseMapperDict"]
88
 
89
  alpha = inputs['input']["alpha"]
90
  alpha = float(alpha)
 
27
  livability_attributes = fetch_all_database_pages(notion, subdomainAttributesDatabaseId)
28
 
29
  # fetch the dictionary with landuse - domain pairs
30
+ landuseMapperDict ={}
31
  subdomains_unique = []
32
 
33
  for page in landuse_attributes:
34
  value_landuse = get_property_value(page, "LANDUSE")
35
  value_subdomain = get_property_value(page, "SUBDOMAIN_LIVEABILITY")
36
  if value_subdomain and value_landuse:
37
+ landuseMapperDict[value_landuse] = value_subdomain
38
  if value_subdomain != "":
39
  subdomains_unique.append(value_subdomain)
40
 
 
42
 
43
 
44
  # fetch the dictionary with subdomain attribute data
45
+ attributeMapperDict ={}
 
46
  domains_unique = []
47
 
48
  for page in livability_attributes:
 
52
  max_points = get_property_value(page, "LIVABILITY MAX POINT")
53
  domain = get_property_value(page, "DOMAIN")
54
  if thresholds:
55
+ attributeMapperDict[subdomain] = {
56
  'sqmPerEmpl': [sqm_per_employee if sqm_per_employee != "" else 0],
57
  'thresholds': thresholds,
58
  'max_points': max_points,
 
82
 
83
  matrix = inputs['input']["matrix"]
84
  landuses = inputs['input']["landuse_areas"]
85
+ #attributeMapperDict = inputs['input']["attributeMapperDict"]
86
+ #landuseMapperDict = inputs['input']["landuseMapperDict"]
87
 
88
  alpha = inputs['input']["alpha"]
89
  alpha = float(alpha)