Skip to content

Commit 2e9780d

Browse files
committed
2 parents bcd387d + 9f7c099 commit 2e9780d

File tree

3 files changed

+102
-22
lines changed

3 files changed

+102
-22
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
2+
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["main"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Build job
26+
build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
- name: Setup Pages
32+
uses: actions/configure-pages@v5
33+
- name: Build with Jekyll
34+
uses: actions/jekyll-build-pages@v1
35+
with:
36+
source: ./
37+
destination: ./_site
38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@v3
40+
41+
# Deployment job
42+
deploy:
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
runs-on: ubuntu-latest
47+
needs: build
48+
steps:
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

README.md

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1-
![Title](fmu_manipulation_toolbox/resources/fmu_manipulation_toolbox.png)
1+
![](fmu_manipulation_toolbox/resources/fmu_manipulation_toolbox.png)
22

3-
FMU Manipulation Toolbox is a python package which help to analyse and modify a [Functional Mock-up Units (FMUs)](http://fmi-standard.org/)
4-
without recompilation. It is highly customizable. It can even modify the `modelDescription.xml` file.
3+
FMU Manipulation Toolbox is a python package which help to analyse, modify or combine
4+
[Functional Mock-up Units (FMUs)](http://fmi-standard.org/) without recompilation. It is highly customizable as it comes with
5+
a Python API.
56

6-
Manipulating the `modelDescription.xml` can be a dangerous thing! Communicating with the FMU-developer and adapting
7-
the way the FMU is generated, is preferable when possible.
7+
FMU Manipulation Toolbox can be used in different ways :
8+
- Using a Graphical User Interface: suitable for end user
9+
- Using a Command Line Interface: useful in
10+
- Using a python API: the most efficient for automation (CI/CD, transformation scripts, ...)
811

9-
FMU Manipulation Toolbox also allows to group FMU's inside FMU Containers. (see [doc/container.md](doc/container.md))
12+
Major features:
13+
- Analyse FMU content: list ports and their attributes, check compliance of `ModelDescription.xml` with XSD, ...
14+
- Alter FMU by modifying its `modelDescription.xml` file. NOTE: manipulating this file can be a dangerous
15+
thing! Communicating with the FMU-developer and adapting the way the FMU is generated is preferable when
16+
possible.
17+
- Add binary interface. Typical use case is porting a 32bits FMUs to 64bits (or vice et versa).
18+
- Nest FMUs in a [FMU Container](doc/container.md)
19+
20+
FMI versions 2.0 and 3.0 are supported.
1021

1122
## Installation
1223

@@ -17,29 +28,39 @@ Two options available to install FMU Manipulation Toolbox:
1728
- Compile and install from [github repository](https://github.com/grouperenault/fmu_manipulation_toolbox). You will need
1829
- Python required packages. See [`requirements.txt`](requirements.txt).
1930
- C compiler (C99 or later)
20-
- CMake (>= 3.16)
31+
- CMake (>= 3.20)
32+
2133

2234
### Supported platforms
23-
FMU Manipulation Toolbox is tested on:
24-
- Windows 10/11
35+
36+
FMU Manipulation Toolbox is packaged for:
37+
- Windows 10/11 (primary platform)
2538
- Linux (Ubuntu 22.04)
39+
- Darwin
2640

27-
Compilation is reported to work on:
28-
- MacOS (Apple Silicon and Intel)
2941

3042
## Graphical User Interface
3143

32-
FMU Manipulation Toolbox is released with a GUI. You can launch it with the following command `fmutool`
33-
(without any option)
44+
FMU Manipulation Toolbox is released with a GUI. You can launch it with the following command `fmutool-gui`
3445

3546
![GUI](doc/gui.png "GUI")
3647

48+
Button colors descriptions:
49+
- red: remove information from the `modelDescription.xml`
50+
- orange: alter `modelDescription.xml`
51+
- green: add component into the FMU or check it
52+
- violet: extract and save
53+
- blue: filter actions scope or exit
54+
55+
**Original FMU is never modified**. Use `Save` button to get modified copy of the original FMU.
56+
3757

3858
## Command Line Interface
3959

4060
FMU Manipulation Toolbox comes with 2 commands:
4161
- `fmutool`: a versatile analysis and manipulation tool for FMU.
42-
- `fmucontainer`: group FMU's inside FMU Containers. (see [container/README.md](container/README.md))
62+
- `fmucontainer`: group FMUs inside FMU Containers. (see [container/README.md](container/README.md))
63+
- `fmusplit: to extract FMUs from a FMU Container.
4364

4465

4566
### Analysis and Manipulation tool:
@@ -163,14 +184,13 @@ You can write your own FMU Manipulation scripts. Once you downloaded fmutool mod
163184
adding the `import` statement lets you access the API :
164185

165186
```python
166-
from fmu_manipulation_toolbox.operations import FMU, OperationExtractNames, OperationStripTopLevel,
167-
168-
OperationRenameFromCSV
187+
from fmu_manipulation_toolbox.operations import ...
169188
```
170189

190+
171191
### remove toplevel bus (if any)
172192

173-
Give a FMU with the following I/O structure
193+
Given a FMU with the following I/O structure
174194
```
175195
├── Parameters
176196
│ ├── Foo
@@ -194,6 +214,8 @@ The following transformation will lead into:
194214

195215
The following code will do this transformation:
196216
```python
217+
from fmu_manipulation_toolbox.operations import FMU, OperationStripTopLevel
218+
197219
fmu = FMU(r"bouncing_ball.fmu")
198220
operation = OperationStripTopLevel()
199221
fmu.apply_operation(operation)
@@ -205,8 +227,10 @@ fmu.repack(r"bouncing_ball-modified.fmu")
205227
The following code will dump all FMU's Scalars names into a CSV:
206228

207229
```python
230+
from fmu_manipulation_toolbox.operations import FMU, OperationSaveNamesToCSV
231+
208232
fmu = FMU(r"bouncing_ball.fmu")
209-
operation = OperationExtractNames()
233+
operation = OperationSaveNamesToCSV()
210234
fmu.apply_operation(operation)
211235
operation.write_csv(r"bouncing_ball.csv")
212236
```
@@ -224,15 +248,20 @@ g;g;4;parameter;fixed
224248
e;e;5;parameter;tunable
225249
```
226250

251+
227252
### Read CSV and rename FMU ports
228253

229-
CSV file should contain- 2 columns:
254+
CSV file should contain 2 columns:
230255
1. the current name
231256
2. the new name
232257

233258
```python
259+
from fmu_manipulation_toolbox.operations import FMU, OperationRenameFromCSV
260+
234261
fmu = FMU(r"bouncing_ball.fmu")
235262
operation = OperationRenameFromCSV(r"bouncing_ball-modified.csv")
236263
fmu.apply_operation(operation)
237264
fmu.repack(r"bouncing_ball-renamed.fmu")
238265
```
266+
267+
More operations exist in [`Operation.py`](fmu_manipulation_toolbox/operations.py)

doc/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ flowchart LR
1313
Test suite is implemented in [tests directory](../tests).
1414

1515
### FMU Import Compatibility information
16-
FMU Manipulation Toolbox import supports FMI-2.0 and Co-Simulation interface.
16+
FMU Manipulation Toolbox import supports FMI-2.0 & FMI-3.0 for Co-Simulation interface.
1717

1818
#### Tested Exporting Tool
1919
- Amesim
@@ -24,7 +24,7 @@ Automated testsuite use [bouncing_ball.fmu](../tests/operations/bouncing_ball.fm
2424

2525

2626
### FMU Export Compatibility information
27-
FMU Manipulation Toolbox export supports FMI-2.0 and implements Co-Simulation interface.
27+
FMU Manipulation Toolbox export supports FMI-2.0 & 3.0 and implements Co-Simulation interface.
2828

2929
#### Validation Tools
3030
- fmpy

0 commit comments

Comments
 (0)