Package Root

The OpenPinch package root is the primary import surface for notebooks, small scripts, and lightweight applications. It intentionally re-exports a small set of high-value entry points so most users do not need to navigate the full module tree.

Root Export Groups

The package root exports the stable front-door classes, schemas, enums, metadata helpers, and resource helpers most users need:

Group

Exports

Workflow objects

PinchProblem, PinchWorkspace, pinch_analysis_service

Input and output schemas

TargetInput, TargetOutput, StreamSchema, StreamSegmentSchema, TemperatureHeatPointSchema, TemperatureHeatProfileSchema, UtilitySchema, ZoneTreeSchema

Reports and validation

ProblemReport, ReportMetric, ValidationIssue, ValidationReport

Enums

GraphAvailability, GraphType, HPRcycle, StreamType, TargetType, ZoneType

Configuration and utilities

Configuration, config_options, get_piecewise_linearisation_for_streams

Packaged resources

NotebookMetadata, SampleCaseMetadata, list_notebooks, notebook_metadata, copy_notebook, list_sample_cases, sample_case_metadata, read_sample_case, copy_sample_case

Typical Pattern

from OpenPinch import PinchProblem, PinchWorkspace, pinch_analysis_service
from OpenPinch.lib.schemas.io import TargetInput

problem = PinchProblem("basic_pinch.json")
result = problem.target()

workspace = PinchWorkspace(
    source="crude_preheat_train.json",
    project_name="crude_preheat_train",
)
workspace.scenario("wide_dt", dt_cont_multiplier=0.5)
comparison = workspace.compare_cases("baseline", "wide_dt")

The package root is intentionally small. If your workflow starts depending on prepared zones, direct service orchestration, or lower-level targeting algorithms, move down into the pages under Service Layer and Domain Model.

It is also a Python-first surface. The package root does not hide the fact that real solves, comparisons, exports, and advanced targeting happen through Python objects even though the project also ships packaged learning notebooks.

Root Exports

OpenPinch public API.

High-Level Service Function

OpenPinch.main.pinch_analysis_service(data, project_name='Project')[source]

Validate input data, run targeting, and return TargetOutput.

Parameters:
  • data (Any) – Raw request data matching OpenPinch.lib.schemas.io.TargetInput. Dictionaries, Pydantic models, and dataclass-like objects are accepted.

  • project_name (str) – Optional label used in generated graphs and result files.

Returns:

Validated response data containing solved targets and graph data.

Return type:

TargetOutput

Package-Level Import Notes

The root package keeps a curated set of commonly used classes, schemas, enums, resource helpers, and report types. The broader OpenPinch.lib package is still importable for advanced schema and enum work, but it is not part of the root wildcard export surface.

Use Schemas and Config when you need the typed input/config layer, and Generated Appendix when you need exhaustive module-level details.