Skip to content

Commit

Permalink
v1.0.5 (#125)
Browse files Browse the repository at this point in the history
* bug fixes

* codecov update
  • Loading branch information
ThummeTo authored Aug 28, 2024
1 parent 724f015 commit 0fcfecc
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 229 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/TestLTS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Test v1.6 (LTS)

on:
workflow_dispatch:
pull_request:
push:
branches:
- main
paths:
- 'src/**'
- 'test/**'
- '.github/workflows/Test.yml'
- 'Project.toml'

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
julia-version: ['1.6']
julia-arch: [x64]
os: [ubuntu-latest, windows-latest]
experimental: [false]

steps:
# Checks-out your repository
- name: Check out repository
uses: actions/checkout@v3

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

# Set up cache
- name: "Set up cache"
uses: actions/cache@v3
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
# Build package
- name: "Build package"
uses: julia-actions/julia-buildpkg@v1

# Run the tests
- name: "Run tests"
uses: julia-actions/julia-runtest@v1
14 changes: 8 additions & 6 deletions .github/workflows/Test.yml → .github/workflows/TestLatest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Tests
name: Test v1 (latest)

on:
workflow_dispatch:
Expand All @@ -9,7 +9,7 @@ on:
paths:
- 'src/**'
- 'test/**'
- '.github/**'
- '.github/workflows/Test.yml'
- 'Project.toml'

jobs:
Expand All @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
julia-version: ['1.6', '1']
julia-version: ['1']
julia-arch: [x64]
os: [ubuntu-latest, windows-latest]
experimental: [false]
Expand All @@ -35,7 +35,7 @@ jobs:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}

# Set up cache
# Set up cache
- name: "Set up cache"
uses: actions/cache@v3
env:
Expand All @@ -47,7 +47,7 @@ jobs:
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
# Build package
- name: "Build package"
uses: julia-actions/julia-buildpkg@v1
Expand All @@ -62,6 +62,8 @@ jobs:

# Run codecov
- name: "Run CodeCov"
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: lcov.info
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FMIImport"
uuid = "9fcbc62e-52a0-44e9-a616-1359a0008194"
authors = ["TT <[email protected]>", "LM <[email protected]>", "JK <[email protected]>"]
version = "1.0.4"
version = "1.0.5"

[deps]
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@


[![Dev Docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://thummeto.github.io/FMI.jl/dev/)
[![Run Tests](https://github.com/ThummeTo/FMIImport.jl/actions/workflows/Test.yml/badge.svg)](https://github.com/ThummeTo/FMIImport.jl/actions/workflows/Test.yml)
[![Test (latest)](https://github.com/ThummeTo/FMIImport.jl/actions/workflows/TestLatest.yml/badge.svg)](https://github.com/ThummeTo/FMIImport.jl/actions/workflows/TestLatest.yml)
[![Test (LTS)](https://github.com/ThummeTo/FMIImport.jl/actions/workflows/TestLTS.yml/badge.svg)](https://github.com/ThummeTo/FMIImport.jl/actions/workflows/TestLTS.yml)
[![Run PkgEval](https://github.com/ThummeTo/FMIImport.jl/actions/workflows/Eval.yml/badge.svg)](https://github.com/ThummeTo/FMIImport.jl/actions/workflows/Eval.yml)
[![Coverage](https://codecov.io/gh/ThummeTo/FMIImport.jl/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ThummeTo/FMIImport.jl)
[![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)
Expand Down
3 changes: 3 additions & 0 deletions src/FMI2/md.jl
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ end
# ToDo: Comment
function parseDerivatives(md::fmi2ModelDescription, nodes::EzXML.Node)
@assert (nodes.name == "Derivatives") "Wrong element name."

md.modelStructure.derivatives = []
for node in eachelement(nodes)
if node.name == "Unknown"
Expand All @@ -463,6 +464,8 @@ function parseDerivatives(md::fmi2ModelDescription, nodes::EzXML.Node)
@warn "Unknown entry in `ModelStructure.Derivatives` named `$(node.name)`."
end
end

nothing
end

# ToDo: Comment
Expand Down
1 change: 0 additions & 1 deletion src/FMIImport.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import FMIBase.ChainRulesCore: ignore_derivatives
using RelocatableFolders

import FMIBase: EzXML
include("convert.jl")
include("zip.jl")
include("binary.jl")
include("md_parse.jl")
Expand Down
11 changes: 6 additions & 5 deletions src/binary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function loadFMU(
unpackPath::Union{String,Nothing} = nothing,
cleanup::Bool = true,
type::Union{Symbol,Nothing} = nothing,
kwargs...
)

unzippedAbsPath, zipAbsPath =
Expand All @@ -72,11 +73,11 @@ function loadFMU(
version = root["fmiVersion"]

if version == "1.0"
@assert false "FMI version 1.0 deteted, this is (currently) not supported by FMI.jl."
@assert false "FMI version 1.0 detected, this is (currently) not supported by FMI.jl."
elseif version == "2.0"
return createFMU2(unzippedAbsPath, zipAbsPath; type = type)
return createFMU2(unzippedAbsPath, zipAbsPath; type = type, kwargs...)
elseif version == "3.0"
return createFMU3(unzippedAbsPath, zipAbsPath; type = type)
return createFMU3(unzippedAbsPath, zipAbsPath; type = type, kwargs...)
else
@assert false, "Unknwon FMI version `$(version)`."
end
Expand Down Expand Up @@ -113,7 +114,7 @@ function unloadFMU(fmu::FMU2, cleanUp::Bool = true; secure_pointers::Bool = true
end

# the components are removed from the component list via call to fmi2FreeInstance!
@assert length(fmu.components) == 0 "fmi2Unload(...): Failure during deleting components, $(length(fmu.components)) remaining in stack."
@assert length(fmu.components) == 0 "unloadFMU(fmu::FMU2, ...): Failure during deleting components, $(length(fmu.components)) remaining in stack."

if secure_pointers
unloadPointers(fmu)
Expand All @@ -139,7 +140,7 @@ function unloadFMU(fmu::FMU3, cleanUp::Bool = true)
dlclose(fmu.libHandle)

# the instances are removed from the instances list via call to fmi3FreeInstance!
@assert length(fmu.instances) == 0 "fmi3Unload(...): Failure during deleting instances, $(length(fmu.instances)) remaining in stack."
@assert length(fmu.instances) == 0 "unloadFMU(fmu::FMU3, ...): Failure during deleting instances, $(length(fmu.instances)) remaining in stack."

if cleanUp
try
Expand Down
Loading

0 comments on commit 0fcfecc

Please sign in to comment.