Skip to main content

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:

  1. Selecting buildings within a radius around a center point.
  2. Validating building attributes and deriving heights.
  3. Preparing a road network (from a file or OSM download).
  4. Creating a network graph (exported as image and/or GeoJSON) and sizing pipes.

Quickstart

  1. 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
  1. Install the package (to enable the ngci-dhn CLI entrypoint).
pip install -e ".[dev]"
  1. 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 the ngci-dhn command.

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.buildings and creator.inputs.roads in configs/dhn_creator_example.json to 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.roads is missing or not found, the workflow downloads roads from OpenStreetMap via OSMnx (when enabled).
  • Plot output is saved as network-graph.png when --plot is 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.

Metadata

Release files for ngci-dhn 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ngci-dhn 0.2.0
File Size Uploaded Provenance Actions
ngci_dhn-0.2.0.tar.gz 59.4 kB Without provenance Details for ngci_dhn-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ngci-dhn 0.2.0
File Interpreter ABI Platform Actions
ngci_dhn-0.2.0-py3-none-any.whl Python 3 none any Details for ngci_dhn-0.2.0-py3-none-any.whl

Total release size: 130.8 kB

Release files / ngci_dhn-0.2.0.tar.gz

Download URL ngci_dhn-0.2.0.tar.gz
Size 59.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bafaf9c4137496f70e646f58b3be41923afd2e041e7b1fb69c687feeba300b7d
BLAKE2b-256 checksum
How to use checksums
4710ed5af3b81e1bea5d19f7d681f50206502308ba331272902350867ade6d10
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.2.0-py3-none-any.whl

Download URL ngci_dhn-0.2.0-py3-none-any.whl
Size 71.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10a1541f3be4f36e41c18162d1cc01fc226ce17d7c20be76e860f0e20f9057a4
BLAKE2b-256 checksum
How to use checksums
9001a131ed4248b12b6cabddf685b7331bd3dba03a23d8c9f47d96ab21da6698
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Security for ngci-dhn 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page