-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from dnv-opensource/move-config-from-setup-cfg…
…-to-pyproject-toml Move config from setup cfg to pyproject toml
- Loading branch information
Showing
8 changed files
with
243 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,140 +1,132 @@ | ||
# 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.md) 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 Python 3.9 or higher, i.e. [Python 3.10](https://www.python.org/downloads/release/python-3104/) or [Python 3.11](https://www.python.org/downloads/release/python-3114/) | ||
|
||
2. Update pip and setuptools: | ||
|
||
```sh | ||
python -m pip install --upgrade pip setuptools | ||
``` | ||
|
||
3. git clone the dictIO repository into your local development directory: | ||
|
||
```sh | ||
git clone https://github.com/dnv-opensource/ospx path/to/your/dev/ospx | ||
``` | ||
|
||
4. In the ospx root folder: | ||
|
||
Create a Python virtual environment: | ||
|
||
```sh | ||
python -m venv .venv | ||
``` | ||
|
||
Activate the virtual environment: | ||
|
||
..on Windows: | ||
|
||
```sh | ||
> .venv\Scripts\activate.bat | ||
``` | ||
|
||
..on Linux: | ||
|
||
```sh | ||
source .venv/bin/activate | ||
``` | ||
|
||
Update pip and setuptools: | ||
|
||
```sh | ||
(.venv) $ python -m pip install --upgrade pip setuptools | ||
``` | ||
|
||
Install ospx's dependencies: | ||
```sh | ||
(.venv) $ pip install -r requirements-dev.txt | ||
``` | ||
This should return without errors. | ||
5. Setup your development environment to locate Python source codes: | ||
For example, Visual Studio Code on Windows assumes the Python environment is specified in a `.env` file. <br> | ||
If you are developing and running the Python code from VSCode, make sure to create a `.env` file in the mypackage root folder with below content. <br> | ||
Set the path for `PROJ_DIR` to where your mypackage folder is on your system. <br> | ||
_Note_: `.env` is part of `.gitignore`, such that you do not commit your `.env` file to the repository. | ||
```ini | ||
PROJ_DIR=<path-to-ospx-root-dir> | ||
PYTHONPATH=${PROJ_DIR}/src | ||
``` | ||
6. Test that the installation works (in the mypackage root folder): | ||
```sh | ||
(.venv) $ pytest . | ||
``` | ||
## Meta | ||
Copyright (c) 2024 [DNV](https://www.dnv.com) [open source](https://github.com/dnv-opensource) | ||
Frank Lumpitzsch – [@LinkedIn](https://www.linkedin.com/in/frank-lumpitzsch-23013196/) – [email protected] | ||
Claas Rostock – [@LinkedIn](https://www.linkedin.com/in/claasrostock/?locale=en_US) – [email protected] | ||
Seunghyeon Yoo – [@LinkedIn](https://www.linkedin.com/in/seunghyeon-yoo-3625173b/) – [email protected] | ||
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 your branch (`git checkout -b myBranchName`) | ||
3. Commit your changes (e.g. `git commit -m 'place a descriptive commit message here'`) | ||
4. Push to the branch (e.g. `git push origin myBranchName`) | ||
5. 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/ | ||
# 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.md) 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 Python 3.9 or higher, i.e. [Python 3.10](https://www.python.org/downloads/release/python-3104/) or [Python 3.11](https://www.python.org/downloads/release/python-3114/) | ||
|
||
2. Update pip and setuptools: | ||
|
||
```sh | ||
python -m pip install --upgrade pip setuptools | ||
``` | ||
|
||
3. git clone the dictIO repository into your local development directory: | ||
|
||
```sh | ||
git clone https://github.com/dnv-opensource/ospx path/to/your/dev/ospx | ||
``` | ||
|
||
4. In the ospx root folder: | ||
|
||
Create a Python virtual environment: | ||
|
||
```sh | ||
python -m venv .venv | ||
``` | ||
|
||
Activate the virtual environment: | ||
|
||
..on Windows: | ||
|
||
```sh | ||
> .venv\Scripts\activate.bat | ||
``` | ||
|
||
..on Linux: | ||
|
||
```sh | ||
source .venv/bin/activate | ||
``` | ||
|
||
Update pip and setuptools: | ||
|
||
```sh | ||
(.venv) $ python -m pip install --upgrade pip setuptools | ||
``` | ||
|
||
Install ospx's dependencies: | ||
```sh | ||
(.venv) $ pip install -r requirements-dev.txt | ||
``` | ||
This should return without errors. | ||
Finally, install ospx itself, yet not as a regular package but as an _editable_ package instead, using the pip install option -e: | ||
```sh | ||
(.venv) $ pip install -e . | ||
``` | ||
5. Test that the installation works (in the ospx root folder): | ||
```sh | ||
(.venv) $ pytest . | ||
``` | ||
## Meta | ||
Copyright (c) 2024 [DNV](https://www.dnv.com) [open source](https://github.com/dnv-opensource) | ||
Frank Lumpitzsch – [@LinkedIn](https://www.linkedin.com/in/frank-lumpitzsch-23013196/) – [email protected] | ||
Claas Rostock – [@LinkedIn](https://www.linkedin.com/in/claasrostock/?locale=en_US) – [email protected] | ||
Seunghyeon Yoo – [@LinkedIn](https://www.linkedin.com/in/seunghyeon-yoo-3625173b/) – [email protected] | ||
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 your branch (`git checkout -b myBranchName`) | ||
3. Commit your changes (e.g. `git commit -m 'place a descriptive commit message here'`) | ||
4. Push to the branch (e.g. `git push origin myBranchName`) | ||
5. 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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.