Notebooks and Sample Cases

The packaged notebooks and sample cases are part of the supported OpenPinch learning surface. They are the fastest way to move from a blank environment to an end-to-end workflow, but they are exposed through two different mechanisms:

  • the openpinch notebook CLI and copy_notebook(...) for notebooks

  • Python resource helpers and wrapper-object name resolution for sample cases

Install the notebook runtime first:

python -m pip install "openpinch[notebook]"

Packaged Sample Cases

OpenPinch currently ships with sample cases such as:

  • basic_pinch.json

  • heat_pump_targeting.json

  • zonal_site.json

  • pulp_mill.json

  • crude_preheat_train.json

  • chocolate_factory.json

Use the resource helpers when you want to inspect or copy them explicitly:

from OpenPinch.resources import (
    copy_sample_case,
    list_sample_cases,
    read_sample_case,
)

print(list_sample_cases())
print(read_sample_case("basic_pinch.json")[:120])
copy_sample_case("basic_pinch.json", "basic_pinch.json")

You can also load a packaged sample case directly through PinchProblem("basic_pinch.json") or PinchWorkspace(source="basic_pinch.json") when no local file with that name exists. That rule is intentional so local files always win.

Packaged Notebook Series

The current packaged notebooks load bundled sample cases directly with PinchWorkspace(source="sample_case.json", ...) and then work against real PinchProblem cases inside the workspace. They are packaged as clean sources: no stored Plotly payloads, no cached execution counts, and no stale traceback output. The examples also stay on the public selected-state workflow surface, for example problem.target.direct_heat_integration(state_id="0").

Copy the full series with:

openpinch notebook -o notebooks

Or copy one notebook:

openpinch notebook --name 02_total_site_targets_and_sugcc.ipynb -o notebooks

From Python you can also access the same notebook asset helpers directly:

from OpenPinch.resources import copy_notebook, list_notebooks

print(list_notebooks())
copy_notebook("01_basic_pinch_and_dtcont_sensitivity.ipynb", "notebooks")

Current packaged notebooks:

  1. 01_basic_pinch_and_dtcont_sensitivity.ipynb

  2. 02_total_site_targets_and_sugcc.ipynb

  3. 03_carnot_hpr_comparison.ipynb

Notebook 03 also shows the post-target HPR graph surfaces directly through problem.plot.net_load_profiles(zone_name="Direct Heat Pump") and problem.plot.grand_composite_curve_with_heat_pump(...).

Why These Assets Matter

These assets are useful because they:

  • exercise the supported public API directly

  • provide named examples that align with the docs

  • give users a realistic plant-style context instead of toy inputs

Next Steps