nastasiasnk commited on
Commit
3ea2200
1 Parent(s): f7c8cd8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -107,8 +107,7 @@ def test(input_json):
107
 
108
 
109
  LivabilitySubdomainsWeights = landusesToSubdomains(df_matrix,df_landuses_filtered,landuseMapperDict,subdomainsUnique)
110
- # make a dictionary to output in grasshopper / etc
111
- LivabilitySubdomainsWeights_dictionary = LivabilitySubdomainsWeights.to_dict('index')
112
 
113
 
114
 
@@ -119,7 +118,7 @@ def test(input_json):
119
 
120
  for domain in UniqueSubdomainsList:
121
  for key, value_list in SubdomainAttributeDict.items():
122
- sqm_per_empl = float(SubdomainAttributeDict[domain][0])
123
  if key in destinationWeights.columns and key == domain:
124
  if sqm_per_empl > 0:
125
  df_LivabilitySubdomainsWorkplaces['jobs'] += (round(destinationWeights[key] / sqm_per_empl,2)).fillna(0)
@@ -131,8 +130,10 @@ def test(input_json):
131
 
132
  WorkplacesNumber = FindWorkplaces(df_matrix,attributeMapperDict,LivabilitySubdomainsWeights,subdomainsUnique)
133
 
134
- LivabilitySubdomainsWeights =pd.concat([df_LivabilitySubdomainsArea, df_LivabilitySubdomainsWorkplaces], axis=1)
135
-
 
 
136
 
137
 
138
  def computeAccessibility (DistanceMatrix,weightsNames, destinationWeights=None,alpha = 0.0038, threshold = 600):
 
107
 
108
 
109
  LivabilitySubdomainsWeights = landusesToSubdomains(df_matrix,df_landuses_filtered,landuseMapperDict,subdomainsUnique)
110
+
 
111
 
112
 
113
 
 
118
 
119
  for domain in UniqueSubdomainsList:
120
  for key, value_list in SubdomainAttributeDict.items():
121
+ sqm_per_empl = float(SubdomainAttributeDict[domain]['sqmPerEmpl'])
122
  if key in destinationWeights.columns and key == domain:
123
  if sqm_per_empl > 0:
124
  df_LivabilitySubdomainsWorkplaces['jobs'] += (round(destinationWeights[key] / sqm_per_empl,2)).fillna(0)
 
130
 
131
  WorkplacesNumber = FindWorkplaces(df_matrix,attributeMapperDict,LivabilitySubdomainsWeights,subdomainsUnique)
132
 
133
+ LivabilitySubdomainsWeights =pd.concat([LivabilitySubdomainsWeights, WorkplacesNumber], axis=1)
134
+
135
+ # make a dictionary to output in grasshopper / etc
136
+ LivabilitySubdomainsWeights_dictionary = LivabilitySubdomainsWeights.to_dict('index')
137
 
138
 
139
  def computeAccessibility (DistanceMatrix,weightsNames, destinationWeights=None,alpha = 0.0038, threshold = 600):