Extension package to farn, adding support to build OSP simulation cases using FMUs.
Project description
ospx
ospx is an extension package to farn, adding support to build OSP (co-)simulation cases using functional mockup units (FMUs).
ospx supports
- building of case-specific OSP (co-)simulation configuration files
- watching the progress of cosim, and saving final simulation results as a pandas dataframe.
Installation
pip install ospx
ospx requires the following (sub-)package:
- dictIO: foundation package, enabling ospx to handle configuration files in dictIO dict file format.
However, dictIO gets installed automatically with ospx.
Usage Example
ospx provides both an API for use inside Python as well as a CLI for shell execution of core functions.
Reading a caseDict file and building the case-specific OSP (co-)simulation configuration files:
from ospx import OspCaseBuilder
OspCaseBuilder.build('caseDict')
The above task can also be invoked from the command line, using the 'ospCaseBuilder' command line script installed with ospx:
ospCaseBuilder caseDict
For more examples and usage, please refer to ospx's documentation.
File Format
A caseDict is a file in dictIO dict file format used with farn.
For a documentation of the caseDict file format, see File Format in ospx's documentation on GitHub Pages.
For a detailed documentation of the dictIO dict file format used by farn, see dictIO's documentation on GitHub Pages.
Development Setup
1. Install uv
This project uses uv as package manager.
If you haven't already, install uv, preferably using it's "Standalone installer" method:
..on Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
..on MacOS and Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
(see docs.astral.sh/uv for all / alternative installation methods.)
Once installed, you can update uv to its latest version, anytime, by running:
uv self update
2. Install Python
This project requires Python 3.10 or later.
If you don't already have a compatible version installed on your machine, the probably most comfortable way to install Python is through uv:
uv python install
This will install the latest stable version of Python into the uv Python directory, i.e. as a uv-managed version of Python.
Alternatively, and if you want a standalone version of Python on your machine, you can install Python either via winget:
winget install --id Python.Python
or you can download and install Python from the python.org website.
3. Clone the repository
Clone the ospx repository into your local development directory:
git clone https://github.com/dnv-opensource/ospx path/to/your/dev/ospx
Change into the project directory after cloning:
cd ospx
4. Install dependencies
Run uv sync to create a virtual environment and install all project dependencies into it:
uv sync
Note: Using
--no-devwill omit installing development dependencies.
Note:
uvwill create a new virtual environment called.venvin the project root directory when runninguv syncthe first time. Optionally, you can create your own virtual environment using e.g.uv venv, before runninguv sync.
5. (Optional) Activate the virtual environment
When using uv, there is in almost all cases no longer a need to manually activate the virtual environment.
uv will find the .venv virtual environment in the working directory or any parent directory, and activate it on the fly whenever you run a command via uv inside your project folder structure:
uv run <command>
However, you still can manually activate the virtual environment if needed.
When developing in an IDE, for instance, this can in some cases be necessary depending on your IDE settings.
To manually activate the virtual environment, run one of the "known" legacy commands:
..on Windows:
.venv\Scripts\activate.bat
..on Linux:
source .venv/bin/activate
6. Install pre-commit hooks
The .pre-commit-config.yaml file in the project root directory contains a configuration for pre-commit hooks.
To install the pre-commit hooks defined therein in your local git repository, run:
uv run pre-commit install
All pre-commit hooks configured in .pre-commit-config.yaml will now run each time you commit changes.
pre-commit can also manually be invoked, at anytime, using:
uv run pre-commit run --all-files
To skip the pre-commit validation on commits (e.g. when intentionally committing broken code), run:
uv run git commit -m <MSG> --no-verify
To update the hooks configured in .pre-commit-config.yaml to their newest versions, run:
uv run pre-commit autoupdate
7. Test that the installation works
To test that the installation works, run pytest in the project root folder:
uv run pytest
Meta
Copyright (c) 2026 DNV SE. All rights reserved.
Frank Lumpitzsch - @LinkedIn - frank.lumpitzsch@dnv.com
Claas Rostock - @LinkedIn - claas.rostock@dnv.com
Seunghyeon Yoo - @LinkedIn - seunghyeon.yoo@dnv.com
Distributed under the MIT license. See LICENSE for more information.
https://github.com/dnv-opensource/ospx
Contributing
- Fork it (https://github.com/dnv-opensource/ospx/fork)
- Create an issue in your GitHub repo
- Create your branch based on the issue number and type (
git checkout -b issue-name) - Evaluate and stage the changes you want to commit (
git add -i) - Commit your changes (
git commit -am 'place a descriptive commit message here') - Push to the branch (
git push origin issue-name) - Create a new Pull Request in GitHub
For your contribution, please make sure you follow the STYLEGUIDE before creating the Pull Request.
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 ospx-0.3.4.tar.gz.
File metadata
- Download URL: ospx-0.3.4.tar.gz
- Upload date:
- Size: 14.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
260505aab4104e55749b17b57e929d33a988d398b64227a80a5863c135259552
|
|
| MD5 |
3f20cc8302c55d5a1fd81e163ae07139
|
|
| BLAKE2b-256 |
1c986890b71cc0fab6d056c61814104551a3c15bee2c36f96c9650d71f3e712d
|
Provenance
The following attestation bundles were made for ospx-0.3.4.tar.gz:
Publisher:
publish_release.yml on dnv-opensource/ospx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ospx-0.3.4.tar.gz -
Subject digest:
260505aab4104e55749b17b57e929d33a988d398b64227a80a5863c135259552 - Sigstore transparency entry: 1116112697
- Sigstore integration time:
-
Permalink:
dnv-opensource/ospx@dde09265d2fa97c052f506dd52aae12baee4ad0e -
Branch / Tag:
refs/tags/v0.3.4 - Owner: https://github.com/dnv-opensource
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_release.yml@dde09265d2fa97c052f506dd52aae12baee4ad0e -
Trigger Event:
push
-
Statement type:
File details
Details for the file ospx-0.3.4-py3-none-any.whl.
File metadata
- Download URL: ospx-0.3.4-py3-none-any.whl
- Upload date:
- Size: 51.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 |
eb946a9028b20d50a1d1914282de7b65be3d117e9ab414d7de86a315e1f9ac60
|
|
| MD5 |
8c19b4cff107caf3d721459896d76c6f
|
|
| BLAKE2b-256 |
bd6587fc271a8adf8f9fa3f37bfc24087e2a3736500dafd87fc032480f309ce5
|
Provenance
The following attestation bundles were made for ospx-0.3.4-py3-none-any.whl:
Publisher:
publish_release.yml on dnv-opensource/ospx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ospx-0.3.4-py3-none-any.whl -
Subject digest:
eb946a9028b20d50a1d1914282de7b65be3d117e9ab414d7de86a315e1f9ac60 - Sigstore transparency entry: 1116112745
- Sigstore integration time:
-
Permalink:
dnv-opensource/ospx@dde09265d2fa97c052f506dd52aae12baee4ad0e -
Branch / Tag:
refs/tags/v0.3.4 - Owner: https://github.com/dnv-opensource
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_release.yml@dde09265d2fa97c052f506dd52aae12baee4ad0e -
Trigger Event:
push
-
Statement type: