Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -55,37 +55,33 @@ def display_interventions(interventions_df, m):
|
|
| 55 |
"""Display NGO interventions on the map"""
|
| 56 |
for index, row in interventions_df.iterrows():
|
| 57 |
village_status = row[interventions_df.columns[7]]
|
| 58 |
-
status = (
|
| 59 |
-
"Done ✅"
|
| 60 |
-
if row[interventions_df.columns[5]]
|
| 61 |
-
!= "Intervention prévue dans le futur / Planned future intervention"
|
| 62 |
-
and village_status
|
| 63 |
-
!= "Critique, Besoin d'aide en urgence / Critical, in urgent need of help"
|
| 64 |
-
else "Planned ⌛"
|
| 65 |
-
)
|
| 66 |
if (
|
| 67 |
row[interventions_df.columns[5]]
|
| 68 |
-
|
| 69 |
-
and village_status
|
| 70 |
-
!= "Critique, Besoin d'aide en urgence / Critical, in urgent need of help"
|
| 71 |
):
|
| 72 |
-
|
|
|
|
|
|
|
| 73 |
elif (
|
| 74 |
row[interventions_df.columns[5]]
|
| 75 |
!= "Intervention prévue dans le futur / Planned future intervention"
|
| 76 |
and village_status
|
| 77 |
-
|
| 78 |
):
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
| 80 |
else:
|
| 81 |
-
color_mk = "
|
|
|
|
| 82 |
|
| 83 |
intervention_type = row[interventions_df.columns[6]].split("/")[0].strip()
|
| 84 |
org = row[interventions_df.columns[1]]
|
| 85 |
city = row[interventions_df.columns[9]]
|
| 86 |
date = row[interventions_df.columns[4]]
|
| 87 |
population = row[interventions_df.columns[11]]
|
| 88 |
-
intervention_info = f"<b>Intervention Status:</b> {status}<br><b>Village Status:</b> {village_status.split('/')[0]}<br><b>Org:</b> {org}<br><b>Intervention:</b> {intervention_type}<br><b
|
| 89 |
if row["latlng"] is None:
|
| 90 |
continue
|
| 91 |
folium.Marker(
|
|
|
|
| 55 |
"""Display NGO interventions on the map"""
|
| 56 |
for index, row in interventions_df.iterrows():
|
| 57 |
village_status = row[interventions_df.columns[7]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
if (
|
| 59 |
row[interventions_df.columns[5]]
|
| 60 |
+
== "Intervention prévue dans le futur / Planned future intervention"
|
|
|
|
|
|
|
| 61 |
):
|
| 62 |
+
# future intervention
|
| 63 |
+
color_mk = "pink"
|
| 64 |
+
status = "Planned ⌛"
|
| 65 |
elif (
|
| 66 |
row[interventions_df.columns[5]]
|
| 67 |
!= "Intervention prévue dans le futur / Planned future intervention"
|
| 68 |
and village_status
|
| 69 |
+
!= "Critique, Besoin d'aide en urgence / Critical, in urgent need of help"
|
| 70 |
):
|
| 71 |
+
# past intervention and village not in a critical condition
|
| 72 |
+
color_mk = "green"
|
| 73 |
+
status = "Done ✅"
|
| 74 |
+
|
| 75 |
else:
|
| 76 |
+
color_mk = "darkgreen"
|
| 77 |
+
status = "Partial ⚠️"
|
| 78 |
|
| 79 |
intervention_type = row[interventions_df.columns[6]].split("/")[0].strip()
|
| 80 |
org = row[interventions_df.columns[1]]
|
| 81 |
city = row[interventions_df.columns[9]]
|
| 82 |
date = row[interventions_df.columns[4]]
|
| 83 |
population = row[interventions_df.columns[11]]
|
| 84 |
+
intervention_info = f"<b>Intervention Status:</b> {status}<br><b>Village Status:</b> {village_status.split('/')[0]}<br><b>Org:</b> {org}<br><b>Intervention:</b> {intervention_type}<br><b>Population:</b> {population}<br><b>📅 Date:</b> {date}"
|
| 85 |
if row["latlng"] is None:
|
| 86 |
continue
|
| 87 |
folium.Marker(
|