Update app.py
Browse files
app.py
CHANGED
|
@@ -84,6 +84,14 @@ def build_report():
|
|
| 84 |
pass
|
| 85 |
|
| 86 |
countries_geojson = load_geojson(GEOJSON_PATH)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
# Counters for clean reconciliation
|
| 89 |
scanned = 0
|
|
@@ -140,8 +148,7 @@ def build_report():
|
|
| 140 |
.sort_values("usage events", ascending=False)
|
| 141 |
.reset_index(drop=True)
|
| 142 |
)
|
| 143 |
-
|
| 144 |
-
print(map_df[map_df["country"].str.contains("France", case=False, na=False)])
|
| 145 |
# Log scale for nicer color spread (keeps small countries visible)
|
| 146 |
map_df["usage_log"] = map_df["usage events"].clip(lower=1).apply(lambda x: math.log10(x))
|
| 147 |
|
|
|
|
| 84 |
pass
|
| 85 |
|
| 86 |
countries_geojson = load_geojson(GEOJSON_PATH)
|
| 87 |
+
# DEBUG: find which property contains 'FRA'
|
| 88 |
+
sample_props = countries_geojson["features"][0]["properties"]
|
| 89 |
+
print("DEBUG geojson property keys:", list(sample_props.keys())[:50])
|
| 90 |
+
|
| 91 |
+
# Try a few common keys and see which one yields a match for FRA
|
| 92 |
+
for key in ["ISO3166-1-Alpha-3", "ISO_A3", "ADM0_A3", "name", "NAME", "ADMIN"]:
|
| 93 |
+
hits = [f for f in countries_geojson["features"] if f["properties"].get(key) == "FRA"]
|
| 94 |
+
print(f"DEBUG key={key}: matches={len(hits)}")
|
| 95 |
|
| 96 |
# Counters for clean reconciliation
|
| 97 |
scanned = 0
|
|
|
|
| 148 |
.sort_values("usage events", ascending=False)
|
| 149 |
.reset_index(drop=True)
|
| 150 |
)
|
| 151 |
+
|
|
|
|
| 152 |
# Log scale for nicer color spread (keeps small countries visible)
|
| 153 |
map_df["usage_log"] = map_df["usage events"].clip(lower=1).apply(lambda x: math.log10(x))
|
| 154 |
|