Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -199,7 +199,7 @@ async def compute_places_count_with_api_key(api_key, lat, lng, radius, places):
|
|
| 199 |
return None
|
| 200 |
|
| 201 |
|
| 202 |
-
|
| 203 |
lat, lon = candidate_point
|
| 204 |
|
| 205 |
features = {
|
|
@@ -209,24 +209,24 @@ async def compute_features(candidate_point, api_key, radius=5000):
|
|
| 209 |
}
|
| 210 |
|
| 211 |
for i,places in enumerate(GOOGLE_PLACE_TYPE_MAPPING):
|
| 212 |
-
total_count =
|
| 213 |
api_key,
|
| 214 |
lat,
|
| 215 |
lon,
|
| 216 |
radius,
|
| 217 |
places
|
| 218 |
-
)
|
| 219 |
|
| 220 |
features[f'num_{DATASET_COLUMNS[i]}'] = total_count
|
| 221 |
|
| 222 |
|
| 223 |
-
n_banks =
|
| 224 |
api_key,
|
| 225 |
lat,
|
| 226 |
lon,
|
| 227 |
radius,
|
| 228 |
['atm']
|
| 229 |
-
)
|
| 230 |
|
| 231 |
|
| 232 |
features.update({
|
|
|
|
| 199 |
return None
|
| 200 |
|
| 201 |
|
| 202 |
+
def compute_features(candidate_point, api_key, radius=5000):
|
| 203 |
lat, lon = candidate_point
|
| 204 |
|
| 205 |
features = {
|
|
|
|
| 209 |
}
|
| 210 |
|
| 211 |
for i,places in enumerate(GOOGLE_PLACE_TYPE_MAPPING):
|
| 212 |
+
total_count = asyncio.run(compute_places_count_with_api_key(
|
| 213 |
api_key,
|
| 214 |
lat,
|
| 215 |
lon,
|
| 216 |
radius,
|
| 217 |
places
|
| 218 |
+
))
|
| 219 |
|
| 220 |
features[f'num_{DATASET_COLUMNS[i]}'] = total_count
|
| 221 |
|
| 222 |
|
| 223 |
+
n_banks = syncio.run(compute_places_count_with_api_key(
|
| 224 |
api_key,
|
| 225 |
lat,
|
| 226 |
lon,
|
| 227 |
radius,
|
| 228 |
['atm']
|
| 229 |
+
))
|
| 230 |
|
| 231 |
|
| 232 |
features.update({
|