Skip to main content

OpenPinch

CI Documentation Status PyPI version Python versions License: MIT

OpenPinch is an open-source Python toolkit for advanced Pinch Analysis and Total Site Integration. It supports direct and indirect heat integration targeting, graph interpretation, Heat Pump and refrigeration screening, exergy and cogeneration post-processing, heat exchanger network synthesis, multi-period analysis, stream piece-wise linearisation (for variable heat capacity and phase change streams), and file-backed or schema-first workflows.

Full documentation is available at https://openpinch.readthedocs.io/en/latest/.

Install

Install the base package for validation, targeting, summaries, and schema-first Python workflows:

python -m pip install openpinch

Install optional extras only for the workflows that need them:

python -m pip install "openpinch[notebook]"      # Jupyter, Plotly graphs, Excel I/O
python -m pip install "openpinch[dashboard]"     # Streamlit dashboard
python -m pip install "openpinch[synthesis]"     # HEN synthesis, then run: idaes get-extensions
python -m pip install "openpinch[brayton_cycle]" # TESPy-backed Brayton-cycle tooling
python -m pip install "openpinch[tespy]"          # TESPy HPR targeting and performance maps
python -m pip install "openpinch[full]"          # all optional surfaces, including synthesis

OpenPinch currently requires Python >=3.14.2.

Both synthesis and full install the IDAES/Pyomo synthesis stack. Complete the IDAES installation before running solver-backed workflows:

idaes get-extensions

First Solve

OpenPinch exposes two package-root workflow classes. Use PinchProblem for one case and PinchWorkspace for named cases and scenarios.

from OpenPinch import PinchProblem

problem = PinchProblem(
    {
        "streams": [
            {
                "name": "Hot feed",
                "zone": "Process",
                "t_supply": 180.0,
                "t_target": 80.0,
                "heat_flow": 1000.0,
            },
            {
                "name": "Cold feed",
                "zone": "Process",
                "t_supply": 20.0,
                "t_target": 120.0,
                "heat_flow": 800.0,
            },
        ],
        "utilities": [],
    },
    project_name="First solve",
)
problem.validate()
problem.target.all_heat_integration()

print(problem.summary_frame())

Analysis is explicit: named methods execute work, while summaries, reports, plots, and exports consume prepared or cached state.

Packaged Resources

OpenPinch ships maintained sample cases and notebook workflows. The resource helpers below are useful repository tooling, but are not compatibility protected:

from OpenPinch.resources import (
    list_notebooks,
    list_sample_cases,
    notebook_metadata,
    sample_case_metadata,
)

print(list_sample_cases())
print(sample_case_metadata("basic_pinch.json").description)
print(list_notebooks())
print(notebook_metadata("01_first_solve_and_core_curves.ipynb").title)

Copy the notebook series from the CLI:

openpinch notebook -o notebooks

Notebooks and sample cases live in OpenPinch/tutorials/notebooks and OpenPinch/tutorials/sample_cases, with discovery and copying available through OpenPinch.resources.

The nineteen-notebook series progresses from first solve through multiperiod HPR, cogeneration, HEN synthesis, and publication workflows.

The CLI intentionally copies notebooks only. Solves, validation, graph export, Excel export, dashboards, and advanced targeting happen through Python.

Documentation Map

Testing

Run the same checks as CI on your own machine with one command:

scripts/ci_local.sh          # lint, unit tests with 95% coverage, docs, build + wheel smoke test
scripts/ci_local.sh quick    # lint + unit tests, stop at the first failure
scripts/ci_local.sh all      # every lane, including TESPy, performance, solver and notebooks
scripts/ci_local.sh solver   # any lane by name: lint unit docs tespy performance solver notebooks build
scripts/ci_local.sh --linux notebooks  # run inside a Linux x86_64 container, like the CI runners (needs Docker)

CI runs on Linux x86_64. Numerical searches (for example the heat pump notebooks) can behave slightly differently on macOS arm64, so use --linux to reproduce a CI-only failure; on Apple silicon it runs under emulation and is slower.

It syncs the locked environment with uv first and prints a pass/fail summary per lane. The solver lane downloads the IDAES solver binaries on first use.

To have this run automatically before every git push, enable the repository's hooks once per clone (skip a run with git push --no-verify):

git config core.hooksPath .githooks

Before pushing work meant for main, also run scripts/ci_local.sh all, which adds the TESPy, performance, solver and notebook lanes that CI runs for pull requests into main.

Ubuntu runs the complete CI suite. Windows and macOS install the generated wheel and verify the core import, CLI, and packaged resources. Tests marked solver require external solver binaries; CI installs the IDAES extensions and runs them for pull requests into main and for every release.

Release Process

The first merge into develop after a release automatically bumps the patch version (bump-version.yml); bump minor or major yourself with uvx bump-my-version bump minor. Merge the develop → main pull request once CI OK (main) is green. Every push to main runs the full CI suite; when the version has no v<version> tag yet, release.yml publishes the wheel and sdist that CI built to PyPI through the protected pypi environment, then creates the tag and GitHub release. See Releasing for details and recovery.

Build the documentation locally:

uv run scripts/build_docs.py

History and Citation

OpenPinch started in 2011 as an Excel workbook with macros. The Python implementation began in 2021 to make the workflows scriptable and testable.

In publications and forks, please cite and link the foundational article and this repository:

Timothy Gordon Walmsley, 2026. OpenPinch: An Open-Source Python Library for Advanced Pinch Analysis and Total Site Integration. Process Integration and Optimization for Sustainability. https://doi.org/10.1007/s41660-026-00729-6

Contributors

Founder: Tim Walmsley, University of Waikato

Stephen Burroughs, Benjamin Lincoln, Alex Geary, Harrison Whiting, Khang Tran, Roger Padulles, Jasper Walden, Caleb Archer

License

OpenPinch is released under the MIT License. See LICENSE for details.

Metadata

Release files for OpenPinch 0.6.20

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

Source distribution (sdist)

Source distribution for OpenPinch 0.6.20
File Size Uploaded
openpinch-0.6.20.tar.gz 624.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for OpenPinch 0.6.20
File Interpreter ABI Platform
openpinch-0.6.20-py3-none-any.whl Python 3 none any Details

Total release size: 1.5 MB

Release files / openpinch-0.6.20.tar.gz

Download URL openpinch-0.6.20.tar.gz
Size 624.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d91a0fd34f2f943e341cd5c165b7f7ee4e70d1b1b7a4478a0d7d65cdbc46e904
BLAKE2b-256 checksum
How to use checksums
30b6965eaab1a1744179ed5507a4cff33db8dc37ffbddecc8f8eb9427390115c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / openpinch-0.6.20-py3-none-any.whl

Download URL openpinch-0.6.20-py3-none-any.whl
Size 842.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d161f8d741ff2b31cbf6f2697a606be6a8a36c02e6d5ea6a32b4ed3ebfee551
BLAKE2b-256 checksum
How to use checksums
d173dd3117bbf9c452c05094431a0023b0bb66be7391c3dc12b0d368c08b507d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.22

2 release files

0.6.21

2 release files

This release

0.6.20 This release

2 release files

0.6.16

2 release files

0.6.15

2 release files

0.6.14

2 release files

0.6.13

2 release files

0.6.12

2 release files

0.6.11

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.0

2 release files

0.5.4

2 release files

0.4.5

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.28

2 release files

0.1.27

2 release files

0.1.26

2 release files

0.1.24

2 release files

0.1.23

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.14

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.2

2 release files

0.0.1

2 release files

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