diff --git a/.github/workflows/check-pep8.yml b/.github/workflows/check-pep8.yml deleted file mode 100644 index 46ef531..0000000 --- a/.github/workflows/check-pep8.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: autopep8 -on: - push: - branches: - - main - - develop - pull_request: - branches: - - "*" -jobs: - autopep8: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: autopep8 - id: autopep8 - uses: peter-evans/autopep8@v1 - with: - args: --recursive --diff --aggressive --aggressive --exit-code --ignore E402 --max-line-length 120 . - - name: Fail if autopep8 made changes - if: ${{ steps.autopep8.outputs.exit-code == 2 }} - run: exit 1 diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml new file mode 100644 index 0000000..9981c7c --- /dev/null +++ b/.github/workflows/code-style.yml @@ -0,0 +1,31 @@ +name: Code Style +on: + push: + branches: + - main + - develop + pull_request: + branches: + - "*" + +jobs: + formatting: + runs-on: ubuntu-latest + steps: + - name: Checkout the FMI Runner + uses: actions/checkout@v4 + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + check-latest: true + - name: Install pre-commit + run: pip install pre-commit + - name: Run checks + run: pre-commit run -a -v + - name: Git status + if: always() + run: git status + - name: Full diff + if: always() + run: git diff diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..979cb28 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,5 @@ +{ + "MD013": false, + "MD033": false, + "MD034": false +} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..4c3064b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,21 @@ +repos: +# Official repo for default hooks +- repo: https://github.com/precice/precice-pre-commit-hooks + rev: 'v3.2' + hooks: + - id: format-precice-config + files: "^.*/precice-config.xml" + - id: check-image-prefix + args: [ --prefix=docs-tooling-fmi-runner- ] +- repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.39.0 + hooks: + - id: markdownlint + files: "^docs/.*.md" + - id: markdownlint-fix + files: "^docs/.*.md" +- repo: https://github.com/hhatto/autopep8 + rev: v2.0.4 + hooks: + - id: autopep8 + args: [ --in-place, --ignore=E402, --max-line-length=120 ] diff --git a/docs/README.md b/docs/README.md index e874a8d..d33e7dd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -9,9 +9,9 @@ summary: A tool to execute FMUs and couple them to PDE-based solvers using preCI The [Functional Mock-Up Interface](https://fmi-standard.org/) (FMI) is a standard for the exchange of dynamic simulation models. Currently, it is the de-facto industry standard for co-simulation. Models implementing the FMI standard are called Functional Mock-Up Units (FMU). -The preCICE-FMI runner contains the script `fmiprecice` to couple FMU models with other simulation tools via [preCICE](https://precice.org/). The runner serves as an importer for the FMU to steer the simulation. Additionally, the runner calls the preCICE library to communicate and coordinate with other solvers. +The preCICE-FMI runner contains the script `fmiprecice` to couple FMU models with other simulation tools via [preCICE](https://precice.org/). The runner serves as an importer for the FMU to steer the simulation. Additionally, the runner calls the preCICE library to communicate and coordinate with other solvers. -![img](images/tooling-fmi-runner-setup.png) +![img](images/docs-tooling-fmi-runner-setup.png) ## Usage @@ -21,7 +21,7 @@ The runner is called from the terminal with the command `fmiprecice`. It takes t fmiprecice ./fmi-settings.json ./precice-settings.json ``` -Read on to find out how to install and configure the runner. More information about the software, its abilities, and its limitations can be found in [1]. If you are ready to run your first case, have a look at the [oscillator tutorial](https://github.com/LeonardWilleke/precice-tutorials/tree/create-fmu-oscillator-v2/oscillator). +Read on to find out how to install and configure the runner. More information about the software, its abilities, and its limitations can be found in [1]. If you are ready to run your first case, have a look at the [oscillator tutorial](https://github.com/LeonardWilleke/precice-tutorials/tree/create-fmu-oscillator-v2/oscillator). ## Get the Runner @@ -43,7 +43,7 @@ pip3 install numpy pip3 install fmpy ``` -### Installation +### Installation The software is [hosted on GitHub](https://github.com/precice/fmi-runner). Clone the repository and switch to the root directory: @@ -93,8 +93,8 @@ The file `fmi-settings.json` holds all the necessary information to run a simula "output": ["force", "position"] }, "model_params": { - "apply_filter": true, - "spring_coeff": 65.0 + "apply_filter": true, + "spring_coeff": 65.0 }, "initial_conditions": { "position": 0.0 @@ -157,9 +157,9 @@ The file `precice-settings.json` is used to configure the coupling with preCICE. Current limitations of the FMI runner software are: -- Can only be used with preCICE v2 and Co-Simulation FMUs (FMI 1,2,3) -- All accessed FMU variables are scalar -- Data can only be exchanged via one vertex. The exchange of multiple vertices or full meshes is not possible. +* Can only be used with preCICE v2 and Co-Simulation FMUs (FMI 1,2,3) +* All accessed FMU variables are scalar +* Data can only be exchanged via one vertex. The exchange of multiple vertices or full meshes is not possible. ## How to cite @@ -180,4 +180,3 @@ If you are using the FMI runner, pĺease consider citing the following Thesis: ## References [1] L. Willeke, [A preCICE-FMI Runner to couple controller models to PDEs](https://doi.org/10.18419/opus-13130), Master Thesis, University of Stuttgart, 2023 - diff --git a/docs/images/tooling-fmi-runner-setup.png b/docs/images/docs-tooling-fmi-runner-setup.png similarity index 100% rename from docs/images/tooling-fmi-runner-setup.png rename to docs/images/docs-tooling-fmi-runner-setup.png diff --git a/tests/precice-config.xml b/tests/precice-config.xml index 3434e77..6af1859 100644 --- a/tests/precice-config.xml +++ b/tests/precice-config.xml @@ -1,50 +1,53 @@ - - + - - + - - - - - + + + - - - + - + - - - - - + + + + - + - - - - - + + + - - + + -