Spaces:
Sleeping
Sleeping
nastasiasnk
commited on
Commit
•
1729426
1
Parent(s):
521213c
Update app.py
Browse files
app.py
CHANGED
@@ -218,13 +218,15 @@ def test(input_json):
|
|
218 |
|
219 |
from imports_utils import landusesToSubdomains
|
220 |
from imports_utils import FindWorkplacesNumber
|
221 |
-
|
|
|
|
|
222 |
|
|
|
223 |
LivabilitySubdomainsWeights = landusesToSubdomains(df_dm,df_landuses_filtered,landuseMapperDict,subdomainsUnique)
|
224 |
|
225 |
|
226 |
|
227 |
-
|
228 |
"""
|
229 |
def FindWorkplacesNumber (DistanceMatrix,SubdomainAttributeDict,destinationWeights,UniqueSubdomainsList ):
|
230 |
|
@@ -248,7 +250,7 @@ def test(input_json):
|
|
248 |
LivabilitySubdomainsInputs =pd.concat([LivabilitySubdomainsWeights, WorkplacesNumber], axis=1)
|
249 |
|
250 |
|
251 |
-
|
252 |
def computeAccessibility (DistanceMatrix, destinationWeights=None,alpha = 0.0038, threshold = 600):
|
253 |
|
254 |
decay_factors = np.exp(-alpha * DistanceMatrix) * (DistanceMatrix <= threshold)
|
@@ -262,7 +264,7 @@ def test(input_json):
|
|
262 |
print("Destination weights parameter is None")
|
263 |
|
264 |
return subdomainsAccessibility
|
265 |
-
|
266 |
|
267 |
|
268 |
|
@@ -276,19 +278,17 @@ def test(input_json):
|
|
276 |
|
277 |
return pointOfInterestAccessibility
|
278 |
|
|
|
|
|
|
|
279 |
|
|
|
280 |
|
281 |
subdomainsAccessibility = computeAccessibility(df_dm,LivabilitySubdomainsInputs,alpha,threshold)
|
282 |
artAccessibility = computeAccessibility_pointOfInterest(df_art_matrix,'ART',alpha,threshold)
|
283 |
gmtAccessibility = computeAccessibility_pointOfInterest(df_gmt_matrix,'GMT+HSR',alpha,threshold)
|
284 |
-
|
285 |
AccessibilityInputs = pd.concat([subdomainsAccessibility, artAccessibility,gmtAccessibility], axis=1)
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
def remap(value, B_min, B_max, C_min, C_max):
|
290 |
-
return C_min + (((value - B_min) / (B_max - B_min))* (C_max - C_min))
|
291 |
-
|
292 |
|
293 |
if 'jobs' not in subdomainsAccessibility.columns:
|
294 |
print("Error: Column 'jobs' does not exist in the subdomainsAccessibility.")
|
|
|
218 |
|
219 |
from imports_utils import landusesToSubdomains
|
220 |
from imports_utils import FindWorkplacesNumber
|
221 |
+
from imports_utils import computeAccessibility
|
222 |
+
from imports_utils import computeAccessibility_pointOfInterest
|
223 |
+
from imports_utils import remap
|
224 |
|
225 |
+
|
226 |
LivabilitySubdomainsWeights = landusesToSubdomains(df_dm,df_landuses_filtered,landuseMapperDict,subdomainsUnique)
|
227 |
|
228 |
|
229 |
|
|
|
230 |
"""
|
231 |
def FindWorkplacesNumber (DistanceMatrix,SubdomainAttributeDict,destinationWeights,UniqueSubdomainsList ):
|
232 |
|
|
|
250 |
LivabilitySubdomainsInputs =pd.concat([LivabilitySubdomainsWeights, WorkplacesNumber], axis=1)
|
251 |
|
252 |
|
253 |
+
"""
|
254 |
def computeAccessibility (DistanceMatrix, destinationWeights=None,alpha = 0.0038, threshold = 600):
|
255 |
|
256 |
decay_factors = np.exp(-alpha * DistanceMatrix) * (DistanceMatrix <= threshold)
|
|
|
264 |
print("Destination weights parameter is None")
|
265 |
|
266 |
return subdomainsAccessibility
|
267 |
+
|
268 |
|
269 |
|
270 |
|
|
|
278 |
|
279 |
return pointOfInterestAccessibility
|
280 |
|
281 |
+
|
282 |
+
def remap(value, B_min, B_max, C_min, C_max):
|
283 |
+
return C_min + (((value - B_min) / (B_max - B_min))* (C_max - C_min))
|
284 |
|
285 |
+
"""
|
286 |
|
287 |
subdomainsAccessibility = computeAccessibility(df_dm,LivabilitySubdomainsInputs,alpha,threshold)
|
288 |
artAccessibility = computeAccessibility_pointOfInterest(df_art_matrix,'ART',alpha,threshold)
|
289 |
gmtAccessibility = computeAccessibility_pointOfInterest(df_gmt_matrix,'GMT+HSR',alpha,threshold)
|
|
|
290 |
AccessibilityInputs = pd.concat([subdomainsAccessibility, artAccessibility,gmtAccessibility], axis=1)
|
291 |
+
|
|
|
|
|
|
|
|
|
|
|
292 |
|
293 |
if 'jobs' not in subdomainsAccessibility.columns:
|
294 |
print("Error: Column 'jobs' does not exist in the subdomainsAccessibility.")
|