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.
Metadata
Release files for ol-simulator-interop-services 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ol_simulator_interop_services-0.1.1.tar.gz | 32.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ol_simulator_interop_services-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 72.6 kB
Release files / ol_simulator_interop_services-0.1.1.tar.gz
| Download URL | ol_simulator_interop_services-0.1.1.tar.gz |
|---|---|
| Size | 32.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3cd1a4a88194f27232f816cb0db3d6b2646c5f60b7b0bd254f11367e946fc450
|
|
BLAKE2b-256 checksum How to use checksums |
f59564541c20b5a49514483108b6ab45737ec9993a728229ae4c21dff959a2f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 30, 2026.
Transparency logRelease files / ol_simulator_interop_services-0.1.1-py3-none-any.whl
| Download URL | ol_simulator_interop_services-0.1.1-py3-none-any.whl |
|---|---|
| Size | 40.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87ea8216818db2b7676f63c5dbcf64fe991a6b777035fdc5d95733884b6ce17e
|
|
BLAKE2b-256 checksum How to use checksums |
22f27ec14a6d2b742e26e1698107177749319cb78a823250abea149ebd3e911d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 30, 2026.
Transparency log