# gabenotgave/osdci-pipeline architecture

> Architecture diagram of the GitHub repository gabenotgave/osdci-pipeline, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gabenotgave/osdci-pipeline
- Repository: https://github.com/gabenotgave/osdci-pipeline

## Overview

OSDCI is a geospatial machine-learning pipeline that ranks CONUS H3 cells for data-center siting. Its workflow builds a grid, derives facility labels and geospatial features, assembles a master table, trains a LightGBM model, and applies impact penalties before exporting exploration artifacts. Feature scripts are independent producers rather than a serial chain; their exact runtime wiring is not shown here. The README documents the broad pipeline stages and datasets, while sampled source confirms key grid, label, assembly, proximity, training, and scoring responsibilities.

Main entry points: [`osdci/grid.py`](https://github.com/gabenotgave/osdci-pipeline/blob/main/osdci/grid.py) (H3 grid), [`scripts/assemble_features.py`](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/assemble_features.py) (Assemble master table), [`scripts/aggregate_labels.py`](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/aggregate_labels.py) (Aggregate labels), [`scripts/train_baseline.py`](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/train_baseline.py) (Train baseline model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grid_labels["Grid and labels"]
  node_grid_cli["Build grid<br/>[build_grid.py]"]
  node_h3_grid["H3 grid<br/>[grid.py]"]
  node_im3_ingest["Ingest facility labels<br/>[ingest_im3.py]"]
  node_label_aggregation["Aggregate labels"]
end

subgraph group_feature_builders["Feature builders"]
  node_power_features["Power and grid economics"]
  node_electricity_price["Electricity prices"]
  node_carbon_features["Grid carbon and renewables"]
  node_generation_features["Nearby generation"]
  node_network_features["IXP connectivity"]
  node_proximity_features["Metro and cloud proximity"]
  node_cloud_catalog["Cloud region catalog<br/>[cloud_regions.py]"]
  node_land_features["Land cover and terrain"]
  node_impervious_features["Impervious surface"]
  node_slope_features["Terrain slope"]
  node_protected_features["Protected areas"]
  node_wetland_features["Wetlands"]
  node_climate_features["Climate and cooling"]
  node_water_features["Water stress"]
  node_risk_features["Natural hazard risk"]
  node_population_features["Population exposure"]
  node_ej_features["Environmental justice"]
  node_tribal_features["Tribal land exclusion"]
  node_habitat_features["Critical habitat exclusion"]
end

subgraph group_modeling["Modeling and scoring"]
  node_feature_registry["Feature registry<br/>[features.py]"]
  node_assembler["Assemble master table"]
  node_trainer["Train baseline model<br/>[train_baseline.py]"]
  node_scorer["Penalize and export scores"]
end

subgraph group_external_inputs["External data"]
  node_im3_source["IM3 atlas"]
  node_eia_data["EIA data"]
  node_egrid_data["EPA eGRID"]
  node_ixp_data["PeeringDB"]
  node_public_geo_data["Public geospatial datasets"]
end

node_planner(("Siting planner"))
node_ranked_results["Ranked siting artifacts"]

node_planner -->|"initiates"| node_grid_cli
node_grid_cli -->|"calls"| node_h3_grid
node_im3_source -->|"provides atlas"| node_im3_ingest
node_im3_ingest -->|"writes labels"| node_label_aggregation
node_h3_grid -->|"indexes cells"| node_label_aggregation
node_h3_grid -->|"feature basis"| node_power_features
node_h3_grid -->|"feature basis"| node_electricity_price
node_h3_grid -->|"feature basis"| node_carbon_features
node_h3_grid -->|"feature basis"| node_generation_features
node_h3_grid -->|"feature basis"| node_network_features
node_h3_grid -->|"feature basis"| node_proximity_features
node_cloud_catalog -->|"provides regions"| node_proximity_features
node_h3_grid -->|"feature basis"| node_land_features
node_h3_grid -->|"feature basis"| node_impervious_features
node_h3_grid -->|"feature basis"| node_slope_features
node_h3_grid -->|"feature basis"| node_protected_features
node_h3_grid -->|"feature basis"| node_wetland_features
node_h3_grid -->|"feature basis"| node_climate_features
node_h3_grid -->|"feature basis"| node_water_features
node_h3_grid -->|"feature basis"| node_risk_features
node_h3_grid -->|"feature basis"| node_population_features
node_h3_grid -->|"feature basis"| node_ej_features
node_h3_grid -->|"feature basis"| node_tribal_features
node_h3_grid -->|"feature basis"| node_habitat_features
node_eia_data -->|"supplies data"| node_power_features
node_eia_data -->|"supplies data"| node_electricity_price
node_egrid_data -->|"supplies data"| node_carbon_features
node_ixp_data -->|"supplies data"| node_network_features
node_public_geo_data -->|"supplies data"| node_land_features
node_public_geo_data -->|"supplies data"| node_impervious_features
node_public_geo_data -->|"supplies data"| node_slope_features
node_public_geo_data -->|"supplies data"| node_protected_features
node_public_geo_data -->|"supplies data"| node_wetland_features
node_public_geo_data -->|"supplies data"| node_climate_features
node_public_geo_data -->|"supplies data"| node_water_features
node_public_geo_data -->|"supplies data"| node_risk_features
node_public_geo_data -->|"supplies data"| node_population_features
node_public_geo_data -->|"supplies data"| node_ej_features
node_public_geo_data -->|"supplies data"| node_tribal_features
node_public_geo_data -->|"supplies data"| node_habitat_features
node_h3_grid -->|"joins grid"| node_assembler
node_label_aggregation -->|"joins labels"| node_assembler
node_feature_registry -->|"defines columns"| node_assembler
node_assembler -->|"trains from table"| node_trainer
node_feature_registry -->|"selects features"| node_trainer
node_trainer -->|"produces viability scores"| node_scorer
node_scorer -->|"exports artifacts"| node_ranked_results
node_planner -->|"reviews"| node_ranked_results

click node_grid_cli "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/build_grid.py"
click node_h3_grid "https://github.com/gabenotgave/osdci-pipeline/blob/main/osdci/grid.py"
click node_im3_ingest "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/ingest_im3.py"
click node_label_aggregation "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/aggregate_labels.py"
click node_power_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_eia860_features.py"
click node_electricity_price "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_eia861_industrial_price.py"
click node_carbon_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_egrid_features.py"
click node_generation_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_nearby_generation.py"
click node_network_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_ixp_distance.py"
click node_proximity_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_proximity_features.py"
click node_cloud_catalog "https://github.com/gabenotgave/osdci-pipeline/blob/main/osdci/cloud_regions.py"
click node_land_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_nlcd_features.py"
click node_impervious_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_impervious_features.py"
click node_slope_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_slope_features.py"
click node_protected_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_padus_features.py"
click node_wetland_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_wetland_features.py"
click node_climate_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_climate_features.py"
click node_water_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_water_stress_features.py"
click node_risk_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_nri_features.py"
click node_population_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_population_features.py"
click node_ej_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_ejscreen_features.py"
click node_tribal_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_tribal_features.py"
click node_habitat_features "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_critical_habitat_features.py"
click node_feature_registry "https://github.com/gabenotgave/osdci-pipeline/blob/main/osdci/features.py"
click node_assembler "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/assemble_features.py"
click node_trainer "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/train_baseline.py"
click node_scorer "https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_final_scores.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_grid_cli,node_h3_grid,node_im3_ingest,node_label_aggregation toneBlue
class node_power_features,node_electricity_price,node_carbon_features,node_generation_features,node_network_features,node_proximity_features,node_cloud_catalog,node_land_features,node_impervious_features,node_slope_features,node_protected_features,node_wetland_features,node_climate_features,node_water_features,node_risk_features,node_population_features,node_ej_features,node_tribal_features,node_habitat_features toneAmber
class node_feature_registry,node_assembler,node_trainer,node_scorer toneMint
class node_im3_source,node_eia_data,node_egrid_data,node_ixp_data,node_public_geo_data toneRose
class node_planner,node_ranked_results toneIndigo
```

## Components

### Grid and labels

- [Build grid](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/build_grid.py): `scripts/build_grid.py`
- [H3 grid](https://github.com/gabenotgave/osdci-pipeline/blob/main/osdci/grid.py): `osdci/grid.py`
- [Ingest facility labels](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/ingest_im3.py): `scripts/ingest_im3.py`
- [Aggregate labels](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/aggregate_labels.py): `scripts/aggregate_labels.py`

### Feature builders

- [Power and grid economics](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_eia860_features.py): `scripts/compute_eia860_features.py`
- [Electricity prices](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_eia861_industrial_price.py): `scripts/compute_eia861_industrial_price.py`
- [Grid carbon and renewables](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_egrid_features.py): `scripts/compute_egrid_features.py`
- [Nearby generation](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_nearby_generation.py): `scripts/compute_nearby_generation.py`
- [IXP connectivity](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_ixp_distance.py): `scripts/compute_ixp_distance.py`
- [Metro and cloud proximity](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_proximity_features.py): `scripts/compute_proximity_features.py`
- [Cloud region catalog](https://github.com/gabenotgave/osdci-pipeline/blob/main/osdci/cloud_regions.py): `osdci/cloud_regions.py`
- [Land cover and terrain](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_nlcd_features.py): `scripts/compute_nlcd_features.py`
- [Impervious surface](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_impervious_features.py): `scripts/compute_impervious_features.py`
- [Terrain slope](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_slope_features.py): `scripts/compute_slope_features.py`
- [Protected areas](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_padus_features.py): `scripts/compute_padus_features.py`
- [Wetlands](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_wetland_features.py): `scripts/compute_wetland_features.py`
- [Climate and cooling](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_climate_features.py): `scripts/compute_climate_features.py`
- [Water stress](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_water_stress_features.py): `scripts/compute_water_stress_features.py`
- [Natural hazard risk](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_nri_features.py): `scripts/compute_nri_features.py`
- [Population exposure](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_population_features.py): `scripts/compute_population_features.py`
- [Environmental justice](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_ejscreen_features.py): `scripts/compute_ejscreen_features.py`
- [Tribal land exclusion](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_tribal_features.py): `scripts/compute_tribal_features.py`
- [Critical habitat exclusion](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_critical_habitat_features.py): `scripts/compute_critical_habitat_features.py`

### Modeling and scoring

- [Feature registry](https://github.com/gabenotgave/osdci-pipeline/blob/main/osdci/features.py): `osdci/features.py`
- [Assemble master table](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/assemble_features.py): `scripts/assemble_features.py`
- [Train baseline model](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/train_baseline.py): `scripts/train_baseline.py`
- [Penalize and export scores](https://github.com/gabenotgave/osdci-pipeline/blob/main/scripts/compute_final_scores.py): `scripts/compute_final_scores.py`

### External data

- **IM3 atlas**
- **EIA data**
- **EPA eGRID**
- **PeeringDB**
- **Public geospatial datasets**

### Other components

- **Siting planner**
- **Ranked siting artifacts**

## Connections

- Siting planner → Build grid: initiates (evidence: `README.md`)
- Build grid → H3 grid: calls (evidence: `scripts/build_grid.py`)
- IM3 atlas → Ingest facility labels: provides atlas (evidence: `README.md`)
- Ingest facility labels → Aggregate labels: writes labels (evidence: `README.md`)
- H3 grid → Aggregate labels: indexes cells (evidence: `README.md`)
- H3 grid → Power and grid economics: feature basis (evidence: `README.md`)
- H3 grid → Electricity prices: feature basis (evidence: `README.md`)
- H3 grid → Grid carbon and renewables: feature basis (evidence: `README.md`)
- H3 grid → Nearby generation: feature basis (evidence: `README.md`)
- H3 grid → IXP connectivity: feature basis (evidence: `README.md`)
- H3 grid → Metro and cloud proximity: feature basis (evidence: `README.md`)
- Cloud region catalog → Metro and cloud proximity: provides regions (evidence: `scripts/compute_proximity_features.py`)
- H3 grid → Land cover and terrain: feature basis (evidence: `README.md`)
- H3 grid → Impervious surface: feature basis (evidence: `README.md`)
- H3 grid → Terrain slope: feature basis (evidence: `README.md`)
- H3 grid → Protected areas: feature basis (evidence: `README.md`)
- H3 grid → Wetlands: feature basis (evidence: `README.md`)
- H3 grid → Climate and cooling: feature basis (evidence: `README.md`)
- H3 grid → Water stress: feature basis (evidence: `README.md`)
- H3 grid → Natural hazard risk: feature basis (evidence: `README.md`)
- H3 grid → Population exposure: feature basis (evidence: `README.md`)
- H3 grid → Environmental justice: feature basis (evidence: `README.md`)
- H3 grid → Tribal land exclusion: feature basis (evidence: `README.md`)
- H3 grid → Critical habitat exclusion: feature basis (evidence: `README.md`)
- EIA data → Power and grid economics: supplies data (evidence: `README.md`)
- EIA data → Electricity prices: supplies data (evidence: `README.md`)
- EPA eGRID → Grid carbon and renewables: supplies data (evidence: `README.md`)
- PeeringDB → IXP connectivity: supplies data (evidence: `README.md`)
- Public geospatial datasets → Land cover and terrain: supplies data (evidence: `README.md`)
- Public geospatial datasets → Impervious surface: supplies data (evidence: `README.md`)
- Public geospatial datasets → Terrain slope: supplies data (evidence: `README.md`)
- Public geospatial datasets → Protected areas: supplies data (evidence: `README.md`)
- Public geospatial datasets → Wetlands: supplies data (evidence: `README.md`)
- Public geospatial datasets → Climate and cooling: supplies data (evidence: `README.md`)
- Public geospatial datasets → Water stress: supplies data (evidence: `README.md`)
- Public geospatial datasets → Natural hazard risk: supplies data (evidence: `README.md`)
- Public geospatial datasets → Population exposure: supplies data (evidence: `README.md`)
- Public geospatial datasets → Environmental justice: supplies data (evidence: `README.md`)
- Public geospatial datasets → Tribal land exclusion: supplies data (evidence: `README.md`)
- Public geospatial datasets → Critical habitat exclusion: supplies data (evidence: `README.md`)
- H3 grid → Assemble master table: joins grid (evidence: `scripts/assemble_features.py`)
- Aggregate labels → Assemble master table: joins labels (evidence: `README.md`)
- Feature registry → Assemble master table: defines columns (evidence: `scripts/assemble_features.py`)
- Assemble master table → Train baseline model: trains from table (evidence: `README.md`)
- Feature registry → Train baseline model: selects features (evidence: `scripts/train_baseline.py`)
- Train baseline model → Penalize and export scores: produces viability scores (evidence: `README.md`)
- Penalize and export scores → Ranked siting artifacts: exports artifacts (evidence: `scripts/compute_final_scores.py`)
- Siting planner → Ranked siting artifacts: reviews (evidence: `README.md`)
