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.
Recommended Imports
Use the package root when you want the supported front door:
OpenPinch.PinchProblemfor single-case file-backed or notebook-driven workflowsOpenPinch.PinchWorkspacefor named multi-case studies and notebook workflowsOpenPinch.pinch_analysis_service()for typed programmatic executionOpenPinch.get_piecewise_linearisation_for_streams()for nonlinear stream segmentation utilitiesresource helpers such as
list_sample_cases(),sample_case_metadata(),list_notebooks(), andcopy_notebook()report helpers such as
problem.validation_report(),problem.report(), andproblem.metrics()
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 |
|
Input and output schemas |
|
Reports and validation |
|
Enums |
|
Configuration and utilities |
|
Packaged resources |
|
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:
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.