Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -79,7 +79,7 @@ else:
|
|
79 |
|
80 |
df_dm = matrices[distanceMatrixActivityNodes]
|
81 |
|
82 |
-
|
83 |
|
84 |
|
85 |
|
@@ -172,21 +172,6 @@ def test(input_json):
|
|
172 |
|
173 |
from imports_utils import splitDictByStrFragmentInColumnName
|
174 |
|
175 |
-
"""
|
176 |
-
# List containing the substrings to check against
|
177 |
-
tranportModes = ["DRT", "GMT", "HSR"]
|
178 |
-
|
179 |
-
result_dicts = splitDictByStrFragmentInColumnName(df_dm_transport_dictionary, tranportModes)
|
180 |
-
|
181 |
-
# Accessing each dictionary
|
182 |
-
art_dict = result_dicts["DRT"]
|
183 |
-
gmt_dict = result_dicts["GMT"]
|
184 |
-
|
185 |
-
df_art_matrix = pd.DataFrame(art_dict).T
|
186 |
-
df_art_matrix = df_art_matrix.round(0).astype(int)
|
187 |
-
df_gmt_matrix = pd.DataFrame(gmt_dict).T
|
188 |
-
df_gmt_matrix = df_art_matrix.round(0).astype(int)
|
189 |
-
|
190 |
"""
|
191 |
|
192 |
# create a mask based on the matrix size and ids, crop activity nodes to the mask
|
@@ -241,17 +226,18 @@ def test(input_json):
|
|
241 |
subdomainsAccessibility_dictionary = subdomainsAccessibility.to_dict('index')
|
242 |
LivabilitySubdomainsWeights_dictionary = LivabilitySubdomainsWeights.to_dict('index')
|
243 |
|
244 |
-
|
245 |
# Prepare the output
|
246 |
output = {
|
247 |
-
"subdomainsAccessibility_dictionary": subdomainsAccessibility_dictionary,
|
248 |
-
"livability_dictionary": livability_dictionary,
|
249 |
-
"subdomainsWeights_dictionary": LivabilitySubdomainsInputs_dictionary,
|
250 |
-
"luDomainMapper": landuseMapperDict,
|
251 |
-
"attributeMapper": livabilityMapperDict,
|
252 |
-
"fetchDm":
|
253 |
-
|
254 |
-
"
|
|
|
255 |
}
|
256 |
|
257 |
|
|
|
79 |
|
80 |
df_dm = matrices[distanceMatrixActivityNodes]
|
81 |
|
82 |
+
df_dm_dict = df_dm.to_dict('index')
|
83 |
|
84 |
|
85 |
|
|
|
172 |
|
173 |
from imports_utils import splitDictByStrFragmentInColumnName
|
174 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
"""
|
176 |
|
177 |
# create a mask based on the matrix size and ids, crop activity nodes to the mask
|
|
|
226 |
subdomainsAccessibility_dictionary = subdomainsAccessibility.to_dict('index')
|
227 |
LivabilitySubdomainsWeights_dictionary = LivabilitySubdomainsWeights.to_dict('index')
|
228 |
|
229 |
+
"""
|
230 |
# Prepare the output
|
231 |
output = {
|
232 |
+
#"subdomainsAccessibility_dictionary": subdomainsAccessibility_dictionary,
|
233 |
+
#"livability_dictionary": livability_dictionary,
|
234 |
+
#"subdomainsWeights_dictionary": LivabilitySubdomainsInputs_dictionary,
|
235 |
+
#"luDomainMapper": landuseMapperDict,
|
236 |
+
#"attributeMapper": livabilityMapperDict,
|
237 |
+
"fetchDm": df_dm_dict
|
238 |
+
|
239 |
+
#"landuses":df_lu_filtered_dict,
|
240 |
+
#"constants": [alpha, threshold]
|
241 |
}
|
242 |
|
243 |
|