Canonical thermodynamics interop domain models and simulator adapter protocol.
Project description
ol-simulator-interop-services
The canonical domain model and adapter contract layer for the Thermodynamics Agent Service architecture. Defines the types, protocols, and registries that every simulator backend (DWSIM, Rust thermo kernel, HYSYS, UniSim, ...) implements against. Licensed under AGPL-3.0-or-later.
This package is pure Python, backend-agnostic, and cross-platform. It's the port in a hexagonal (ports-and-adapters) architecture; simulator-specific implementations are the adapters.
Install
pip install ol-simulator-interop-services
Python 3.11+ only. The sole runtime dependency is pydantic>=2.0,<3.0.
Role in the architecture
This repository is the middle layer:
LLM agent / MCP client
|
v
+--[ ol_thermodynamics_agent_services ]--+
| MCP tools, routing, provenance |
+----------------------------------------+
|
v (in-process Python call)
+--[ ol_simulator_interop_services ]-----+ <-- this repo
| canonical domain model + protocol |
+----------------------------------------+
|
+----+----+----------+---------+
v v v v
[Rust] [DWSIM] [HYSYS] [UniSim]
kernel adapter adapter adapter
Backend-agnostic by design. No simulator's types leak above this boundary — a request arrives as a canonical FlashProblem, is dispatched to whichever adapter is registered, and returns a canonical FlashResult.
Responsibilities
- Canonical domain model — architectural type commitments that all layers depend on (table below).
SimulatorAdapterprotocol — the PythonProtocolevery simulator adapter must implement. Canonical methods:flash,get_properties,phase_envelope,list_property_packages,list_components,introspect_property_package.- Component registry — CAS-keyed canonical component identity with per-backend alias tables (
InMemoryComponentRegistry). - Parameter-source registry — tracking of each backend's parameter databank and its revision (
InMemoryParameterSourceRegistry). - Property-package registry — model + parameter-source + revision triples (
InMemoryPropertyPackageRegistry). - Error ontology — uniform exception types across all backends (
AdapterCapabilityError,ComponentNotFoundError, etc.).
Canonical domain model
| Type | Purpose |
|---|---|
CanonicalComponent |
Identity by CAS number + canonicalised molecular formula. |
CanonicalComponentRef |
Lightweight reference to a registered CanonicalComponent. |
Composition |
Ordered list of (CanonicalComponentRef, MoleFraction); normalisation invariant enforced at construction. |
PropertyPackageSpec |
Triple of (model_id, parameter_source_id, revision). |
PropertyPackageDescriptor |
Registered package: spec + display name + supported flash-calculation types. |
StreamCondition |
Sum type — TemperaturePressureCondition, PressureEnthalpyCondition, PressureEntropyCondition, etc. |
FlashProblem |
Immutable (Composition, StreamCondition, PropertyPackageSpec) value object. |
FlashResult |
Ordered list of Phase, convergence metadata, provenance. |
Phase |
Stable identity derived from composition + phase kind + density. |
PropertyBundle |
Collection of PropertyValues keyed by canonical property ID. |
Provenance |
(backend_id, property_package_spec, wall_time_seconds, ...) attached to every result. |
CanonicalComponent and PropertyPackageSpec follow the BIE identity pattern: canonical identity surfaces above, per-backend projections and parameter-source governance below.
Communication boundaries
| Boundary | Transport | Rationale |
|---|---|---|
| Agent service → this service | In-process Python call | Same process; no network boundary needed. |
| This service → adapters | Python protocol (in-process) | Adapters are Python classes loaded at startup. |
| Adapter → backend engine | Adapter-local (pythonnet, HTTP, PyO3, ...) | Each adapter chooses its own transport. |
Development
Setup
git clone https://github.com/OntoLedgy/ol_simulator_interop_services.git
cd ol_simulator_interop_services
uv sync
Tests + lint + types
uv run pytest # 22 tests
uv run ruff check .
uv run mypy
CI (see .github/workflows/ci.yml) runs all three on push/PR to main across Python 3.11 and 3.12.
Release
Releases publish to PyPI via OIDC trusted publishing — no token secrets in this repo. To cut a release:
- Bump
project.versioninpyproject.toml(committed). - Tag
vX.Y.Zmatching that version. - Push the tag. The
release.ymlworkflow builds sdist + wheel, publishes to PyPI, and creates a GitHub Release with both artifacts.
Related repositories
| Repository | Layer | Role |
|---|---|---|
ol_thermodynamics_agent_services |
Agent (top) | MCP tool schemas, backend routing, provenance |
ol_dwsim_interop_services |
Adapter | DWSIM SimulatorAdapter implementation |
ol_thermodynamics_kernel (planned) |
Adapter | Native Rust thermo kernel via PyO3 |
License
Dual-licensed:
- Open source — AGPL-3.0-or-later. See LICENSE for the full text and NOTICE for attribution.
- Commercial — a separate proprietary license is available from OntoLedgy Ltd. for embedding, proprietary
SimulatorAdapterimplementations, or other use cases that don't fit AGPL terms. See COMMERCIAL.md.
Copyright (c) 2018-2026 OntoLedgy Ltd.
Although this package is a library rather than a networked service, downstream services that consume it (e.g. ol-dwsim-mcp-server) are network-reachable, and AGPL §13 obligations propagate when those services are hosted. Using this package under the AGPL option means accepting the same AGPL terms across the dependency chain.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ol_simulator_interop_services-0.1.1.tar.gz.
File metadata
- Download URL: ol_simulator_interop_services-0.1.1.tar.gz
- Upload date:
- Size: 32.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cd1a4a88194f27232f816cb0db3d6b2646c5f60b7b0bd254f11367e946fc450
|
|
| MD5 |
3eedbbf1e4e69478c339730b15349ea1
|
|
| BLAKE2b-256 |
f59564541c20b5a49514483108b6ab45737ec9993a728229ae4c21dff959a2f1
|
Provenance
The following attestation bundles were made for ol_simulator_interop_services-0.1.1.tar.gz:
Publisher:
release.yml on OntoLedgy/ol_simulator_interop_services
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ol_simulator_interop_services-0.1.1.tar.gz -
Subject digest:
3cd1a4a88194f27232f816cb0db3d6b2646c5f60b7b0bd254f11367e946fc450 - Sigstore transparency entry: 1409419676
- Sigstore integration time:
-
Permalink:
OntoLedgy/ol_simulator_interop_services@ec42251557896c40e7b500649f7a0e24348a539c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/OntoLedgy
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ec42251557896c40e7b500649f7a0e24348a539c -
Trigger Event:
push
-
Statement type:
File details
Details for the file ol_simulator_interop_services-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ol_simulator_interop_services-0.1.1-py3-none-any.whl
- Upload date:
- Size: 40.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87ea8216818db2b7676f63c5dbcf64fe991a6b777035fdc5d95733884b6ce17e
|
|
| MD5 |
1a3f7faf37338989454586ee12e71744
|
|
| BLAKE2b-256 |
22f27ec14a6d2b742e26e1698107177749319cb78a823250abea149ebd3e911d
|
Provenance
The following attestation bundles were made for ol_simulator_interop_services-0.1.1-py3-none-any.whl:
Publisher:
release.yml on OntoLedgy/ol_simulator_interop_services
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ol_simulator_interop_services-0.1.1-py3-none-any.whl -
Subject digest:
87ea8216818db2b7676f63c5dbcf64fe991a6b777035fdc5d95733884b6ce17e - Sigstore transparency entry: 1409419679
- Sigstore integration time:
-
Permalink:
OntoLedgy/ol_simulator_interop_services@ec42251557896c40e7b500649f7a0e24348a539c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/OntoLedgy
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ec42251557896c40e7b500649f7a0e24348a539c -
Trigger Event:
push
-
Statement type: