Skip to main content

trano-simulate

Simulate Modelica models with OpenModelica, in a Docker container of the OpenModelica image or with the omc of your machine, and report their results.

It is the simulation backend of trano, and does not depend on it: a model is the name and the Modelica text of a package whose top model is building.

from pathlib import Path

from trano_simulate import ModelPackage, SimulationOptions, run_simulation

package = ModelPackage(name="Decay", source=Path("decay.mo").read_text())
result = run_simulation(Path("run"), package, options=SimulationOptions(end_time=3600), runtime="docker")
result.success, result.result_path, result.error_kind, result.error_message

runtime="docker" needs Docker; runtime="local" needs OpenModelica's omc on the PATH, with the Modelica libraries installed (trano-install-libraries).

A package that uses a Modelica library without holding it names the folder of that library: it is loaded before the package (mounted read-only in the container with runtime="docker").

import fastsmoothbuildings

package = ModelPackage(name="house", source=source, libraries=(fastsmoothbuildings.LIBRARY,))

A ModelSource (trano's Network) may give the same folders as its attribute libraries.

Reports

A report needs two files: the description of the model, which trano writes next to the model it generates (<name>.description.json: its spaces, constructions and systems, and the result variables to plot), and the result file of the simulation.

from trano_simulate.reporting import ModelDocumentation, to_docx, to_html_reporting

documentation = ModelDocumentation.from_files(Path("house.description.json"), Path("run/results/house.building_res.mat"))
Path("house.html").write_text(to_html_reporting(documentation))
to_docx(documentation, Path("house.docx"))

Development

uv sync
make linting
make tests      # unit tests
make simulate   # simulations in Docker

Metadata

Release files for trano-simulate 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trano-simulate 0.3.0
File Size Uploaded Provenance
trano_simulate-0.3.0.tar.gz 25.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for trano-simulate 0.3.0
File Interpreter ABI Platform
trano_simulate-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 53.5 kB

Release files / trano_simulate-0.3.0.tar.gz

Download URL trano_simulate-0.3.0.tar.gz
Size 25.0 kB
Tags Source
SHA-256 checksum
How to use checksums
296f153458aa96db12306f9c3b266f75a30bf3564e99c3a62355ba9ad54c055b
BLAKE2b-256 checksum
How to use checksums
c318afc90cf0806de1a8e88ab0d6e3321a346f28a30c084301df03ffbe1cd1da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / trano_simulate-0.3.0-py3-none-any.whl

Download URL trano_simulate-0.3.0-py3-none-any.whl
Size 28.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c52048dd5555a5ca5274fa3f2f55a781589e2e0ad0428c4e1f4b6bd55943e83
BLAKE2b-256 checksum
How to use checksums
26830ee96ac2b71d0eee5147214e7123d9a0a6c3a2b7c5f45ab7c9f0ff227db0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for trano-simulate 0.3.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page