NGCI-DHN: District Heating Network Analysis
Tools for creating and analyzing district heating networks from building footprints and road networks. Provides a CLI.
Overview This project builds a district heating network by:
- Selecting buildings within a radius around a center point.
- Validating building attributes and deriving heights.
- Preparing a road network (from a file or OSM download).
- Creating a network graph (exported as image and/or GeoJSON) and sizing pipes.
Quickstart
- Create a virtual environment and install dependencies.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
- Install the package (to enable the
ngci-dhnCLI entrypoint).
pip install -e ".[dev]"
- Run the example workflow.
ngci-dhn create --config configs/dhn_creator_example.json --output outputs/dhn_creator_demo --plot
CLI Usage
- Main workflow:
ngci-dhn create --config configs/dhn_creator_example.json --output outputs/dhn_creator_demo
- Alternative (no editable install):
python -m dhn_creator create --config configs/dhn_creator_example.json
- Output directory and log level:
ngci-dhn create --config configs/dhn_creator_example.json --output outputs/run_01 --log-level DEBUG
Notes:
pip install -e .is only needed once per environment, and only if you want thengci-dhncommand.
Documentation
docs/CONFIG.md: configuration reference with fields and defaults.docs/OUTPUTS.md: output files and logs.configs/dhn_creator_example.json: working example configuration.
Configuration
The JSON config is organized into creator, city, and factory steps. city and factory are optional; if omitted they are skipped. The output directory is provided via CLI --output. See the example at configs/dhn_creator_example.json.
Legacy config keys (inputs, selection, roads_download, etc.) are no longer supported.
Key sections:
creator: inputs, selection, building validation, plants, and roads settings.city: EnergyPlus settings (optional).factory: pipe sizing settings (optional).
Dataset note:
- If you want Montreal buildings/roads data, you can download the dataset here:
https://ngci.encs.concordia.ca/ckan/dataset/dhn-building-and-road-data
- Once downloaded, point
creator.inputs.buildingsandcreator.inputs.roadsinconfigs/dhn_creator_example.jsonto the local files.
Python API See https://ngci.encs.concordia.ca/gitea/CERC/district_heating_network_api
Project Structure
src/ngci_dhn/: core package, CLI, workflow, and utilities.configs/: example configuration files.docs/: configuration and outputs documentation.scripts/: helper scripts for data prep and rendering.tests/: pytest suite and fixtures.
Testing Run the tests from the repo root:
pytest
Notes:
- If
creator.inputs.roadsis missing or not found, the workflow downloads roads from OpenStreetMap via OSMnx (when enabled). - Plot output is saved as
network-graph.pngwhen--plotis enabled.
Citation
If you use this software in your research, please cite it. A CITATION.cff file is included; you can also use the BibTeX entry below:
@software{rezaei_dhn_analysis,
author = {Rezaei, Abolfazl},
title = {District Heating Network Analysis},
year = {2026},
version = {0.0.0},
license = {LGPL-3.0-or-later},
url = {https://ngci.encs.concordia.ca/gitea/a_rezaei/district_heating_network_analysis}
}
License This project is licensed under the GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later). The LGPL incorporates the terms of the GNU GPL v3.0 by reference. See LICENSE for the LGPL text and LICENSE.GPL for the GPL text.
Copyright © 2025-2026 Next-Generation Cities Institute, Concordia University.
Release files for ngci-dhn 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ngci_dhn-0.1.0.tar.gz | 53.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ngci_dhn-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 118.6 kB
Release files / ngci_dhn-0.1.0.tar.gz
| Download URL | ngci_dhn-0.1.0.tar.gz |
|---|---|
| Size | 53.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b3569490ef96536b11562a6bc928bf0662b11de4fab0ae2780873c92a077eb4
|
|
BLAKE2b-256 checksum How to use checksums |
b16fbf9262f910e63bb12ef29ce8189f66aa60155aa6d9b51d350c7525d5fb56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Release files / ngci_dhn-0.1.0-py3-none-any.whl
| Download URL | ngci_dhn-0.1.0-py3-none-any.whl |
|---|---|
| Size | 65.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04babc2ffcc1c13a2592431686587654db331a834b6efb8fbd3669e45b299f0d
|
|
BLAKE2b-256 checksum How to use checksums |
5d790bb7428ce0dd5d23dea4a5209a72556bafba3764f5f176a2fcf87380b08f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|