How arkadipsom-code/india-climate-resilience-dashboard works
Purpose and Entry Point
This is a Streamlit analytical dashboard for evaluating climate resilience across Indian metropolitan areas, forecasting selected climate trends through 2040, and recommending adaptation-capital allocations. The application entry point and UI composition layer is app.py.
Data Foundation
The system starts with a city-level historical input matrix in data/city_data.csv. This dataset supplies climate, population, water, and infrastructure variables used by both scoring and forecasting workflows. It is the principal boundary between source data and analytical logic.
Risk Scoring Pipeline
modules/risk_engine.py transforms raw city indicators into comparable 0–100 values through Min-Max standardization, then calculates heatwave, flood, water-stress, population-pressure, and infrastructure-readiness indexes. It combines these into the unified resilience score and maps each city to an operational resilience tier.
Key paths:
• modules/risk_engine.py
• data/city_data.csv
Forecasting Stage
modules/forecast_engine.py owns predictive simulation for temperature drift and extreme-weather-event frequency. It uses OLS linear regression to project city trends through 2040. Forecast outputs are a separate analytical input to dashboard reporting and future-oriented risk interpretation rather than a replacement for the base city dataset.
Key paths:
• modules/forecast_engine.py
• data/city_data.csv
Capital Allocation Engine
modules/investment_engine.py converts localized vulnerabilities into budget recommendations. It accepts a user-defined adaptation fund pool, up to ₹20,000 Crores according to the product specification, and prioritizes investments toward the highest-risk dimensions and cities.
Key paths:
• modules/investment_engine.py
• modules/risk_engine.py
Dashboard Orchestration and User Boundary
app.py orchestrates data loading, calls the risk, forecast, and investment engines, and presents interactive status alerts, visual distributions, maps, and configurable allocation views. Streamlit is the material runtime/UI framework; application dependencies are declared in requirements.txt.
Key paths:
• app.py
• requirements.txt
Primary Control Flow
1. Load city data from data/city_data.csv.
2. Compute normalized risk vectors, resilience scores, and vulnerability tiers in modules/risk_engine.py.
3. Generate long-range climate projections through modules/forecast_engine.py.
4. Apply budget and prioritization inputs in modules/investment_engine.py.
5. Render current risks, forecasts, and recommended allocations in app.py.
The core architectural boundary is between deterministic analytical engines under modules/ and the Streamlit presentation/orchestration layer in app.py.
Main entry points: app.py Dashboard orchestration · risk_engine.py Risk scoring engine · investment_engine.py Capital allocation engine · city_data.csv City historical matrix
Components 9
Dashboard
- Streamlit runtime
- Dashboard orchestration · Loads data, invokes engines, and renders analytical views.
app.py - Adaptation fund input · Configurable pool up to ₹20,000 Crores.
- Risk, forecast & allocation views · Alerts, distributions, maps, and allocation recommendations.
Analytical Engines
Deterministic climate analysis and allocation logic.
- Risk scoring engine · Normalizes indicators, derives risk indexes, scores, and resilience tiers.
modules/risk_engine.py - Forecast engine · Uses OLS regression to project temperature and extreme-event trends through 2040.
modules/forecast_engine.py - Capital allocation engine · Prioritizes city vulnerabilities within the user-defined adaptation fund.
modules/investment_engine.py
Data Foundation
- City historical matrix · Climate, population, water, and infrastructure inputs by city.
data/city_data.csv
Other components
- Application dependencies
requirements.txt
Connections 14
- Application dependencies → Streamlit runtime: declares
- Streamlit runtime → Dashboard orchestration: runs
- City historical matrix → Dashboard orchestration: loads
- City historical matrix → Risk scoring engine: city indicators
- City historical matrix → Forecast engine: historical trends
- Dashboard orchestration → Risk scoring engine: computes current risk
- Dashboard orchestration → Forecast engine: generates projections
- Risk scoring engine → Capital allocation engine: scores and vulnerabilities
- Adaptation fund input → Capital allocation engine: budget pool
- Dashboard orchestration → Capital allocation engine: requests recommendations
- Risk scoring engine → Risk, forecast & allocation views: current risks and tiers
- Forecast engine → Risk, forecast & allocation views: 2040 projections
- Capital allocation engine → Risk, forecast & allocation views: recommended allocations
- Dashboard orchestration → Risk, forecast & allocation views: renders