Spaces:
Sleeping
Sleeping
nastasiasnk
commited on
Commit
•
77e01dc
1
Parent(s):
f91b75c
Update imports_utils.py
Browse files- imports_utils.py +11 -6
imports_utils.py
CHANGED
@@ -128,15 +128,20 @@ def get_page_by_id(notion_db_pages, page_id):
|
|
128 |
def fetchDomainMapper (luAttributePages):
|
129 |
|
130 |
lu_domain_mapper ={}
|
131 |
-
subdomains_unique = []
|
132 |
|
133 |
for page in luAttributePages:
|
134 |
value_landuse = get_property_value(page, landuseColumnName)
|
135 |
value_subdomain = get_property_value(page, subdomainColumnName)
|
|
|
136 |
if value_subdomain and value_landuse:
|
137 |
-
lu_domain_mapper[value_landuse] =
|
138 |
-
|
139 |
-
|
|
|
|
|
|
|
|
|
140 |
|
141 |
#subdomains_unique = list(set(subdomains_unique))
|
142 |
return lu_domain_mapper
|
@@ -212,8 +217,8 @@ def landusesToSubdomains(DistanceMatrix, LanduseDf, LanduseToSubdomainDict, Uniq
|
|
212 |
df_LivabilitySubdomainsArea = pd.DataFrame(0, index=DistanceMatrix.index, columns=UniqueSubdomainsList)
|
213 |
|
214 |
for subdomain in UniqueSubdomainsList:
|
215 |
-
for lu,
|
216 |
-
if
|
217 |
if lu in LanduseDf.columns:
|
218 |
if LanduseDf[lu].notna().any():
|
219 |
df_LivabilitySubdomainsArea[subdomain] = df_LivabilitySubdomainsArea[subdomain].add(LanduseDf[lu], fill_value=0)
|
|
|
128 |
def fetchDomainMapper (luAttributePages):
|
129 |
|
130 |
lu_domain_mapper ={}
|
131 |
+
#subdomains_unique = []
|
132 |
|
133 |
for page in luAttributePages:
|
134 |
value_landuse = get_property_value(page, landuseColumnName)
|
135 |
value_subdomain = get_property_value(page, subdomainColumnName)
|
136 |
+
origin = "false" if not get_property_value(page, "is_origin_mask") else get_property_value(page, "is_origin_mask")
|
137 |
if value_subdomain and value_landuse:
|
138 |
+
lu_domain_mapper[value_landuse] = {
|
139 |
+
'subdomain livability': value_subdomain,
|
140 |
+
'is origin': origin
|
141 |
+
}
|
142 |
+
#lu_domain_mapper[value_landuse] = value_subdomain
|
143 |
+
#if value_subdomain != "":
|
144 |
+
#subdomains_unique.append(value_subdomain)
|
145 |
|
146 |
#subdomains_unique = list(set(subdomains_unique))
|
147 |
return lu_domain_mapper
|
|
|
217 |
df_LivabilitySubdomainsArea = pd.DataFrame(0, index=DistanceMatrix.index, columns=UniqueSubdomainsList)
|
218 |
|
219 |
for subdomain in UniqueSubdomainsList:
|
220 |
+
for lu, attributes in LanduseToSubdomainDict.items():
|
221 |
+
if attributes["subdomain livability"] == subdomain:
|
222 |
if lu in LanduseDf.columns:
|
223 |
if LanduseDf[lu].notna().any():
|
224 |
df_LivabilitySubdomainsArea[subdomain] = df_LivabilitySubdomainsArea[subdomain].add(LanduseDf[lu], fill_value=0)
|