ospx


Nameospx JSON
Version 0.3.1 PyPI version JSON
download
home_pageNone
SummaryExtension package to farn, adding support to build OSP simulation cases using FMUs.
upload_time2025-01-18 15:49:32
maintainerNone
docs_urlNone
authorNone
requires_python<3.14,>=3.10
licenseMIT License Copyright (c) 2024 [DNV](https://www.dnv.com) [open source](https://github.com/dnv-opensource) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords osp farn fmi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            [![pypi](https://img.shields.io/pypi/v/ospx.svg?color=blue)](https://pypi.python.org/pypi/ospx)
[![versions](https://img.shields.io/pypi/pyversions/ospx.svg?color=blue)](https://pypi.python.org/pypi/ospx)
[![license](https://img.shields.io/pypi/l/ospx.svg)](https://github.com/dnv-opensource/ospx/blob/main/LICENSE)
![ci](https://img.shields.io/github/actions/workflow/status/dnv-opensource/ospx/.github%2Fworkflows%2Fnightly_build.yml?label=ci)
[![docs](https://img.shields.io/github/actions/workflow/status/dnv-opensource/ospx/.github%2Fworkflows%2Fpush_to_release.yml?label=docs)][ospx_docs]

# ospx
ospx is an extension package to [farn][farn_docs], adding support to build [OSP][osp_docs] (co-)simulation cases using functional mockup units (FMUs).

ospx supports
* building of case-specific [OSP][osp_docs] (co-)simulation configuration files
* watching the progress of cosim, and saving final simulation results as a pandas dataframe.

## Installation

```sh
pip install ospx
```
ospx requires the following (sub-)package:
* [dictIO][dictIO_docs]: 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:
```py
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:
```sh
ospCaseBuilder caseDict
```

_For more examples and usage, please refer to [ospx's documentation][ospx_docs]._

## 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](fileFormat.rst) in [ospx's documentation][ospx_docs] on GitHub Pages._

_For a detailed documentation of the dictIO dict file format used by farn, see [dictIO's documentation][dictIO_docs] on GitHub Pages._

## Development Setup

### 1. Install uv
This project uses `uv` as package manager.
If you haven't already, install [uv](https://docs.astral.sh/uv), preferably using it's ["Standalone installer"](https://docs.astral.sh/uv/getting-started/installation/#__tabbed_1_2) method: <br>
..on Windows:
```sh
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```
..on MacOS and Linux:
```sh
curl -LsSf https://astral.sh/uv/install.sh | sh
```
(see [docs.astral.sh/uv](https://docs.astral.sh/uv/getting-started/installation/) for all / alternative installation methods.)

Once installed, you can update `uv` to its latest version, anytime, by running:
```sh
uv self update
```

### 2. Install Python
This project requires Python 3.10 or later. <br>
If you don't already have a compatible version installed on your machine, the probably most comfortable way to install Python is through `uv`:
```sh
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`:
```sh
winget install --id Python.Python
```
or you can download and install Python from the [python.org](https://www.python.org/downloads/) website.

### 3. Clone the repository
Clone the ospx repository into your local development directory:
```sh
git clone https://github.com/dnv-opensource/ospx path/to/your/dev/ospx
```
Change into the project directory after cloning:
```sh
cd ospx
```

### 4. Install dependencies
Run `uv sync` to create a virtual environment and install all project dependencies into it:
```sh
uv sync
```
> **Note**: Using `--no-dev` will omit installing development dependencies.

> **Note**: `uv` will create a new virtual environment called `.venv` in the project root directory when running
> `uv sync` the first time. Optionally, you can create your own virtual environment using e.g. `uv venv`, before running
> `uv 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. <br>
`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:
```sh
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: <br>
..on Windows:
```sh
.venv\Scripts\activate.bat
```
..on Linux:
```sh
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:
```sh
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:
```sh
uv run pre-commit run --all-files
```

To skip the pre-commit validation on commits (e.g. when intentionally committing broken code), run:
```sh
uv run git commit -m <MSG> --no-verify
```

To update the hooks configured in `.pre-commit-config.yaml` to their newest versions, run:
```sh
uv run pre-commit autoupdate
```

### 7. Test that the installation works
To test that the installation works, run pytest in the project root folder:
```sh
uv run pytest
```

## Meta

Copyright (c) 2024 [DNV](https://www.dnv.com) SE. All rights reserved.

Frank Lumpitzsch - [@LinkedIn](https://www.linkedin.com/in/frank-lumpitzsch-23013196/) - frank.lumpitzsch@dnv.com

Claas Rostock - [@LinkedIn](https://www.linkedin.com/in/claasrostock/?locale=en_US) - claas.rostock@dnv.com

Seunghyeon Yoo - [@LinkedIn](https://www.linkedin.com/in/seunghyeon-yoo-3625173b/) - seunghyeon.yoo@dnv.com

Distributed under the MIT license. See [LICENSE](LICENSE.md) for more information.

[https://github.com/dnv-opensource/ospx](https://github.com/dnv-opensource/ospx)

## Contributing

1. Fork it (<https://github.com/dnv-opensource/ospx/fork>)
2. Create an issue in your GitHub repo
3. Create your branch based on the issue number and type (`git checkout -b issue-name`)
4. Evaluate and stage the changes you want to commit (`git add -i`)
5. Commit your changes (`git commit -am 'place a descriptive commit message here'`)
6. Push to the branch (`git push origin issue-name`)
7. Create a new Pull Request in GitHub

For your contribution, please make sure you follow the [STYLEGUIDE](STYLEGUIDE.md) before creating the Pull Request.

<!-- Markdown link & img dfn's -->
[dictIO_docs]: https://dnv-opensource.github.io/dictIO/README.html
[ospx_docs]: https://dnv-opensource.github.io/ospx/README.html
[farn_docs]: https://dnv-opensource.github.io/farn/README.html
[osp_docs]: https://open-simulation-platform.github.io/

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ospx",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.14,>=3.10",
    "maintainer_email": "Claas Rostock <claas.rostock@dnv.com>",
    "keywords": "OSP, farn, fmi",
    "author": null,
    "author_email": "Frank Lumpitzsch <frank.lumpitzsch@dnv.com>, Claas Rostock <claas.rostock@dnv.com>, Seunghyeon Yoo <seunghyeon.yoo@dnv.com>",
    "download_url": "https://files.pythonhosted.org/packages/bb/7a/3e35c5b99cc3d67e03e5a532bc01ed43478d596b88349c212c5abfdf2550/ospx-0.3.1.tar.gz",
    "platform": null,
    "description": "[![pypi](https://img.shields.io/pypi/v/ospx.svg?color=blue)](https://pypi.python.org/pypi/ospx)\n[![versions](https://img.shields.io/pypi/pyversions/ospx.svg?color=blue)](https://pypi.python.org/pypi/ospx)\n[![license](https://img.shields.io/pypi/l/ospx.svg)](https://github.com/dnv-opensource/ospx/blob/main/LICENSE)\n![ci](https://img.shields.io/github/actions/workflow/status/dnv-opensource/ospx/.github%2Fworkflows%2Fnightly_build.yml?label=ci)\n[![docs](https://img.shields.io/github/actions/workflow/status/dnv-opensource/ospx/.github%2Fworkflows%2Fpush_to_release.yml?label=docs)][ospx_docs]\n\n# ospx\nospx is an extension package to [farn][farn_docs], adding support to build [OSP][osp_docs] (co-)simulation cases using functional mockup units (FMUs).\n\nospx supports\n* building of case-specific [OSP][osp_docs] (co-)simulation configuration files\n* watching the progress of cosim, and saving final simulation results as a pandas dataframe.\n\n## Installation\n\n```sh\npip install ospx\n```\nospx requires the following (sub-)package:\n* [dictIO][dictIO_docs]: foundation package, enabling ospx to handle configuration files in dictIO dict file format.\n\nHowever, dictIO gets installed automatically with ospx.\n\n## Usage Example\n\nospx provides both an API for use inside Python as well as a CLI for shell execution of core functions.\n\nReading a caseDict file and building the case-specific OSP (co-)simulation configuration files:\n```py\nfrom ospx import OspCaseBuilder\n\nOspCaseBuilder.build('caseDict')\n```\n\nThe above task can also be invoked from the command line, using the 'ospCaseBuilder' command line script installed with ospx:\n```sh\nospCaseBuilder caseDict\n```\n\n_For more examples and usage, please refer to [ospx's documentation][ospx_docs]._\n\n## File Format\nA caseDict is a file in dictIO dict file format used with farn.\n\n_For a documentation of the caseDict file format, see [File Format](fileFormat.rst) in [ospx's documentation][ospx_docs] on GitHub Pages._\n\n_For a detailed documentation of the dictIO dict file format used by farn, see [dictIO's documentation][dictIO_docs] on GitHub Pages._\n\n## Development Setup\n\n### 1. Install uv\nThis project uses `uv` as package manager.\nIf you haven't already, install [uv](https://docs.astral.sh/uv), preferably using it's [\"Standalone installer\"](https://docs.astral.sh/uv/getting-started/installation/#__tabbed_1_2) method: <br>\n..on Windows:\n```sh\npowershell -ExecutionPolicy ByPass -c \"irm https://astral.sh/uv/install.ps1 | iex\"\n```\n..on MacOS and Linux:\n```sh\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n```\n(see [docs.astral.sh/uv](https://docs.astral.sh/uv/getting-started/installation/) for all / alternative installation methods.)\n\nOnce installed, you can update `uv` to its latest version, anytime, by running:\n```sh\nuv self update\n```\n\n### 2. Install Python\nThis project requires Python 3.10 or later. <br>\nIf you don't already have a compatible version installed on your machine, the probably most comfortable way to install Python is through `uv`:\n```sh\nuv python install\n```\nThis will install the latest stable version of Python into the uv Python directory, i.e. as a uv-managed version of Python.\n\nAlternatively, and if you want a standalone version of Python on your machine, you can install Python either via `winget`:\n```sh\nwinget install --id Python.Python\n```\nor you can download and install Python from the [python.org](https://www.python.org/downloads/) website.\n\n### 3. Clone the repository\nClone the ospx repository into your local development directory:\n```sh\ngit clone https://github.com/dnv-opensource/ospx path/to/your/dev/ospx\n```\nChange into the project directory after cloning:\n```sh\ncd ospx\n```\n\n### 4. Install dependencies\nRun `uv sync` to create a virtual environment and install all project dependencies into it:\n```sh\nuv sync\n```\n> **Note**: Using `--no-dev` will omit installing development dependencies.\n\n> **Note**: `uv` will create a new virtual environment called `.venv` in the project root directory when running\n> `uv sync` the first time. Optionally, you can create your own virtual environment using e.g. `uv venv`, before running\n> `uv sync`.\n\n### 5. (Optional) Activate the virtual environment\nWhen using `uv`, there is in almost all cases no longer a need to manually activate the virtual environment. <br>\n`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:\n```sh\nuv run <command>\n```\n\nHowever, you still _can_ manually activate the virtual environment if needed.\nWhen developing in an IDE, for instance, this can in some cases be necessary depending on your IDE settings.\nTo manually activate the virtual environment, run one of the \"known\" legacy commands: <br>\n..on Windows:\n```sh\n.venv\\Scripts\\activate.bat\n```\n..on Linux:\n```sh\nsource .venv/bin/activate\n```\n\n### 6. Install pre-commit hooks\nThe `.pre-commit-config.yaml` file in the project root directory contains a configuration for pre-commit hooks.\nTo install the pre-commit hooks defined therein in your local git repository, run:\n```sh\nuv run pre-commit install\n```\n\nAll pre-commit hooks configured in `.pre-commit-config.yaml` will now run each time you commit changes.\n\npre-commit can also manually be invoked, at anytime, using:\n```sh\nuv run pre-commit run --all-files\n```\n\nTo skip the pre-commit validation on commits (e.g. when intentionally committing broken code), run:\n```sh\nuv run git commit -m <MSG> --no-verify\n```\n\nTo update the hooks configured in `.pre-commit-config.yaml` to their newest versions, run:\n```sh\nuv run pre-commit autoupdate\n```\n\n### 7. Test that the installation works\nTo test that the installation works, run pytest in the project root folder:\n```sh\nuv run pytest\n```\n\n## Meta\n\nCopyright (c) 2024 [DNV](https://www.dnv.com) SE. All rights reserved.\n\nFrank Lumpitzsch - [@LinkedIn](https://www.linkedin.com/in/frank-lumpitzsch-23013196/) - frank.lumpitzsch@dnv.com\n\nClaas Rostock - [@LinkedIn](https://www.linkedin.com/in/claasrostock/?locale=en_US) - claas.rostock@dnv.com\n\nSeunghyeon Yoo - [@LinkedIn](https://www.linkedin.com/in/seunghyeon-yoo-3625173b/) - seunghyeon.yoo@dnv.com\n\nDistributed under the MIT license. See [LICENSE](LICENSE.md) for more information.\n\n[https://github.com/dnv-opensource/ospx](https://github.com/dnv-opensource/ospx)\n\n## Contributing\n\n1. Fork it (<https://github.com/dnv-opensource/ospx/fork>)\n2. Create an issue in your GitHub repo\n3. Create your branch based on the issue number and type (`git checkout -b issue-name`)\n4. Evaluate and stage the changes you want to commit (`git add -i`)\n5. Commit your changes (`git commit -am 'place a descriptive commit message here'`)\n6. Push to the branch (`git push origin issue-name`)\n7. Create a new Pull Request in GitHub\n\nFor your contribution, please make sure you follow the [STYLEGUIDE](STYLEGUIDE.md) before creating the Pull Request.\n\n<!-- Markdown link & img dfn's -->\n[dictIO_docs]: https://dnv-opensource.github.io/dictIO/README.html\n[ospx_docs]: https://dnv-opensource.github.io/ospx/README.html\n[farn_docs]: https://dnv-opensource.github.io/farn/README.html\n[osp_docs]: https://open-simulation-platform.github.io/\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 [DNV](https://www.dnv.com) [open source](https://github.com/dnv-opensource)  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Extension package to farn, adding support to build OSP simulation cases using FMUs.",
    "version": "0.3.1",
    "project_urls": {
        "Changelog": "https://github.com/dnv-opensource/ospx/blob/main/CHANGELOG.md",
        "Documentation": "https://dnv-opensource.github.io/ospx/README.html",
        "Homepage": "https://github.com/dnv-opensource/ospx",
        "Issues": "https://github.com/dnv-opensource/ospx/issues",
        "Repository": "https://github.com/dnv-opensource/ospx.git"
    },
    "split_keywords": [
        "osp",
        " farn",
        " fmi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "53df7f740bb12fe09bea436b801c4f871ceff378c996a34e50f203ab64cc0ac1",
                "md5": "3148dd3b6ab70c2e926b0d90c40593a7",
                "sha256": "d50ff00f0cea1c3553ac524c503ac63912ecf2e2ecec51f9f571479db0d4d4ed"
            },
            "downloads": -1,
            "filename": "ospx-0.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3148dd3b6ab70c2e926b0d90c40593a7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.14,>=3.10",
            "size": 51751,
            "upload_time": "2025-01-18T15:49:28",
            "upload_time_iso_8601": "2025-01-18T15:49:28.653367Z",
            "url": "https://files.pythonhosted.org/packages/53/df/7f740bb12fe09bea436b801c4f871ceff378c996a34e50f203ab64cc0ac1/ospx-0.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bb7a3e35c5b99cc3d67e03e5a532bc01ed43478d596b88349c212c5abfdf2550",
                "md5": "391bc7cc0fefe1a9694d594374aab8fa",
                "sha256": "c2f62ad1f090e74784d5ee5251904f8e2920aeff09658207c21e37faab71d1cd"
            },
            "downloads": -1,
            "filename": "ospx-0.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "391bc7cc0fefe1a9694d594374aab8fa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.14,>=3.10",
            "size": 14733146,
            "upload_time": "2025-01-18T15:49:32",
            "upload_time_iso_8601": "2025-01-18T15:49:32.757821Z",
            "url": "https://files.pythonhosted.org/packages/bb/7a/3e35c5b99cc3d67e03e5a532bc01ed43478d596b88349c212c5abfdf2550/ospx-0.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-18 15:49:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dnv-opensource",
    "github_project": "ospx",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "ospx"
}
        
Elapsed time: 0.39023s