# sel-columbia/netplan architecture

> Architecture diagram of the GitHub repository sel-columbia/netplan, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sel-columbia/netplan
- Repository: https://github.com/sel-columbia/netplan

## Overview

Netplan is an end-to-end buildings-to-network planning repository, with a documented focus on running network planning. Its apparent user workflow is to load and prepare planning inputs, estimate demand and technology costs, plan network connections, and produce reports. The graph also shows the network-building runtime and its geospatial support. The README is sparse, and several source excerpts are incomplete, so some subsystem relationships are supported only by the SOURCE INDEX; uncertain runtime details are omitted.

Main entry points: [`netplan/plan.py`](https://github.com/sel-columbia/netplan/blob/main/netplan/plan.py) (Planning runner), [`netplan/networker/networker_runner.py`](https://github.com/sel-columbia/netplan/blob/main/netplan/networker/networker_runner.py) (Network runner), [`netplan/networker/classes/geograph.py`](https://github.com/sel-columbia/netplan/blob/main/netplan/networker/classes/geograph.py) (Geographic graph), [`netplan/networker/algorithms/mod_boruvka.py`](https://github.com/sel-columbia/netplan/blob/main/netplan/networker/algorithms/mod_boruvka.py) (Spanning forest)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Planning workflow"]
  node_plan["Planning runner<br/>[plan.py]"]
  node_inputs["Input parsing<br/>[parsers.py]"]
  node_preprocess["Input preprocessing<br/>[preprocessors.py]"]
  node_demography["Population growth<br/>[exponential.py]"]
  node_consumption["Consumption estimates<br/>[linear.py]"]
  node_demand["Electricity demand<br/>[demand.py]"]
  node_analysis["Electricity analysis<br/>[analysis.py]"]
  node_costs["Technology costs<br/>[grid.py]"]
  node_valuation["Financial valuation<br/>[valuation.py]"]
  node_reports["Planning reports<br/>[report.py]"]
end

subgraph group_network["Network planning"]
  node_electric_network["Electric network planner<br/>[network.py]"]
  node_runner["Network runner"]
  node_algorithms["Spanning forest<br/>[mod_boruvka.py]"]
  node_geograph["Geographic graph<br/>[geograph.py]"]
  node_kdtree["Spatial index<br/>[kdtree.py]"]
  node_unionfind["Component tracking<br/>[unionfind.py]"]
end

subgraph group_geo["Geospatial data"]
  node_network_io["Network file IO<br/>[__init__.py]"]
  node_geometry_io["Geometry file IO<br/>[__init__.py]"]
  node_geomath["Geographic math<br/>[geomath.py]"]
end

subgraph group_support["Shared calculations"]
  node_macros["Planning utilities<br/>[macros.py]"]
  node_calc["Calculation helpers<br/>[calculator.py]"]
  node_disk["File utilities<br/>[disk.py]"]
end

node_user(("Planner"))

node_user -->|"runs"| node_plan
node_plan -->|"loads inputs"| node_inputs
node_plan -->|"prepares data"| node_preprocess
node_plan -->|"estimates growth"| node_demography
node_plan -->|"estimates use"| node_consumption
node_plan -->|"computes demand"| node_demand
node_plan -->|"analyzes electricity"| node_analysis
node_plan -->|"estimates costs"| node_costs
node_plan -->|"plans connections"| node_electric_network
node_plan -->|"generates reports"| node_reports
node_inputs -->|"loads geotables"| node_geometry_io
node_costs -->|"discounts cash flows"| node_valuation
node_costs -->|"uses calculations"| node_calc
node_plan -->|"uses utilities"| node_macros
node_electric_network -->|"runs networker"| node_runner
node_runner -->|"loads and writes"| node_network_io
node_runner -->|"builds network"| node_geograph
node_runner -->|"selects algorithm"| node_algorithms
node_runner -->|"tracks components"| node_unionfind
node_algorithms -->|"operates on graph"| node_geograph
node_algorithms -->|"queries spatial index"| node_kdtree
node_algorithms -->|"merges components"| node_unionfind
node_geograph -->|"indexes coordinates"| node_kdtree
node_geograph -->|"uses geographic math"| node_geomath
node_network_io -->|"creates graph"| node_geograph
node_network_io -->|"uses projections"| node_geomath
node_network_io -->|"uses shapefile utilities"| node_geometry_io
node_macros -->|"loads geometry"| node_geometry_io
node_macros -->|"uses file utilities"| node_disk
node_reports -->|"creates report folders"| node_disk

click node_plan "https://github.com/sel-columbia/netplan/blob/main/netplan/plan.py"
click node_inputs "https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/parsers.py"
click node_preprocess "https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/preprocessors.py"
click node_demography "https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/demography/exponential.py"
click node_consumption "https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/electricity/consumption/linear.py"
click node_demand "https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/electricity/demand.py"
click node_analysis "https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/electricity/analysis.py"
click node_costs "https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/electricity/cost/grid.py"
click node_valuation "https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/finance/valuation.py"
click node_reports "https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/electricity/report.py"
click node_electric_network "https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/electricity/network.py"
click node_runner "https://github.com/sel-columbia/netplan/blob/main/netplan/networker/networker_runner.py"
click node_algorithms "https://github.com/sel-columbia/netplan/blob/main/netplan/networker/algorithms/mod_boruvka.py"
click node_geograph "https://github.com/sel-columbia/netplan/blob/main/netplan/networker/classes/geograph.py"
click node_kdtree "https://github.com/sel-columbia/netplan/blob/main/netplan/networker/classes/kdtree.py"
click node_unionfind "https://github.com/sel-columbia/netplan/blob/main/netplan/networker/classes/unionfind.py"
click node_network_io "https://github.com/sel-columbia/netplan/blob/main/netplan/networker/io/__init__.py"
click node_geometry_io "https://github.com/sel-columbia/netplan/blob/main/netplan/geometryIO/__init__.py"
click node_geomath "https://github.com/sel-columbia/netplan/blob/main/netplan/networker/geomath.py"
click node_macros "https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/macros.py"
click node_calc "https://github.com/sel-columbia/netplan/blob/main/netplan/invisibleroads_macros/calculator.py"
click node_disk "https://github.com/sel-columbia/netplan/blob/main/netplan/invisibleroads_macros/disk.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_plan,node_inputs,node_preprocess,node_demography,node_consumption,node_demand,node_analysis,node_costs,node_valuation,node_reports toneBlue
class node_electric_network,node_runner,node_algorithms,node_geograph,node_kdtree,node_unionfind toneAmber
class node_network_io,node_geometry_io,node_geomath toneMint
class node_macros,node_calc,node_disk toneRose
class node_user toneIndigo
```

## Components

### Planning workflow

- [Planning runner](https://github.com/sel-columbia/netplan/blob/main/netplan/plan.py): `netplan/plan.py`
- [Input parsing](https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/parsers.py): `netplan/infrastructure_planning/parsers.py`
- [Input preprocessing](https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/preprocessors.py): `netplan/infrastructure_planning/preprocessors.py`
- [Population growth](https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/demography/exponential.py): `netplan/infrastructure_planning/demography/exponential.py`
- [Consumption estimates](https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/electricity/consumption/linear.py): `netplan/infrastructure_planning/electricity/consumption/linear.py`
- [Electricity demand](https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/electricity/demand.py): `netplan/infrastructure_planning/electricity/demand.py`
- [Electricity analysis](https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/electricity/analysis.py): `netplan/infrastructure_planning/electricity/analysis.py`
- [Technology costs](https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/electricity/cost/grid.py): `netplan/infrastructure_planning/electricity/cost/grid.py`
- [Financial valuation](https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/finance/valuation.py): `netplan/infrastructure_planning/finance/valuation.py`
- [Planning reports](https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/electricity/report.py): `netplan/infrastructure_planning/electricity/report.py`

### Network planning

- [Electric network planner](https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/electricity/network.py): `netplan/infrastructure_planning/electricity/network.py`
- [Network runner](https://github.com/sel-columbia/netplan/blob/main/netplan/networker/networker_runner.py): `netplan/networker/networker_runner.py`
- [Spanning forest](https://github.com/sel-columbia/netplan/blob/main/netplan/networker/algorithms/mod_boruvka.py): `netplan/networker/algorithms/mod_boruvka.py`
- [Geographic graph](https://github.com/sel-columbia/netplan/blob/main/netplan/networker/classes/geograph.py): `netplan/networker/classes/geograph.py`
- [Spatial index](https://github.com/sel-columbia/netplan/blob/main/netplan/networker/classes/kdtree.py): `netplan/networker/classes/kdtree.py`
- [Component tracking](https://github.com/sel-columbia/netplan/blob/main/netplan/networker/classes/unionfind.py): `netplan/networker/classes/unionfind.py`

### Geospatial data

- [Network file IO](https://github.com/sel-columbia/netplan/blob/main/netplan/networker/io/__init__.py): `netplan/networker/io/__init__.py`
- [Geometry file IO](https://github.com/sel-columbia/netplan/blob/main/netplan/geometryIO/__init__.py): `netplan/geometryIO/__init__.py`
- [Geographic math](https://github.com/sel-columbia/netplan/blob/main/netplan/networker/geomath.py): `netplan/networker/geomath.py`

### Shared calculations

- [Planning utilities](https://github.com/sel-columbia/netplan/blob/main/netplan/infrastructure_planning/macros.py): `netplan/infrastructure_planning/macros.py`
- [Calculation helpers](https://github.com/sel-columbia/netplan/blob/main/netplan/invisibleroads_macros/calculator.py): `netplan/invisibleroads_macros/calculator.py`
- [File utilities](https://github.com/sel-columbia/netplan/blob/main/netplan/invisibleroads_macros/disk.py): `netplan/invisibleroads_macros/disk.py`

### Other components

- **Planner**

## Connections

- Planner → Planning runner: runs
- Planning runner → Input parsing: loads inputs (evidence: `netplan/plan.py`)
- Planning runner → Input preprocessing: prepares data (evidence: `netplan/plan.py`)
- Planning runner → Population growth: estimates growth (evidence: `netplan/plan.py`)
- Planning runner → Consumption estimates: estimates use (evidence: `netplan/plan.py`)
- Planning runner → Electricity demand: computes demand (evidence: `netplan/plan.py`)
- Planning runner → Electricity analysis: analyzes electricity (evidence: `netplan/plan.py`)
- Planning runner → Technology costs: estimates costs (evidence: `netplan/plan.py`)
- Planning runner → Electric network planner: plans connections (evidence: `netplan/plan.py`)
- Planning runner → Planning reports: generates reports (evidence: `netplan/plan.py`)
- Input parsing → Geometry file IO: loads geotables (evidence: `netplan/infrastructure_planning/parsers.py`)
- Technology costs → Financial valuation: discounts cash flows (evidence: `netplan/infrastructure_planning/electricity/cost/grid.py`)
- Technology costs → Calculation helpers: uses calculations (evidence: `netplan/infrastructure_planning/electricity/cost/grid.py`)
- Planning runner → Planning utilities: uses utilities (evidence: `netplan/plan.py`)
- Electric network planner → Network runner: runs networker (evidence: `netplan/infrastructure_planning/electricity/network.py`)
- Network runner → Network file IO: loads and writes (evidence: `netplan/networker/networker_runner.py`)
- Network runner → Geographic graph: builds network (evidence: `netplan/networker/networker_runner.py`)
- Network runner → Spanning forest: selects algorithm (evidence: `netplan/networker/networker_runner.py`)
- Network runner → Component tracking: tracks components (evidence: `netplan/networker/networker_runner.py`)
- Spanning forest → Geographic graph: operates on graph (evidence: `netplan/networker/algorithms/mod_boruvka.py`)
- Spanning forest → Spatial index: queries spatial index (evidence: `netplan/networker/algorithms/mod_boruvka.py`)
- Spanning forest → Component tracking: merges components (evidence: `netplan/networker/algorithms/mod_boruvka.py`)
- Geographic graph → Spatial index: indexes coordinates (evidence: `netplan/networker/classes/geograph.py`)
- Geographic graph → Geographic math: uses geographic math (evidence: `netplan/networker/classes/geograph.py`)
- Network file IO → Geographic graph: creates graph (evidence: `netplan/networker/io/__init__.py`)
- Network file IO → Geographic math: uses projections (evidence: `netplan/networker/io/__init__.py`)
- Network file IO → Geometry file IO: uses shapefile utilities (evidence: `netplan/networker/io/__init__.py`)
- Planning utilities → Geometry file IO: loads geometry (evidence: `netplan/infrastructure_planning/macros.py`)
- Planning utilities → File utilities: uses file utilities (evidence: `netplan/infrastructure_planning/macros.py`)
- Planning reports → File utilities: creates report folders (evidence: `netplan/infrastructure_planning/electricity/report.py`)
