Skip to content

Commit

Permalink
V1.0.6 (#30)
Browse files Browse the repository at this point in the history
* added snapshot tolerance

* typo

* typo

* solution fix
  • Loading branch information
ThummeTo committed Aug 30, 2024
1 parent 5f16e85 commit 2152154
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/solution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ function getState(solution::FMUSolution, vrs::fmi2ValueReferenceFormat; isIndex:
end
else
ignore_derivatives() do
vrs = prepareValueReference(solution.component.fmu, vrs)
vrs = prepareValueReference(solution.instance.fmu, vrs)

if !isnothing(solution.states)
for vr in vrs
found = false
for i in 1:length(solution.component.fmu.modelDescription.stateValueReferences)
if solution.component.fmu.modelDescription.stateValueReferences[i] == vr
for i in 1:length(solution.instance.fmu.modelDescription.stateValueReferences)
if solution.instance.fmu.modelDescription.stateValueReferences[i] == vr
push!(indices, i)
found = true
break
Expand Down Expand Up @@ -101,19 +101,19 @@ function getStateDerivative(solution::FMUSolution, vrs::fmi2ValueReferenceFormat
end
else
ignore_derivatives() do
vrs = prepareValueReference(solution.component.fmu, vrs)
vrs = prepareValueReference(solution.instance.fmu, vrs)

if !isnothing(solution.states)
for vr in vrs
found = false
for i in 1:length(solution.component.fmu.modelDescription.stateValueReferences)
if solution.component.fmu.modelDescription.stateValueReferences[i] == vr
for i in 1:length(solution.instance.fmu.modelDescription.stateValueReferences)
if solution.instance.fmu.modelDescription.stateValueReferences[i] == vr
push!(indices, i)
found = true
break
end
end
@assert found "Couldn't find the index for value reference `$(vr)`! This is probaly because this value reference does not belong to a system state."
@assert found "Couldn't find the index for value reference `$(vr)`! This is probably because this value reference does not belong to a system state."
end
end

Expand Down Expand Up @@ -168,7 +168,7 @@ function getValue(solution::FMUSolution, vrs::fmi2ValueReferenceFormat; isIndex:
end
else
ignore_derivatives() do
vrs = prepareValueReference(solution.component.fmu, vrs)
vrs = prepareValueReference(solution.instance.fmu, vrs)

if !isnothing(solution.values)
for vr in vrs
Expand All @@ -180,7 +180,7 @@ function getValue(solution::FMUSolution, vrs::fmi2ValueReferenceFormat; isIndex:
break
end
end
@assert found "Couldn't find the index for value reference `$(vr)`! This is probaly because this value reference does not exist for this system."
@assert found "Couldn't find the index for value reference `$(vr)`! This is probably because this value reference does not exist for this system."
end
end

Expand Down

2 comments on commit 2152154

@ThummeTo
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/114164

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.6 -m "<description of version>" 21521542c234e4b49576ce0114f175a93522bc26
git push origin v1.0.6

Please sign in to comment.