Feel++ modelica to fmu converter package
Project description
Feel++ mo2fmu converter
Modelica to FMU converter based on dymola
Installation
uv venv
source .venv/bin/activate
uv pip install -r pyproject.toml --extra dev --extra test
uv pip install .
Usage in command line
$ mo2fmu --help
Usage: mo2fmu [OPTIONS] MO OUTDIR
Options:
--fmumodelname TEXT change the model name of the FMU (default: .mo
file stem)
--load TEXT load one or more Modelica packages.
--flags TEXT one or more Dymola flags for FMU translation.
--type [all|cs|me|csSolver] the FMI type: cs, me, all, or csSolver.
--version TEXT the FMI version.
--dymola PATH path to Dymola root.
--dymolapath PATH path to Dymola executable.
--dymolawhl PATH path to Dymola whl file, relative to Dymola
root.
-v, --verbose verbose mode.
-f, --force force FMU generation even if file exists.
--help Show this message and exit.----
Usage in Python
Here is an example of how to use the mo2fmu function in Python that would convert a Modelica file to an FMU:
from feelpp.mo2fmu import mo2fmu
mo2fmu(
mo_file="path/to/model.mo",
outdir="path/to/output/dir",
fmumodelname="MyFMUModel",
load=["Modelica", "SomePackage"],
flags=["-d=initialization"],
fmi_type="cs",
fmi_version="2.0",
dymola_root="/path/to/dymola/root",
dymola_executable="/path/to/dymola/executable",
dymola_whl="/path/to/dymola.whl",
verbose=True,
force=False
)
Continuous Integration
Our GitHub Actions workflow (.github/workflows/ci.yml) includes:
- build_wheel: Python wheel compilation and artifact upload.
- docs: Builds the Antora site, deploys to GitHub Pages on master.
- deliver: Docker image build & push to GHCR.
- release: On tags vX.Y.Z, publishes binaries, wheels, datasets, and creates a GitHub release.
Versioning & Release
Project version is centrally defined in:
- docs/antora.yml
- docs/package.json
Contributing
We welcome contributions! Please:
- Fork the repository and create a feature branch.
- Adhere to existing coding conventions; add python tests where appropriate.
- Update documentation (docs/) for any new features.
- Submit a pull request with a clear description of your changes.
License
This project is licensed under the MIT License. See LICENSE for full details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
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 feelpp_mo2fmu-0.5.1-py3-none-any.whl.
File metadata
- Download URL: feelpp_mo2fmu-0.5.1-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37828331ea8444358002dfd8fd42b8c20ef21f99e2b99dc6878a536308391f5b
|
|
| MD5 |
decf747fe2f89cf6f009975649bc64e5
|
|
| BLAKE2b-256 |
cc62e0264ce696fc1a255dc97620f098c4985af4af39a2ef9f58244e14a2410f
|
Provenance
The following attestation bundles were made for feelpp_mo2fmu-0.5.1-py3-none-any.whl:
Publisher:
ci.yml on feelpp/mo2fmu
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
feelpp_mo2fmu-0.5.1-py3-none-any.whl -
Subject digest:
37828331ea8444358002dfd8fd42b8c20ef21f99e2b99dc6878a536308391f5b - Sigstore transparency entry: 623412511
- Sigstore integration time:
-
Permalink:
feelpp/mo2fmu@9d4a0e138d4010e467443ef148c9ab9a1b29ab42 -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/feelpp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@9d4a0e138d4010e467443ef148c9ab9a1b29ab42 -
Trigger Event:
push
-
Statement type: