Skip to content

Commit

Permalink
Merge pull request #796 from AayushSabharwal/as/fix-downstream
Browse files Browse the repository at this point in the history
fix: fix usage of getters of different system
  • Loading branch information
ChrisRackauckas authored Sep 25, 2024
2 parents adcb4dd + a550479 commit 06864fd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/downstream/problem_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,26 +116,38 @@ noise_sys = complete(noise_sys)
sprob = SDEProblem(noise_sys, u0, (0.0, 100.0), p)
u0

getσ1 = getp(noise_sys, σ)
getσ2 = getp(noise_sys, sys.σ)
getσ3 = getp(noise_sys, )
@test getσ1(sprob) == getσ2(sprob) == getσ3(sprob) == sprob.ps[σ] == sprob.ps[sys.σ] ==
sprob.ps[] == 28.0
getρ1 = getp(noise_sys, ρ)
getρ2 = getp(noise_sys, sys.ρ)
getρ3 = getp(noise_sys, )
@test getρ1(sprob) == getρ2(sprob) == getρ3(sprob) == sprob.ps[ρ] == sprob.ps[sys.ρ] ==
sprob.ps[] == 10.0
getβ1 = getp(noise_sys, β)
getβ2 = getp(noise_sys, sys.β)
getβ3 = getp(noise_sys, )
@test getβ1(sprob) == getβ2(sprob) == getβ3(sprob) == sprob.ps[β] == sprob.ps[sys.β] ==
sprob.ps[] == 8 / 3

@test sprob[x] == sprob[noise_sys.x] == sprob[:x] == 1.0
@test sprob[y] == sprob[noise_sys.y] == sprob[:y] == 0.0
@test sprob[z] == sprob[noise_sys.z] == sprob[:z] == 0.0

setσ = setp(noise_sys, σ)
setσ(sprob, 10.0)
@test getσ1(sprob) == getσ2(sprob) == getσ3(sprob) == sprob.ps[σ] == sprob.ps[sys.σ] ==
sprob.ps[] == 10.0
setρ = setp(noise_sys, sys.ρ)
setρ(sprob, 20.0)
@test getρ1(sprob) == getρ2(sprob) == getρ3(sprob) == sprob.ps[ρ] == sprob.ps[sys.ρ] ==
sprob.ps[] == 20.0
setp(noise_sys, noise_sys.ρ)(sprob, 25.0)
@test getρ1(sprob) == getρ2(sprob) == getρ3(sprob) == sprob.ps[ρ] == sprob.ps[sys.ρ] ==
sprob.ps[] == 25.0
setβ = setp(noise_sys, )
setβ(sprob, 30.0)
@test getβ1(sprob) == getβ2(sprob) == getβ3(sprob) == sprob.ps[β] == sprob.ps[sys.β] ==
sprob.ps[] == 30.0
Expand Down

0 comments on commit 06864fd

Please sign in to comment.