# osemosys/osemosys_global architecture

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

- Interactive diagram: https://gitdiagram.com/osemosys/osemosys_global
- Repository: https://github.com/osemosys/osemosys_global

## Overview

OSeMOSYS Global generates configurable, geographically scoped energy-system model inputs, then provides result summaries, visualisation, a dashboard, and comparison against external datasets. The graph preserves the documented model-generation capabilities and the major runtime subsystems visible in the tree. Some workflow wiring and unsampled modules are not shown; those links are omitted rather than inferred as execution order.

Main entry points: [`workflow/scripts/osemosys_global/TS_data.py`](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/TS_data.py) (Model input data), [`workflow/scripts/osemosys_global/storage/main.py`](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/storage/main.py) (Storage), [`workflow/scripts/osemosys_global/emissions/main.py`](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/emissions/main.py) (Emissions), [`workflow/scripts/osemosys_global/demand/main.py`](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/demand/main.py) (Demand projection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data and scope"]
  node_source_data["Source datasets"]
  node_preprocessing["Data preprocessing<br/>[preprocess_data.py]"]
  node_geo["Geographic filtering"]
end

subgraph group_model["Model construction"]
  node_demand["Demand projection<br/>[main.py]"]
  node_power["Power plants<br/>[main.py]"]
  node_storage["Storage<br/>[main.py]"]
  node_storage_rules["Storage constraints"]
  node_transmission["Transmission<br/>[main.py]"]
  node_emissions["Emissions<br/>[main.py]"]
  node_emission_limits["Emission limits<br/>[emission_limit.py]"]
  node_reserves["Reserve margins<br/>[main.py]"]
  node_model_data["Model input data<br/>[TS_data.py]"]
end

subgraph group_results["Results and analysis"]
  node_results_data["Scenario results"]
  node_summaries["Result summaries"]
  node_visualisation["Visualisation<br/>[visualise.py]"]
  node_validation["Model validation<br/>[main.py]"]
end

subgraph group_ui["User interfaces"]
  node_dashboard["Results dashboard<br/>[app.py]"]
  node_dashboard_tabs["Dashboard views"]
end

node_user(("Model user"))
node_solver["OSeMOSYS solver"]
node_external_stats["External statistics"]

node_user -.->|"configures model"| node_demand
node_source_data -.->|"prepares data"| node_preprocessing
node_user -.->|"selects scope"| node_geo
node_demand -.->|"produces inputs"| node_model_data
node_power -.->|"produces inputs"| node_model_data
node_storage -->|"writes CSVs"| node_model_data
node_storage -->|"calls constraints"| node_storage_rules
node_transmission -->|"writes CSVs"| node_model_data
node_emissions -->|"calls limit logic"| node_emission_limits
node_emissions -.->|"produces inputs"| node_model_data
node_reserves -.->|"produces inputs"| node_model_data
node_model_data -.->|"models system"| node_solver
node_solver -.->|"returns results"| node_results_data
node_results_data -.->|"summarises"| node_summaries
node_summaries -->|"uses utilities"| node_visualisation
node_user -.->|"explores results"| node_dashboard
node_dashboard -->|"renders tabs"| node_dashboard_tabs
node_external_stats -.->|"supplies comparisons"| node_validation
node_results_data -.->|"compares outputs"| node_validation

click node_preprocessing "https://github.com/osemosys/osemosys_global/blob/master/resources/preprocess_data.py"
click node_geo "https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/geographic_filter.py"
click node_demand "https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/demand/main.py"
click node_power "https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/powerplant/main.py"
click node_storage "https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/storage/main.py"
click node_storage_rules "https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/storage/investment_constraints.py"
click node_transmission "https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/transmission/main.py"
click node_emissions "https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/emissions/main.py"
click node_emission_limits "https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/emissions/emission_limit.py"
click node_reserves "https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/reserves/main.py"
click node_model_data "https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/TS_data.py"
click node_summaries "https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/summary/summarise_results.py"
click node_visualisation "https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/visualisation/visualise.py"
click node_validation "https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/validation/main.py"
click node_dashboard "https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/dashboard/app.py"
click node_dashboard_tabs "https://github.com/osemosys/osemosys_global/tree/master/workflow/scripts/osemosys_global/dashboard/components"

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_source_data,node_preprocessing,node_geo,node_user toneBlue
class node_demand,node_power,node_storage,node_storage_rules,node_transmission,node_emissions,node_emission_limits,node_reserves,node_model_data toneAmber
class node_results_data,node_summaries,node_visualisation,node_validation toneMint
class node_dashboard,node_dashboard_tabs toneRose
class node_solver,node_external_stats toneIndigo
```

## Components

### Data and scope

- **Source datasets**
- [Data preprocessing](https://github.com/osemosys/osemosys_global/blob/master/resources/preprocess_data.py): `resources/preprocess_data.py`
- [Geographic filtering](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/geographic_filter.py): `workflow/scripts/osemosys_global/geographic_filter.py`

### Model construction

- [Demand projection](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/demand/main.py): `workflow/scripts/osemosys_global/demand/main.py`
- [Power plants](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/powerplant/main.py): `workflow/scripts/osemosys_global/powerplant/main.py`
- [Storage](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/storage/main.py): `workflow/scripts/osemosys_global/storage/main.py`
- [Storage constraints](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/storage/investment_constraints.py): `workflow/scripts/osemosys_global/storage/investment_constraints.py`
- [Transmission](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/transmission/main.py): `workflow/scripts/osemosys_global/transmission/main.py`
- [Emissions](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/emissions/main.py): `workflow/scripts/osemosys_global/emissions/main.py`
- [Emission limits](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/emissions/emission_limit.py): `workflow/scripts/osemosys_global/emissions/emission_limit.py`
- [Reserve margins](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/reserves/main.py): `workflow/scripts/osemosys_global/reserves/main.py`
- [Model input data](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/TS_data.py): `workflow/scripts/osemosys_global/TS_data.py`

### Results and analysis

- **Scenario results**
- [Result summaries](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/summary/summarise_results.py): `workflow/scripts/osemosys_global/summary/summarise_results.py`
- [Visualisation](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/visualisation/visualise.py): `workflow/scripts/osemosys_global/visualisation/visualise.py`
- [Model validation](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/validation/main.py): `workflow/scripts/osemosys_global/validation/main.py`

### User interfaces

- [Results dashboard](https://github.com/osemosys/osemosys_global/blob/master/workflow/scripts/osemosys_global/dashboard/app.py): `workflow/scripts/osemosys_global/dashboard/app.py`
- [Dashboard views](https://github.com/osemosys/osemosys_global/tree/master/workflow/scripts/osemosys_global/dashboard/components): `workflow/scripts/osemosys_global/dashboard/components`

### Other components

- **Model user**
- **OSeMOSYS solver**
- **External statistics**

## Connections

- Model user → Demand projection: configures model
- Source datasets → Data preprocessing: prepares data
- Model user → Geographic filtering: selects scope
- Demand projection → Model input data: produces inputs
- Power plants → Model input data: produces inputs
- Storage → Model input data: writes CSVs (evidence: `workflow/scripts/osemosys_global/storage/main.py`)
- Storage → Storage constraints: calls constraints (evidence: `workflow/scripts/osemosys_global/storage/main.py`)
- Transmission → Model input data: writes CSVs (evidence: `workflow/scripts/osemosys_global/transmission/main.py`)
- Emissions → Emission limits: calls limit logic (evidence: `workflow/scripts/osemosys_global/emissions/main.py`)
- Emissions → Model input data: produces inputs
- Reserve margins → Model input data: produces inputs
- Model input data → OSeMOSYS solver: models system
- OSeMOSYS solver → Scenario results: returns results
- Scenario results → Result summaries: summarises
- Result summaries → Visualisation: uses utilities (evidence: `workflow/scripts/osemosys_global/summary/summarise_results.py`)
- Model user → Results dashboard: explores results (evidence: `workflow/scripts/osemosys_global/dashboard/app.py`)
- Results dashboard → Dashboard views: renders tabs (evidence: `workflow/scripts/osemosys_global/dashboard/app.py`)
- External statistics → Model validation: supplies comparisons (evidence: `workflow/scripts/osemosys_global/validation/main.py`)
- Scenario results → Model validation: compares outputs (evidence: `workflow/scripts/osemosys_global/validation/main.py`)
