Backend pipeline to compute school-level composite priority indices based on multi-layer climate, social, and accessibility indicators.
This repository contains the full modular implementation of the school prioritisation framework developed within the GIGA Mozambique pilot.
The system computes a composite PRIORITY_IDX (0–100) for each school by combining:
- Climate vulnerability layers
- Social vulnerability layers
- Accessibility and isolation layers
The weighting structure is hierarchical:
-
Top-level weights between:
- Climate
- Social
- Access
-
Internal subgroup weights within each category.
All scenario combinations are automatically generated using a structured preference system (High = 3, Medium = 2, Low = 1).
giga-school-priority/
│
├─ src/giga_priority/ # Core Python package
│ ├─ scaling.py
│ ├─ indices.py
│ ├─ scenarios.py
│ ├─ export.py
│ └─ utils.py
│
├─ scripts/
│ ├─ run_export_school_priority.py
│ └─ inspect_scenarios.py
│
├─ data/
│ ├─ raw/
│ ├─ processed/
│ └─ outputs/
│
├─ requirements.txt
├─ pyproject.toml
└─ README.md
git clone https://gitlab.com/giga-unicef/backend.git
cd backendpython -m venv .venv
.venv\Scripts\activatepip install -r requirements.txt
pip install -e .The pipeline expects a master CSV file:
data/processed/schools_master.csv
This file must contain:
school_id_gigaschool_nameeducation_levellatitudelongitudex_utmy_utmadmin2_id_moaielectricity_availabilityconnectivity
All base columns required by:
- Climate index builder
- Social index builder
- Access index builder
These should already be preprocessed and cleaned.
The script automatically filters:
connectivity == "No"
Only non-connected schools are processed.
python scripts/inspect_scenarios.pyExpected output:
N escenarios: 205
python scripts/run_export_school_priority.pyThis will:
- Load master dataset (~13,000 schools)
- Filter non-connected (~9,000)
- Generate 205 scenarios
- Compute indices for each
- Export results
Results are written to:
data/outputs/
Two folders are created:
school_priority_csv/
school_priority_geojson/
For each scenario, the following files are generated:
schools_priority_index-cliX_socY_accZ-....csv
schools_priority_index-cliX_socY_accZ-....geojson
Each file contains:
- All original school metadata
PRIORITY_IDX(integer 0–100)
GeoJSON is exported in:
EPSG:4326
The priority index is:
-
Built from:
- Climate index
- Social index
- Access index
-
Combined using scenario weights
-
Robustly normalized (quantile-based)
-
Scaled to integer range:
0 – 100
Each scenario defines:
- Top-level preference:
- High (3)
- Medium (2)
- Low (1)
Converted into normalized weights:
w_i = score_i / sum(scores)
Internal subgroup combinations are generated automatically.
Total scenarios (default configuration):
205
This repository is fully reproducible:
- No hardcoded paths
- Modular structure
- Explicit scenario generation
- Version-controlled code
Large datasets are excluded via .gitignore.
- Built for Python 3.10 / 3.11
- Uses geopandas for spatial export
- Designed to integrate later with:
- Greedy optimisation
- MIP refinement
- Tower placement modules
MIT — Copyright © 2025–2026 MOAI Analytics · GIGA UNICEF–ITU