Skip to content

Commit 3cd20ee

Browse files
v0.14.0 (#221)
* preparation for FMIBase and FMI3 * docu * updated readme, relaxed compat * modified project.tomlx * removed num_downloads badge, added new doc-strings to manual (#227) (api for badge currently down since 01-2024, screws up link-checking of documenter, markdown comment is not possible with documenter -> deletion) Co-authored-by: ThummeTo <83663542+ThummeTo@users.noreply.github.com> * fixed cross checks (FMI2) * cross checks fix * fixed tests * added formatter action * code styling * updated actions * updated actions further --------- Co-authored-by: Simon Exner <43469235+0815Creeper@users.noreply.github.com>
1 parent 765a88c commit 3cd20ee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1949
-9695
lines changed

.github/workflows/Documentation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: "Set up Julia"
2929
uses: julia-actions/setup-julia@v1
3030
with:
31-
version: '1.9'
31+
version: '1'
3232
arch: x64
3333

3434
- name: "Copy examples, readme"

.github/workflows/Eval.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ jobs:
5656
Pkg.instantiate();
5757
Pkg.add("Test");
5858
Pkg.add(path="./PkgEval.jl")'
59-
julia --project=. ./test/FMI2/eval.jl
59+
julia --project=. ./test/eval.jl

.github/workflows/Example.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
matrix:
2121
os: [windows-latest] # ubuntu-latest
2222
file-name: [manipulation, modelica_conference_2021, multiple_instances, multiprocessing, multithreading, parameterize, simulate, parameter_optimization]
23-
julia-version: ['1.8']
23+
julia-version: ['1']
2424
julia-arch: [x64]
2525
experimental: [false]
2626

.github/workflows/Formatter.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Format suggestions
2+
on:
3+
pull_request:
4+
# this argument is not required if you don't use the `suggestion-label` input
5+
types: [ opened, reopened, synchronize, labeled, unlabeled ]
6+
jobs:
7+
code-style:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: julia-actions/julia-format@v3
11+
with:
12+
version: '1' # Set `version` to '1.0.54' if you need to use JuliaFormatter.jl v1.0.54 (default: '1')
13+
suggestion-label: 'format-suggest' # leave this unset or empty to show suggestions for all PRs
14+

Project.toml

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
name = "FMI"
22
uuid = "14a09403-18e3-468f-ad8a-74f8dda2d9ac"
33
authors = ["TT <tobias.thummerer@informatik.uni-augsburg.de>", "LM <lars.mikelsons@informatik.uni-augsburg.de>", "JK <josef.kircher@student.uni-augsburg.de>"]
4-
version = "0.13.3"
4+
version = "0.14.0"
55

66
[deps]
7-
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
8-
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
97
FMIExport = "31b88311-cab6-44ed-ba9c-fe5a9abbd67a"
108
FMIImport = "9fcbc62e-52a0-44e9-a616-1359a0008194"
119
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
12-
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
13-
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
14-
ThreadPools = "b189fb0b-2eb5-4ed4-bc0c-d34c51242431"
1510

1611
[compat]
17-
DifferentialEquations = "7.7.0 - 7.13"
18-
Downloads = "1"
19-
FMIExport = "0.3.0"
20-
FMIImport = "0.16.0"
12+
FMIExport = "0.4.0"
13+
FMIImport = "1.0.0"
2114
LinearAlgebra = "1"
22-
ProgressMeter = "1.7.0 - 1.9"
23-
Requires = "1.3.0"
24-
ThreadPools = "2.1.1"
2515
julia = "1.6"

README.md

+52-31
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,43 @@
22
# FMI.jl
33

44
## What is FMI.jl?
5-
[*FMI.jl*](https://github.com/ThummeTo/FMI.jl) is a free-to-use software library for the Julia programming language which integrates the **F**unctional **M**ock-Up **I**nterface ([fmi-standard.org](https://fmi-standard.org/)): load or create, parameterize, differentiate, simulate and plot FMUs seamlessly inside the Julia programming language!
5+
[*FMI.jl*](https://github.com/ThummeTo/FMI.jl) is a free-to-use software library for the Julia programming language which integrates the **F**unctional **M**ock-Up **I**nterface ([fmi-standard.org](https://fmi-standard.org/)): load or create, parameterize, differentiate, linearize, simulate and plot FMUs seamlessly inside the Julia programming language!
66

7-
[![Dev Docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://ThummeTo.github.io/FMI.jl/dev)
8-
[![Test (latest)](https://github.com/ThummeTo/FMI.jl/actions/workflows/TestLatest.yml/badge.svg)](https://github.com/ThummeTo/FMI.jl/actions/workflows/TestLatest.yml)
9-
[![Test (LTS)](https://github.com/ThummeTo/FMI.jl/actions/workflows/TestLTS.yml/badge.svg)](https://github.com/ThummeTo/FMI.jl/actions/workflows/TestLTS.yml)
10-
[![FMI2 Cross Checks (latest)](https://github.com/ThummeTo/FMI.jl/actions/workflows/CrossChecks.yml/badge.svg)](https://github.com/ThummeTo/FMI.jl/actions/workflows/CrossChecks.yml)
11-
[![Examples (latest)](https://github.com/ThummeTo/FMI.jl/actions/workflows/Example.yml/badge.svg)](https://github.com/ThummeTo/FMI.jl/actions/workflows/Example.yml)
12-
[![Build Docs](https://github.com/ThummeTo/FMI.jl/actions/workflows/Documentation.yml/badge.svg)](https://github.com/ThummeTo/FMI.jl/actions/workflows/Documentation.yml)
13-
[![Run PkgEval](https://github.com/ThummeTo/FMI.jl/actions/workflows/Eval.yml/badge.svg)](https://github.com/ThummeTo/FMI.jl/actions/workflows/Eval.yml)
14-
[![Coverage](https://codecov.io/gh/ThummeTo/FMI.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/ThummeTo/FMI.jl)
15-
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
16-
[![FMI Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/FMI)](https://pkgs.genieframework.com?packages=FMI)
17-
[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
7+
| | |
8+
|---|---|
9+
| Documentation | [![Build Docs](https://github.com/ThummeTo/FMI.jl/actions/workflows/Documentation.yml/badge.svg)](https://github.com/ThummeTo/FMI.jl/actions/workflows/Documentation.yml) [![Dev Docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://ThummeTo.github.io/FMI.jl/dev) |
10+
| Examples | [![Examples (latest)](https://github.com/ThummeTo/FMI.jl/actions/workflows/Example.yml/badge.svg)](https://github.com/ThummeTo/FMI.jl/actions/workflows/Example.yml) |
11+
| Tests | [![Test (latest)](https://github.com/ThummeTo/FMI.jl/actions/workflows/TestLatest.yml/badge.svg)](https://github.com/ThummeTo/FMI.jl/actions/workflows/TestLatest.yml) [![Test (LTS)](https://github.com/ThummeTo/FMI.jl/actions/workflows/TestLTS.yml/badge.svg)](https://github.com/ThummeTo/FMI.jl/actions/workflows/TestLTS.yml) [![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) |
12+
| FMI cross checks| [![FMI2 Cross Checks](https://github.com/ThummeTo/FMI.jl/actions/workflows/CrossChecks.yml/badge.svg)](https://github.com/ThummeTo/FMI.jl/actions/workflows/CrossChecks.yml) |
13+
| Package evaluation| [![Run PkgEval](https://github.com/ThummeTo/FMI.jl/actions/workflows/Eval.yml/badge.svg)](https://github.com/ThummeTo/FMI.jl/actions/workflows/Eval.yml) |
14+
| Code coverage | [![Coverage](https://codecov.io/gh/ThummeTo/FMI.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/ThummeTo/FMI.jl) |
15+
| Collaboration | [![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac) |
16+
| Formatting | [![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle) |
1817

18+
## Breaking Changes in FMI.jl (starting from v0.14.0 until release of v1.0.0)
19+
If you want to migrate your project from [*FMI.jl*](https://github.com/ThummeTo/FMI.jl) < v1.0.0 to >= v1.0.0, you will face some breaking changes - but they are worth it as you will see! We decided to do multiple smaller breaking changes starting with v0.14.0, instead of one big one. Some of them are already implemented (checked), some are still on the todo (unchecked) but will be implemented before releasing v1.0.0.
20+
21+
- [x] Many functions, that are not part of the FMI-standard, had the prefix `fmi2...` or `fmi3...`. This was corrected. Now, only functions that are defined by the standard itself, like e.g. `fmi2Instantiate` are allowed to keep the prefix. Other methods, like `fmi2ValueReferenceToString`, that where added to make this library more comfortable, are now cleaned to be more the Julia way: `valueReferenceToString`. If your code errors, the corresponding function might have lost it's prefix, so try this first.
22+
23+
- [x] Wrapper functions where removed, because that is not the Julia way. In most cases, this will not affect your code.
24+
25+
- [x] [*FMICore.jl*](https://github.com/ThummeTo/FMICore.jl) and [*FMIImport.jl*](https://github.com/ThummeTo/FMIImport.jl) were divided into [*FMICore.jl*](https://github.com/ThummeTo/FMICore.jl), [*FMIImport.jl*](https://github.com/ThummeTo/FMIImport.jl) and [*FMIBase.jl*](https://github.com/ThummeTo/FMIBase.jl). [*FMICore.jl*](https://github.com/ThummeTo/FMICore.jl) now holds the pure standard definition (C-types and -functions), while [*FMIBase.jl*](https://github.com/ThummeTo/FMIBase.jl) holds everything that is needed on top of that in [*FMIImport.jl*](https://github.com/ThummeTo/FMIImport.jl) as well as in [*FMIExport.jl*](https://github.com/ThummeTo/FMIExport.jl).
26+
27+
- [ ] Updated all library tests for a better code coverage.
28+
29+
- [ ] We tried to document every function, if you find undocumented user-level functions, please open an issue or PR.
30+
31+
- [ ] Allocations, type stability and code format where optimized and are monitored by CI now.
32+
33+
- [ ] Dependencies are reduced a little, to make the libraries more light-weight.
34+
35+
- [ ] RAM for allocated FMUs, their instances and states, is now auto-released. For maximum performance/safety you can use FMUs in blocks (like file reading/writing).
36+
37+
- [ ] New low-level interfaces are introduced, that fit the SciML-ecosystem. For example, a FMU can still be simulated with `simulate(fmu)`, but one can also decide to create a `prob = FMUProblem(fmu)` (like an `ODEProblem`) and use `solve(prob)` to obtain a solution. Keywords will be adapted to have a fully consistent interface with the remaining SciML-ecosystem.
38+
39+
- [ ] Optimization for new Julia LTS v1.10, removing code to keep downward compatibility with old LTS v1.6.
40+
41+
🎉 After all listed features are implemented, v1.0.0 will be released! 🎉
1942

2043
## How can I use FMI.jl?
2144
1\. Open a Julia-REPL, switch to package mode using `]`, activate your preferred environment.
@@ -37,16 +60,16 @@
3760
using FMI, Plots
3861

3962
# load and instantiate a FMU
40-
fmu = fmiLoad(pathToFMU)
63+
fmu = loadFMU(pathToFMU)
4164

4265
# simulate from t=0.0s until t=10.0s and record the FMU variable named "mass.s"
43-
simData = fmiSimulate(fmu, (0.0, 10.0); recordValues=["mass.s"])
66+
simData = simulate(fmu, (0.0, 10.0); recordValues=["mass.s"])
4467

4568
# plot it!
4669
plot(simData)
4770

4871
# free memory
49-
fmiUnload(myFMU)
72+
unloadFMU(myFMU)
5073
```
5174

5275
## What is currently supported in FMI.jl?
@@ -57,21 +80,21 @@ fmiUnload(myFMU)
5780
| | **FMI2.0.3** | | **FMI3.0** | | **SSP1.0** | |
5881
|-----------------------------------|--------------|--------|------------|--------|------------|--------|
5982
| | Import | Export | Import | Export | Import | Export |
60-
| CS | ✔️✔️ | 🚧 | ✔️ | 📅 | 📅 | 📅 |
61-
| ME (continuous) | ✔️✔️ | ✔️✔️ | 🚧 | 📅 | 📅 | 📅 |
62-
| ME (discontinuous) | ✔️✔️ | ✔️✔️ | 🚧 | 📅 | 📅 | 📅 |
83+
| CS | ✔️✔️ | 🚧 | ✔️✔️ | 📅 | 📅 | 📅 |
84+
| ME (continuous) | ✔️✔️ | ✔️✔️ | ✔️✔️ | 📅 | 📅 | 📅 |
85+
| ME (discontinuous) | ✔️✔️ | ✔️✔️ | ✔️✔️ | 📅 | 📅 | 📅 |
6386
| SE | 🚫 | 🚫 | 🚧 | 📅 | 🚫 | 🚫 |
64-
| Explicit solvers | ✔️✔️ | ✔️✔️ | ✔️ | 📅 | 📅 | 📅 |
65-
| Implicit solvers (autodiff=false) | ✔️✔️ | 🚧 | ✔️ | 📅 | 📅 | 📅 |
66-
| Implicit solvers (autodiff=true) | ✔️✔️ | 🚧 | 🚧 | 📅 | 📅 | 📅 |
67-
| get/setState | ✔️✔️ | 📅 | ✔️ | 📅 | 🚫 | 🚫 |
68-
| getDirectionalDerivatives | ✔️✔️ | 📅 | ✔️ | 📅 | 🚫 | 🚫 |
69-
| getAdjointDerivatives | 🚫 | 🚫 | ✔️ | 📅 | 🚫 | 🚫 |
87+
| Explicit solvers | ✔️✔️ | ✔️✔️ | ✔️✔️ | 📅 | 📅 | 📅 |
88+
| Implicit solvers (autodiff=false) | ✔️✔️ | ✔️✔️ | ✔️✔️ | 📅 | 📅 | 📅 |
89+
| Implicit solvers (autodiff=true) | ✔️ | ✔️✔️ | ✔️ | 📅 | 📅 | 📅 |
90+
| get/setState | ✔️✔️ | 📅 | ✔️✔️ | 📅 | 🚫 | 🚫 |
91+
| getDirectionalDerivatives | ✔️✔️ | 📅 | ✔️✔️ | 📅 | 🚫 | 🚫 |
92+
| getAdjointDerivatives | 🚫 | 🚫 | ✔️✔️ | 📅 | 🚫 | 🚫 |
7093
| FMI Cross Checks | ✔️✔️ | 📅 | 📅 | 📅 | 🚫 | 🚫 |
7194

72-
✔️✔️ supported & tested
95+
✔️✔️ supported & CI-tested
7396

74-
✔️ beta supported (implemented), but untested
97+
✔️ beta supported: implemented, but not CI-tested
7598

7699
🚧 work in progress
77100

@@ -87,14 +110,15 @@ To keep dependencies nice and clean, the original package [*FMI.jl*](https://git
87110
- [*FMI.jl*](https://github.com/ThummeTo/FMI.jl): High level loading, manipulating, saving or building entire FMUs from scratch
88111
- [*FMIImport.jl*](https://github.com/ThummeTo/FMIImport.jl): Importing FMUs into Julia
89112
- [*FMIExport.jl*](https://github.com/ThummeTo/FMIExport.jl): Exporting stand-alone FMUs from Julia Code
113+
- [*FMIBase.jl*](https://github.com/ThummeTo/FMIBase.jl): Common concepts for import and export of FMUs
90114
- [*FMICore.jl*](https://github.com/ThummeTo/FMICore.jl): C-code wrapper for the FMI-standard
91115
- [*FMISensitivity.jl*](https://github.com/ThummeTo/FMISensitivity.jl): Static and dynamic sensitivities over FMUs
92116
- [*FMIBuild.jl*](https://github.com/ThummeTo/FMIBuild.jl): Compiler/Compilation dependencies for FMIExport.jl
93117
- [*FMIFlux.jl*](https://github.com/ThummeTo/FMIFlux.jl): Machine Learning with FMUs
94118
- [*FMIZoo.jl*](https://github.com/ThummeTo/FMIZoo.jl): A collection of testing and example FMUs
95119

96120
## What Platforms are supported?
97-
[*FMI.jl*](https://github.com/ThummeTo/FMI.jl) is tested (and testing) under Julia Versions *1.6 LTS* (64-bit) and *latest* (64-bit) on Windows *latest* (64-bit) and Ubuntu *latest* (64-bit). Mac and Julia (32-bit) should work, but untested. For the best performance, we recommend using Julia >= 1.7.
121+
[*FMI.jl*](https://github.com/ThummeTo/FMI.jl) is tested (and testing) under Julia Versions *1.6 LTS* (64-bit) and *latest* (64-bit) on Windows *latest* (64-bit, 32-bit) and Ubuntu *latest* (64-bit). Mac (64-bit, 32-bit) and Ubuntu (32-bit) should work, but untested. For the best performance, we recommend using Julia >= 1.7, even if we support and test for the official LTS (1.6.7).
98122

99123
## How to cite?
100124
Tobias Thummerer, Lars Mikelsons and Josef Kircher. 2021. **NeuralFMU: towards structural integration of FMUs into neural networks.** Martin Sjölund, Lena Buffoni, Adrian Pop and Lennart Ochel (Ed.). Proceedings of 14th Modelica Conference 2021, Linköping, Sweden, September 20-24, 2021. Linköping University Electronic Press, Linköping (Linköping Electronic Conference Proceedings ; 181), 297-306. [DOI: 10.3384/ecp21181297](https://doi.org/10.3384/ecp21181297)
@@ -109,7 +133,4 @@ Contributors are welcome. Before contributing, please read, understand and follo
109133
During development of new implementations or optimizations on exisitng code, one will have to make design decissions that influence the library performance and usability. The following priorization should be the basis for decision-making:
110134
- **#1 Compliance with standard:** It is the highest priority to be compliant with the FMI standard ([fmi-standard.org](https://fmi-standard.org/)). Identifiers described in the standard must be used. Topologies should follow the specification as far as the possibilities of the Julia programming language allows.
111135
- **#2 Performance:** Because [*FMI.jl*](https://github.com/ThummeTo/FMI.jl) is a simulation tool, performance is very important. This applies to the efficient use of CPU and GPU, but also the conscientious use of RAM and disc space.
112-
- **#3 Usability:** The library should be as usable as possible, as long as being fully compliant with the FMI standard.
113-
114-
## Interested in Hybrid Modelling in Julia using FMUs?
115-
See [*FMIFlux.jl*](https://github.com/ThummeTo/FMIFlux.jl).
136+
- **#3 Usability:** The library should be as usable as possible and feel "the Julia way" (e.g. by using multiple dispatch instead of the "C coding style"), as long as being fully compliant with the FMI standard.

cross_checks/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ More information: https://github.com/modelica/fmi-cross-check
88

99
### Automated run using github actions
1010

11-
The `..\.github\workflow` folder contains a `CrossChecks.yml` file that configures the excecution of the fmi cross checks using a github action.
11+
The `..\.github\workflow` folder contains a `CrossChecks.yml` file that configures the execution of the FMI cross checks using a github action.
1212

13-
This action pulls the fmi cross checks from a repository, excecutes them and pushes the result files back to the repository. These specified repository needs to be forked before from https://github.com/modelica/fmi-cross-check. After forking the fmi-cross-check repository, a access token with repo rights needs to be generated (https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
13+
This action pulls the FMI cross checks from a repository, executes them and pushes the result files back to the repository. These specified repository needs to be forked before from https://github.com/modelica/fmi-cross-check. After forking the fmi-cross-check repository, a access token with repo rights needs to be generated (https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
1414

1515
In order to use the action you need to be set the following information about your fmi-cross-check repository the FMI.jl repository as secrets and variables.
1616

1717
* (Variable) `CROSS_CHECK_REPO_URL`: The url (without protocol) to your fmi-cross-check repository. (Example: `github.com/johndoe/fmi-cross-check`)
1818
* (Variable) `CROSS_CHECK_REPO_USER`: The user that has write access to the fmi-cross-check repository and for which the token was created. (Example: `johndoe`)
1919
* (Secret) `CROSS_CHECK_REPO_TOKEN`: The github token that was created for the fmi-cross-check repository (Example: `ghp_IqHJF673SD...`)
2020

21-
Not setting these values correctly will prevent the results to be pushed to your fmi-cross-check repositoy. However you will still be able to see the result summary of your run in the github action logs.
21+
Not setting these values correctly will prevent the results to be pushed to your fmi-cross-check repository. However you will still be able to see the result summary of your run in the github action logs.
2222

2323
### Manual run
2424

0 commit comments

Comments
 (0)