A library for sizing multiple ground heat exchangers distributed around a single-pipe thermal network.
pip install ThermalNetwork
Available at https://nrel.github.io/ThermalNetwork/
This package has a command-line interface, intended to be used via URBANopt. To access the CLI directly, after installing call thermalnetwork --help
for all the commands.
- Clone the repository:
git clone https://github.com/NREL/ThermalNetwork.git
- Change directories into the repository:
cd ThermalNetwork
- We recommend using virtual environments on principle to avoid dependencies colliding between your Python projects. venv is the Python native solution that will work everywhere, though other options may be more user-friendly.
- Some popular alternatives are:
- pyenv and the virtualenv plugin work together nicely for Linux/Mac machines
- virtualenv
- miniconda
- rye
- Some popular alternatives are:
Once you have set up your environment:
- Update pip and setuptools:
pip install -U pip setuptools
- Install the repository with developer dependencies:
pip install -e .[dev]
- Activate pre-commit (only once, after making a new venv):
pre-commit install
- Runs automatically on your staged changes before every commit
- Includes linting and formatting via ruff
- To check the whole repo, run
pre-commit run --all-files
- Settings and documentation links for pre-commit and ruff are in .pre-commit-config.yaml and pyproject.toml
- Pre-commit will run automatically during CI, linting and formatting the entire repository.
Once you are set up as a developer, run pytest
from the root dir. Increase verbosity with -v
and -vv
.
Test coverage results will be saved to htmlcov/index.html.
Test files are in tests/
Test output will be written to tests/test_output/
Versioning is done by GitHub tag, thanks to SetupTools-SCM. Use semantic versioning when tagging. When a new release is made in GitHub, a workflow automatically publishes to PyPI.