Skip to content

Commit

Permalink
Fix new ODE solver warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
iago-lito committed Feb 9, 2024
1 parent edb8d19 commit 9628e4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions test/internals/model/test-nutrient_intake.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ end
B0 = ones(S)
N0 = ones(nutrient_richness(model))
sim = simulates(model, B0; N0)
@test sim[end][2:3] == [0.0, 0.0]
@test sim.u[end][2:3] == [0.0, 0.0]

# In the absence of consumers, all biomasses are equal (for equal growth parameters).
foodweb = FoodWeb([0 0; 0 0])
Expand All @@ -128,5 +128,5 @@ end
B0 = ones(2)
N0 = ones(2)
sol = simulates(model, B0; N0)
@test sol[end][1] > sol[end][2]
@test sol.u[end][1] > sol.u[end][2]
end
18 changes: 9 additions & 9 deletions test/user/05-basic_pipelines.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Random.seed!(12)
m = default_model(fw)
B0 = [0.5, 0.5, 0.5]
sol = simulate(m, B0)
@test sol[end] [0.04885048633720308, 0.1890242584230083, 0.22059687801237501]
@test sol.u[end] [0.04885048633720308, 0.1890242584230083, 0.22059687801237501]

end

Expand All @@ -32,7 +32,7 @@ end

# Simulate.
sol = simulate(m, 0.5) # (all initial values to 0.5)
@test sol[end] [0.04885048633720308, 0.1890242584230083, 0.22059687801237501]
@test sol.u[end] [0.04885048633720308, 0.1890242584230083, 0.22059687801237501]

end

Expand All @@ -50,7 +50,7 @@ end
)

sol = simulate(m, [0.5, 0.5, 0.5])
@test sol[end] [0.04885048633720308, 0.1890242584230083, 0.22059687801237501]
@test sol.u[end] [0.04885048633720308, 0.1890242584230083, 0.22059687801237501]

end

Expand All @@ -71,7 +71,7 @@ end
# (this produces a system copy on every '+')

sol = simulate(m, 0.5)
@test sol[end] [0.04885048633720308, 0.1890242584230083, 0.22059687801237501]
@test sol.u[end] [0.04885048633720308, 0.1890242584230083, 0.22059687801237501]

end

Expand All @@ -88,7 +88,7 @@ end
m = default_model(fw, ClassicResponse())

sol = simulate(m, 0.5)
@test sol[end] [0.2246409590398916, 0.09112832180307448, 0.5444058436109662]
@test sol.u[end] [0.2246409590398916, 0.09112832180307448, 0.5444058436109662]

end

Expand All @@ -102,7 +102,7 @@ end
)

sol = simulate(m, 0.5)
@test sol[end] [0.24726844778226592, 0.09114742274197872, 0.6904984843155931]
@test sol.u[end] [0.24726844778226592, 0.09114742274197872, 0.6904984843155931]

end

Expand All @@ -120,7 +120,7 @@ end
)

sol = simulate(m, 0.5)
@test sol[end] [
@test sol.u[end] [
0.29247159105315307
0.14537825150324735
0.12875174646007237
Expand Down Expand Up @@ -149,7 +149,7 @@ end
m += layers[:facilitation] + layers[:c] + layers["ref"] + layers['i']

sol = simulate(m, 0.5)
@test sol[end] [
@test sol.u[end] [
0.29247159105315307
0.14537825150324735
0.12875174646007237
Expand All @@ -167,7 +167,7 @@ end
B0, N0 = rand(3), rand(2)
sol = simulate(m, B0; N0)
m._value.producer_growth.concentration
@test sol[end] [
@test sol.u[end] [
0.28423925333678635,
0.18879238451408806,
0.1534109945177679,
Expand Down

0 comments on commit 9628e4c

Please sign in to comment.