Notebooks and Sample Cases
Purpose
Use packaged notebooks and sample cases when you want maintained, reproducible learning assets that exercise the public OpenPinch API.
Prerequisites
Install the notebook extra before running copied notebooks:
python -m pip install "openpinch[notebook]"
Sample Cases
OpenPinch currently ships:
Four-stream-Yee-and-Grossmann-1990-1.jsonbasic_pinch.jsonchocolate_factory.jsoncrude_preheat_train.jsoncrude_preheat_train_multiperiod.jsonheat_pump_targeting.jsonpulp_mill.jsonzonal_site.jsonzonal_site_multiperiod.json
Runnable Workflow
Discover sample cases from Python:
from OpenPinch.resources import (
copy_sample_case,
list_sample_cases,
read_sample_case,
sample_case_metadata,
)
print(list_sample_cases())
print(sample_case_metadata("basic_pinch.json").description)
print(read_sample_case("basic_pinch.json")[:120])
copy_sample_case("basic_pinch.json", "basic_pinch.json")
Load a packaged sample case directly when no local file with that name exists:
from OpenPinch import PinchProblem, PinchWorkspace
problem = PinchProblem("basic_pinch.json")
workspace = PinchWorkspace(source="crude_preheat_train.json")
Copy notebooks from Python:
from OpenPinch.resources import copy_notebook, list_notebooks, notebook_metadata
print(list_notebooks())
print(notebook_metadata("01_first_solve_summary_graphs.ipynb").description)
copy_notebook("01_first_solve_summary_graphs.ipynb", "notebooks")
Copy notebooks from the shell:
openpinch notebook -o notebooks
Expected Output
Packaged notebooks are copied as clean sources: no stored Plotly data, no cached execution counts, and no stale traceback output.
The current notebook series is:
01_first_solve_summary_graphs.ipynb02_total_site_sugcc_interpretation.ipynb03_multiperiod_workspace_scenarios.ipynb04_carnot_heat_pump_screening.ipynb05_direct_gas_stream_mvr_scenarios.ipynb06_vapour_compression_mvr_cascade_hpr.ipynb07_heat_exchanger_network_synthesis.ipynb08_energy_transfer_analysis.ipynb09_schema_service_exports_and_bundles.ipynb10_multiperiod_hpr_shared_design.ipynb
Interpretation
Use the series according to the work you are doing, not just by notebook number.
- I want to solve a case with advanced methods
Start with
01_first_solve_summary_graphs.ipynbfor the single-case solve, summary, graph, anddt_contsensitivity pattern. Move to03_multiperiod_workspace_scenarios.ipynbwhen operating periods matter. Use04_carnot_heat_pump_screening.ipynbfor direct/indirect heat-pump screening,05_direct_gas_stream_mvr_scenarios.ipynbfor process MVR case mutation, and07_heat_exchanger_network_synthesis.ipynbfor HEN synthesis and ranked network inspection. Use10_multiperiod_hpr_shared_design.ipynbwhen one HPR design must be optimised across several weighted periods.- I need to understand the method
Use
02_total_site_sugcc_interpretation.ipynbto connect local targets, Total Site targets, SUGCC profiles, and cogeneration screens. Use06_vapour_compression_mvr_cascade_hpr.ipynbto understand the VC+MVR cascade mechanics and08_energy_transfer_analysis.ipynbfor interval surplus/deficit accounting and energy-transfer diagrams.- I am integrating or extending OpenPinch
Use
09_schema_service_exports_and_bundles.ipynbfor typedTargetInputrequests,pinch_analysis_service(...), exports, workspace variant views, and bundle persistence. Pair it with API Reference when you need public contract details, and use07_heat_exchanger_network_synthesis.ipynbwhen extending synthesis workflows.
Next Steps
Notebook Series for notebook-by-notebook details.
Sample Cases for sample-case descriptions.
CLI and Resources for the exact resource helper API.