ospx

Extension package to farn, adding support to build OSP (co-)simulation cases using functional mockup units (FMUs).

https://github.com/dnv-opensource/ospx

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.9%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Extension package to farn, adding support to build OSP (co-)simulation cases using functional mockup units (FMUs).

Basic Info
Statistics
  • Stars: 1
  • Watchers: 6
  • Forks: 0
  • Open Issues: 0
  • Releases: 27
Created over 4 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Citation

README.md

pypi versions license ci docs

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

sh 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: ```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.

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: 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 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.
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 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.
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:
..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 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

  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 before creating the Pull Request.

Owner

  • Name: DNV open source
  • Login: dnv-opensource
  • Kind: organization
  • Location: Norway

Open source from DNV

Citation (CITATION.cff)

title: ospx
version: 0.3.1
abstract: >-
  Extension package to farn, adding support to build OSP simulation cases using FMUs.
type: software
authors:
  - name: DNV SE
    address: 'Brooktorkai 18'
    post-code: '20457'
    city: Hamburg
    country: DE
    website: 'https://www.dnv.com/'
  - given-names: Frank
    family-names: Lumpitzsch
    affiliation: DNV
    email: frank.lumpitzsch@dnv.com
    website: 'https://www.linkedin.com/in/frank-lumpitzsch-23013196/'
  - given-names: Claas
    family-names: Rostock
    affiliation: DNV
    email: claas.rostock@dnv.com
    website: 'https://www.linkedin.com/in/claasrostock/?locale=en_US'
  - given-names: Seunghyeon
    family-names: Yoo
    affiliation: DNV
    email: seunghyeon.yoo@dnv.com
    website: 'https://www.linkedin.com/in/seunghyeon-yoo-3625173b/'
keywords:
  - farn
  - OSP
  - fmi
license: MIT
license-url: 'https://dnv-opensource.github.io/ospx/LICENSE.html'
url: 'https://dnv-opensource.github.io/ospx/README.html'
repository-code: 'https://github.com/dnv-opensource/ospx'
message: 'Please cite this software using these metadata.'
cff-version: 1.2.0

GitHub Events

Total
  • Create event: 8
  • Issues event: 3
  • Release event: 4
  • Delete event: 6
  • Push event: 317
  • Pull request event: 14
Last Year
  • Create event: 8
  • Issues event: 3
  • Release event: 4
  • Delete event: 6
  • Push event: 317
  • Pull request event: 14

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 4,498 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 2
  • Total versions: 29
  • Total maintainers: 2
pypi.org: ospx

Extension package to farn, adding support to build OSP simulation cases using FMUs.

  • Homepage: https://github.com/dnv-opensource/ospx
  • Documentation: https://dnv-opensource.github.io/ospx/README.html
  • 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.
  • Latest release: 0.3.1
    published about 1 year ago
  • Versions: 29
  • Dependent Packages: 1
  • Dependent Repositories: 2
  • Downloads: 4,498 Last month
Rankings
Dependent packages count: 4.8%
Dependent repos count: 11.6%
Average: 20.4%
Downloads: 23.8%
Forks count: 29.8%
Stargazers count: 31.9%
Maintainers (2)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • Sphinx >=4.3.0
  • dictIO >=0.1.1
  • flake8 >=4.0.1
  • furo *
  • graphviz >=0.17
  • lxml >=4.6.4
  • matplotlib >=3.4.3
  • myst-parser >=0.15.2
  • numpy >=1.21.4
  • pandas >=1.3.4
  • pep8-naming >=0.12.1
  • pytest >=6.2.5
  • pytest-cov >=3.0.0
  • pytest-randomly >=3.11.0
  • sphinx-argparse-cli >=1.8.2
  • yapf >=0.31.0
requirements-dev.txt pypi
  • Sphinx >=5.3 development
  • black >=23.1.0 development
  • furo >=2022.9.29 development
  • myst-parser >=0.18 development
  • pyright >=1.1.292 development
  • pytest >=7.2 development
  • pytest-cov >=4.0 development
  • pytest-randomly >=3.12 development
  • ruff >=0.0.240 development
  • sourcery >=1.0.3 development
  • sourcery-cli >=1.0.3 development
  • sphinx-argparse-cli >=1.10 development
.github/workflows/_build_and_publish_documentation.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • ammaraskar/sphinx-problem-matcher master composite
  • peaceiris/actions-gh-pages v3 composite
.github/workflows/_build_package.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
.github/workflows/_code_quality.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • psf/black stable composite
.github/workflows/_merge_into_release.yml actions
  • actions/checkout v3 composite
  • devmasx/merge-branch v1.4.0 composite
.github/workflows/_publish_package.yml actions
  • actions/download-artifact v3 composite
  • pypa/gh-action-pypi-publish v1.5.2 composite
.github/workflows/_test.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/_test_future.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/nightly_build.yml actions
.github/workflows/publish_release.yml actions
.github/workflows/pull_request_to_main.yml actions
.github/workflows/push.yml actions
.github/workflows/push_to_main.yml actions
.github/workflows/push_to_release.yml actions
pyproject.toml pypi
requirements-types.txt pypi
  • types-lxml >=2023.10.21