Skip to content

Commit

Permalink
updates to match FMI.jl structure & doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
0815Creeper committed Sep 18, 2024
1 parent 13eac2c commit a8b9778
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 22 deletions.
1 change: 0 additions & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} # Deploy key to trigger other actions

6 changes: 2 additions & 4 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ jobs:
steps:
- name: "Check out repository"
uses: actions/checkout@v4
with:
ref: ''

- name: "Set up Julia"
uses: julia-actions/setup-julia@v2
with:
version: '1' # 1.6
version: '1'
arch: x64

- name: "Copy examples, readme"
Expand All @@ -47,7 +45,7 @@ jobs:
cp ./README.md ./docs/src/index.md
- name: "Install dependencies"
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.update()'
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'

- name: "Build and deploy"
env:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/Example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ on:
- 'examples/**'
- '.github/workflows/Example.yml'
- 'Project.toml'

jobs:
jupyter:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest] # , ubuntu-latest]
os: [windows-latest] # ubuntu-latest]
file-name: [simple_hybrid_CS, simple_hybrid_ME, juliacon_2023, modelica_conference_2021]
julia-version: ['1.10']
julia-version: ['1.10']
julia-arch: [x64]
experimental: [false]

steps:
- name: "Check out repository"
uses: actions/checkout@v4
Expand All @@ -33,13 +33,13 @@ jobs:
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}

- name: "Install dependencies"
run: julia --project=examples/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'

- name: "Install packages"
run: pip install jupyter nbconvert

- name: "Execute notebook"
env:
FILE: examples/jupyter-src/${{ matrix.file-name }}.ipynb
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
with:
version: '1.10'

- run: julia -e 'using Pkg; Pkg.add("PlutoSliderServer"); Pkg.add("FMIFlux")'
- run: julia -e 'using Pkg; Pkg.add("PlutoSliderServer");'
- run: julia -e 'using PlutoSliderServer; PlutoSliderServer.export_directory("examples/pluto-src")'

- name: "auto-commit (retry on merge)"
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
git add ${{ env.EXAMPLES_PATH }}
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git push origin examples || (git reset --soft HEAD~1 && (exit 1))
call-docu:
needs: [jupyter, pluto]
if: github.event_name != 'pull_request' && github.ref_name == 'main'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Formatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
# this argument is not required if you don't use the `suggestion-label` input
types: [ opened, reopened, synchronize, labeled, unlabeled ]
workflow_dispatch:

jobs:
code-style:
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ LocalPreferences.toml
tmp/
build/
.vscode/
examples/jupyter-src/.ipynb_checkpoints/
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ for (x, md) in deepcopy(example_pages)
string(
"::warning title=SVG-Warning::example-page \"",
md,
"\" has svg-xml text in it. Most likely, linking of support-files generated by jupyter is broken\"\r\n",
"\" has svg-xml text in it. Most likely, linking of support-files generated by jupyter is broken. The svg-xml text has been removed for the doc-manual, but also no plot will be displayed\r\n",
),
)
# regex replace exeeds stack limit: s = replace(s, r"\<\?xml(?!<\/svg>)(.|\n)*?<\/svg>" => "")
Expand Down
6 changes: 3 additions & 3 deletions docs/src/examples/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ The examples show how to combine FMUs with machine learning ("NeuralFMU") and il
- [__Modelica Conference 2021: NeuralFMUs__](https://thummeto.github.io/FMIFlux.jl/dev/examples/modelica_conference_2021/): Showing basics on how to train a NeuralFMU (Contribution for the *Modelica Conference 2021*).

## Workshops
[Pluto](https://plutojl.org/) based notebooks, that can easily be executed on your own Pluto-Setup.
- [__Scientific Machine Learning using Functional Mock-up Units__](../pluto-src/SciMLUsingFMUs/SciMLUsingFMUs.html): Workshop at JuliaCon 2024 (Eindhoven University, Netherlands)
[__Pluto workshops__](https://thummeto.github.io/FMI.jl/dev/examples/workshops/): [Pluto](https://plutojl.org/) based notebooks, that can easily be executed on your own Pluto-Setup.
- [__Scientific Machine Learning using Functional Mock-up Units__](https://thummeto.github.io/FMI.jl/dev/examples/pluto-src/SciMLUsingFMUs/SciMLUsingFMUs.html): Workshop at JuliaCon 2024 (Eindhoven University, Netherlands)
- [__Hands-on: Hybrid Modeling using FMI__](https://thummeto.github.io/FMI.jl/dev/examples/pluto-src/HybridModelingUsingFMI/HybridModelingUsingFMI.html): Workshop at MODPROD 2024 (Linköping University, Sweden)

## Archived
- [__MDPI 2022: Physics-enhanced NeuralODEs in real-world applications__](https://thummeto.github.io/FMIFlux.jl/dev/examples/mdpi_2022/): An example for a NeuralODE in a real world modeling scenario (Contribution in *MDPI Electronics 2022*).
- [__Growing Horizon ME-NeuralFMU__](https://thummeto.github.io/FMIFlux.jl/dev/examples/growing_horizon_ME/): Growing horizon training technique for a ME-NeuralFMU.
- [__HybridModelingUsingFMI__](../pluto-src/HybridModelingUsingFMI/HybridModelingUsingFMI.html): Workshop at MODPROD 2024 (Linköping University, Sweden)
20 changes: 18 additions & 2 deletions docs/src/library.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ NeuralFMU
## FMI 2 version dependent functions

```@docs
fmi2DoStepCS
fmiDoStepCS
fmi2EvaluateME
fmi2InputDoStepCSOutput
```

## FMI version independent functions

```@docs
fmiDoStepCS
fmiEvaluateME
fmiInputDoStepCSOutput
```
Expand All @@ -31,5 +30,22 @@ fmiInputDoStepCSOutput

```@docs
mse_interpolate
```
transferParams!

## TODO: Sort docs

```@docs
LossAccumulationScheduler
FMIFlux.transferFlatParams!
FMIFlux.WorstElementScheduler
FMIFlux.FMUParameterRegistrator
FMIFlux.SimultaniousZeroCrossing
FMIFlux.ParameterRegistrator
FMIFlux.ScaleShift
FMIFlux.WorstGrowScheduler
FMIFlux.SequentialScheduler
FMIFlux.FMUTimeLayer
FMIFlux.ShiftScale
FMIFlux.RandomScheduler
```
1 change: 1 addition & 0 deletions examples/jupyter-src/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.ipynb_checkpoints/
params/
*.png
./*.gif
5 changes: 4 additions & 1 deletion test/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*.svg
*.pdf
*.gif
*.gif
*.jld2
*.csv
*.mat

0 comments on commit a8b9778

Please sign in to comment.