nastasiasnk commited on
Commit
0a00112
1 Parent(s): 522ea95

Update imports_utils.py

Browse files
Files changed (1) hide show
  1. imports_utils.py +42 -20
imports_utils.py CHANGED
@@ -142,31 +142,53 @@ def get_page_by_id(notion_db_pages, page_id):
142
 
143
  """
144
 
145
- def streamMatrices (speckleToken, stream_id, branch_name_dm, commit_id):
 
 
 
 
 
 
 
 
 
 
146
 
147
-
148
- #stream_id="ebcfc50abe"
149
- stream_distance_matrices = speckle_utils.getSpeckleStream(stream_id,
150
- branch_name_dm,
151
- CLIENT,
152
- commit_id = commit_id_dm)
153
 
154
- return stream_distance_matrices
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  """
156
 
157
 
 
158
  def fetchDomainMapper (luAttributePages):
159
 
160
  lu_domain_mapper ={}
161
  subdomains_unique = []
162
 
163
  for page in lu_attributes:
164
- value_landuse = get_property_value(page, "LANDUSE")
165
- value_subdomain = get_property_value(page, "SUBDOMAIN_LIVEABILITY")
166
- if value_subdomain and value_landuse:
167
- lu_domain_mapper[value_landuse] = value_subdomain
168
- if value_subdomain != "":
169
- subdomains_unique.append(value_subdomain)
170
 
171
  #subdomains_unique = list(set(subdomains_unique))
172
  return lu_domain_mapper
@@ -179,14 +201,14 @@ def fetchSubdomainMapper (livability_attributes):
179
  domains_unique = []
180
 
181
  for page in domain_attributes:
182
- subdomain = get_property_value(page, "SUBDOMAIN_UNIQUE")
183
- sqm_per_employee = get_property_value(page, "SQM PER EMPL")
184
- thresholds = get_property_value(page, "MANHATTAN THRESHOLD")
185
- max_points = get_property_value(page, "LIVABILITY MAX POINT")
186
- domain = get_property_value(page, "DOMAIN")
187
  if thresholds:
188
  attribute_mapper[subdomain] = {
189
- 'sqmPerEmpl': [sqm_per_employee if sqm_per_employee != "" else 0],
190
  'thresholds': thresholds,
191
  'max_points': max_points,
192
  'domain': [domain if domain != "" else 0]
 
142
 
143
  """
144
 
145
+ landuseMapperDict ={}
146
+ subdomains_unique = []
147
+
148
+ for page in landuse_attributes:
149
+ value_landuse = get_property_value(page, landuseColumnName)
150
+ value_subdomain = get_property_value(page, subdomainColumnName)
151
+ if value_subdomain and value_landuse:
152
+ landuseMapperDict[value_landuse] = value_subdomain
153
+ if value_subdomain != "":
154
+ subdomains_unique.append(value_subdomain)
155
+
156
 
 
 
 
 
 
 
157
 
158
+ attributeMapperDict ={}
159
+ domains_unique = []
160
+
161
+ for page in livability_attributes:
162
+ subdomain = get_property_value(page, subdomainColumnName)
163
+ sqm_per_employee = get_property_value(page, sqmPerEmployeeColumnName)
164
+ thresholds = get_property_value(page, thresholdsColumnName)
165
+ max_points = get_property_value(page, maxPointsColumnName)
166
+ domain = get_property_value(page, domainColumnName)
167
+ if thresholds:
168
+ attributeMapperDict[subdomain] = {
169
+ 'sqmPerEmpl': sqm_per_employee if sqm_per_employee != "" else 0,
170
+ 'thresholds': thresholds,
171
+ 'max_points': max_points,
172
+ 'domain': [domain if domain != "" else 0]
173
+ }
174
+ if domain != "":
175
+ domains_unique.append(domain)
176
  """
177
 
178
 
179
+
180
  def fetchDomainMapper (luAttributePages):
181
 
182
  lu_domain_mapper ={}
183
  subdomains_unique = []
184
 
185
  for page in lu_attributes:
186
+ value_landuse = get_property_value(page, landuseColumnName)
187
+ value_subdomain = get_property_value(page, subdomainColumnName)
188
+ if value_subdomain and value_landuse:
189
+ lu_domain_mapper[value_landuse] = value_subdomain
190
+ if value_subdomain != "":
191
+ subdomains_unique.append(value_subdomain)
192
 
193
  #subdomains_unique = list(set(subdomains_unique))
194
  return lu_domain_mapper
 
201
  domains_unique = []
202
 
203
  for page in domain_attributes:
204
+ subdomain = get_property_value(page, subdomainColumnName)
205
+ sqm_per_employee = get_property_value(page, sqmPerEmployeeColumnName)
206
+ thresholds = get_property_value(page, thresholdsColumnName)
207
+ max_points = get_property_value(page, maxPointsColumnName)
208
+ domain = get_property_value(page, domainColumnName)
209
  if thresholds:
210
  attribute_mapper[subdomain] = {
211
+ 'sqmPerEmpl': sqm_per_employee if sqm_per_employee != "" else 0,
212
  'thresholds': thresholds,
213
  'max_points': max_points,
214
  'domain': [domain if domain != "" else 0]