Skip to content

Commit

Permalink
fix: fix usage of getters of different system
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Sep 25, 2024
1 parent adcb4dd commit a550479
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 a550479

Please sign in to comment.