Skip to content

Commit

Permalink
Doc14main (ThummeTo#237)
Browse files Browse the repository at this point in the history
* versionbumps CI actions, Example CI updates

* docs version fixes for 0.14

* fix http 301

* make.jl formatting issue fixed

* Update Example.yml

* updated Examples to new syntax

* reformatted make.jl

* changed to fixed and unfixed versions as requested

* fixed typo in action versions

---------

Co-authored-by: ThummeTo <83663542+ThummeTo@users.noreply.github.com>
  • Loading branch information
0815Creeper and ThummeTo authored Sep 4, 2024
1 parent 84ef2dc commit 01d4a8d
Show file tree
Hide file tree
Showing 35 changed files with 491 additions and 449 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/CrossChecks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Set up Julia
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}

# Set up cache
- name: "Set up cache"
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Check out repository"
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@v2
with:
version: '1'
arch: x64
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/Eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Set up Julia
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
id: version

# Set up cache
- name: "Set up cache"
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand Down
92 changes: 40 additions & 52 deletions .github/workflows/Example.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Examples v1 (latest)
name: Examples

on:
workflow_dispatch:
Expand All @@ -13,23 +13,23 @@ on:
- 'Project.toml'

jobs:
sync-files:
jupyter:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest] # ubuntu-latest
file-name: [manipulation, modelica_conference_2021, multiple_instances, multiprocessing, multithreading, parameterize, simulate, parameter_optimization]
julia-version: ['1']
file-name: [inputs, manipulation, modelica_conference_2021, multiple_instances, multiprocessing, multithreading, parameterize, simulate, parameter_optimization]
julia-version: ['1.10']
julia-arch: [x64]
experimental: [false]

steps:
- name: "Check out repository"
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
Expand All @@ -44,63 +44,51 @@ jobs:
env:
FILE: examples/src/${{ matrix.file-name }}.ipynb
run: |
jupyter nbconvert --ExecutePreprocessor.kernel_name="julia-1.8" --to notebook --inplace --execute ${{ env.FILE }}
jupyter nbconvert --ExecutePreprocessor.kernel_name="julia-${{ matrix.julia-version }}" --to notebook --inplace --execute ${{ env.FILE }}
jupyter nbconvert --to script ${{ env.FILE }}
jupyter nbconvert --to markdown ${{ env.FILE }}
- name: Archive examples artifacts
if: success() && matrix.os == 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: examples
path: examples/src/${{ matrix.file-name }}*

auto-commit:
needs: sync-files
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: "run generated jl script to determine success of example building"
run: julia --project=examples/ examples/src/${{ matrix.file-name }}.jl

- name: Download examples
uses: actions/download-artifact@v3
with:
name: examples
path: examples/src/

- name: auto-commit
- name: "auto-commit (retry on merge)"
if: success() && github.event_name != 'pull_request' && github.branch == 'main'
uses: nick-fields/retry@v3
env:
CI_COMMIT_MESSAGE: Jupyter nbconvert synch - modified, paired .ipynb files
CI_COMMIT_MESSAGE: example-${{ matrix.os }}-${{ matrix.file-name }}-${{ matrix.julia-version }}-${{ matrix.julia-arch }}-${{ matrix.experimental }}[${{ github.ref }}]
CI_COMMIT_AUTHOR: github-actions[bot]
EXAMPLES_PATH: examples/src
# Fetch all and clear the stash list. Include all files from the examples/src folder to the stash and switch the branch.
# Reset the branch and remove all current files in the examples/src folder.
EXAMPLES_PATH: examples
# Fetch all and clear the stash list. Include all files from the examples folder to the stash and switch the branch.
# Reset the branch and remove all current files in the examples folder.
# Checkout the last stash to restore the new notebooks and apply the stash index to restore all other new files in the folder.
run: |
git fetch --all
git stash clear
git stash --include-untracked -- ${{ env.EXAMPLES_PATH }}
git switch examples
git reset --hard origin/examples
rm -rf ${{ env.EXAMPLES_PATH }}
git checkout stash -f -- ${{ env.EXAMPLES_PATH }}
git stash apply --index
git stash drop
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "${{ env.CI_COMMIT_AUTHOR }}@users.noreply.github.com"
git config --global core.autocrlf false
git add ${{ env.EXAMPLES_PATH }}
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git push origin examples
with:
timeout_minutes: 999
max_attempts: 10
warning_on_retry: false
shell: bash
command: |
git fetch --all
git stash clear
git stash --include-untracked -- ${{ env.EXAMPLES_PATH }}
git switch examples
git reset --hard origin/examples
git checkout stash -f -- ${{ env.EXAMPLES_PATH }}
git stash apply --index
git stash drop
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "${{ env.CI_COMMIT_AUTHOR }}@users.noreply.github.com"
git config --global core.autocrlf false
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: auto-commit
if: github.event_name != 'pull_request'
needs: jupyter
if: github.event_name != 'pull_request' && github.branch == 'main'
runs-on: ubuntu-latest
steps:
# Trigger an repoisitory dispath event
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
uses: peter-evans/repository-dispatch@v3
with:
event-type: trigger-docu
8 changes: 4 additions & 4 deletions .github/workflows/TestLTS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ jobs:
steps:
# Checks-out your repository
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set up Julia
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}

# Set up cache
- name: "Set up cache"
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand All @@ -54,4 +54,4 @@ jobs:

# Run the tests
- name: "Run tests"
uses: julia-actions/julia-runtest@v1
uses: julia-actions/julia-runtest@v1
6 changes: 3 additions & 3 deletions .github/workflows/TestLatest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ jobs:
steps:
# Checks-out your repository
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set up Julia
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}

# Set up cache
- name: "Set up cache"
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
FMICore = "8af89139-c281-408e-bce2-3005eb87462f"
FMIImport = "9fcbc62e-52a0-44e9-a616-1359a0008194"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"

Expand Down
34 changes: 16 additions & 18 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,21 @@

import Pkg;
Pkg.develop(path = joinpath(@__DIR__, "../../FMI.jl"));
using Documenter, Plots, JLD2, DataFrames, CSV, MAT, FMI, FMIImport, FMICore
using Documenter, Plots, JLD2, DataFrames, CSV, MAT, FMI, FMIBase, FMIImport, FMICore
using Documenter: GitHubActions

example_pages = [
"Overview" => "examples/overview.md",
"Simulate" => "examples/simulate.md",
"Parameterize" => "examples/parameterize.md",
"Inputs" => "examples/inputs.md",
"Multiple instances" => "examples/multiple_instances.md",
"Modelica conference 2021" => "examples/modelica_conference_2021.md",
"Manipulation" => "examples/manipulation.md",
"Multithreading" => "examples/multithreading.md",
"Multiprocessing" => "examples/multiprocessing.md",
]

makedocs(
sitename = "FMI.jl",
format = Documenter.HTML(
Expand All @@ -17,36 +29,22 @@ makedocs(
size_threshold = 512000,
size_threshold_ignore = ["deprecated.md"],
),
modules = [FMI, FMIImport, FMICore],
modules = [FMI, FMIImport, FMICore, FMIBase],
checkdocs = :exports,
linkcheck = true,
linkcheck_ignore = [
"https://thummeto.github.io/FMI.jl/dev/examples/inputs/",
"https://github.com/ThummeTo/FMICore.jl/blob/main/src/FMI2_c.jl#L718",
],
pages = Any[
"Introduction" => "index.md"
"Features" => "features.md"
"FAQ" => "faq.md"
"Examples" => [
"Overview" => "examples/overview.md"
"Simulate" => "examples/simulate.md"
"Parameterize" => "examples/parameterize.md"
"Multiple instances" => "examples/multiple_instances.md"
"Modelica conference 2021" => "examples/modelica_conference_2021.md"
"Manipulation" => "examples/manipulation.md"
"Multithreading" => "examples/multithreading.md"
"Multiprocessing" => "examples/multiprocessing.md"
]
"Examples" => example_pages
"User Level API - FMI.jl" => "library.md"
"Developer Level API" => Any[
"fmi version independent content"=>Any[
"fmi_lowlevel_library_types.md",
"fmi_lowlevel_library_constants.md",
"fmi_lowlevel_modeldescription_functions.md",
"fmi_lowlevel_library_functions.md",
],
"FMI2 specific content"=>Any[
"fmi2_lowlevel_library_types.md",
"fmi2_lowlevel_library_constants.md",
"FMI2 Functions in FMI Import/Core .jl"=>Any[
"fmi2_lowlevel_modeldescription_functions.md",
Expand Down
43 changes: 1 addition & 42 deletions docs/src/deprecated.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,12 @@ this doc page is necessary as all exported functions must be documented in the m

### internal functions: remove export?
```@docs
fmi2CallbackLogger
fmi2CallbackAllocateMemory
fmi2CallbackFreeMemory
fmi3CallbackLogger
fmi2CallbackFunctions
fmi2CallbackStepFinished
```

### deprecated
Mostly wrappers that are not supposed to be used (call specific wrapped functions instead)

all gone since 0.14.0 (nice)
```@docs
fmiSetReal
fmiReset
fmiGetGenerationTool
fmiEnterContinuousTimeMode
fmiGetEventIndicators
fmiSetBoolean
fmiFreeInstance!
fmiInstantiate!
fmiTerminate
fmiDoStep
fmiSetInteger
fmiCompletedIntegratorStep
fmiExitInitializationMode
fmiSetupExperiment
fmiSetDebugLogging
fmiSerializedFMUstateSize
fmiSerializeFMUstate
fmiDeSerializeFMUstate
fmiEnterInitializationMode
fmiGetDirectionalDerivative!
fmiNewDiscreteStates
fmiGetDirectionalDerivative
fmiSetRealInputDerivatives
fmiGetGenerationDateAndTime
fmiGetContinuousStates
fmiSetContinuousStates
fmiGetNominalsOfContinuousStates
fmiSetTime
fmiSetString
fmiGetString
fmiGetString!
fmiGetInteger
fmiGetInteger!
fmiGetReal
fmiGetReal!
fmiGetBoolean
fmiGetBoolean!
```
2 changes: 1 addition & 1 deletion docs/src/fmi-tool-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ Detailed export information and automatically generated FMUs will be deployed so
| NeuralFMU | [ME](https://github.com/ThummeTo/FMIExport.jl/tree/main/examples/FMI2/NeuralFMU) | coming soon |

## Validation tools
- [Dassault Dymola 2022X](https://www.3ds.com/de/produkte-und-services/catia/produkte/dymola/)
- [Dassault Dymola 2022X](https://www.3ds.com/products/catia/dymola)
- [FMU Check](https://fmu-check.herokuapp.com/)
1 change: 1 addition & 0 deletions docs/src/fmi2_lowlevel_CS_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ fmi2CancelStep
Status information is retrieved from the slave by the following functions:

```@docs
fmi2GetStatus
fmi2GetStatus!
fmi2GetRealStatus!
fmi2GetIntegerStatus!
Expand Down
Loading

0 comments on commit 01d4a8d

Please sign in to comment.