Skip to content

Commit f4a3cd2

Browse files
update for diffeq syntax changes
1 parent 9e83710 commit f4a3cd2

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ end
237237
and mutate `tis.values` in `f`. For example, we could have
238238

239239
```julia
240-
function f(t, tissue::Tissue, du)
240+
function f(du, tissue::Tissue, p, t)
241241
du .+= randn(3)
242242
end
243243
```

test/REQUIRE

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
OrdinaryDiffEq 2.29.1
2-
StochasticDiffEq 1.1.0
1+
OrdinaryDiffEq 3.0.0
2+
StochasticDiffEq 3.0.0

test/additional_fields_test.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ host = construct(Host,[
2323
)]
2424
)
2525

26-
evolve = function (t,u::Host,du)
26+
evolve = function (du,u::Host,p,t)
2727
for i in 1:length(u)
2828
du[i] = 2*u[i]
2929
end
@@ -60,7 +60,7 @@ host2 = construct(Host2,[
6060
:my_cell_type
6161
)
6262

63-
evolve = function (t,u::Host2,du)
63+
evolve = function (du,u::Host2,p,t)
6464
for i in 1:length(u)
6565
du[i] = 2*u[i]
6666
end

test/dynamic_diffeq.jl

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ tissue1 = construct(Tissue, deepcopy([population, population2])) # Make a Tissue
3232
tissue2 = construct(Tissue, deepcopy([population2, population]))
3333
embryo = construct(Embryo, deepcopy([tissue1, tissue2])) # Make an embryo from Tissues
3434

35-
cell_ode = function (t, cell, dcell)
35+
cell_ode = function (dcell,cell,p,t)
3636
m = mean(cell)
3737
for i in eachindex(cell)
3838
dcell[i] = -m*cell[i]
3939
end
4040
end
4141

42-
f = function (t, embryo, dembryo)
42+
f = function (dembryo,embryo,p,t)
4343
for (cell, y, z) in LevelIterIdx(embryo, 2)
44-
cell_ode(t, cell, @view dembryo[y:z])
44+
cell_ode(@view(dembryo[y:z]),cell,p,t)
4545
end
4646
end
4747

4848
tstop = [0.5]
4949

50-
condition = function (t, u, integrator)
50+
condition = function (u, t, integrator)
5151
t tstop
5252
end
5353

@@ -82,7 +82,7 @@ sol = solve(prob, Rosenbrock23(), callback=shrinking_cb, tstops=tstop)
8282

8383
println("Do the SDE Part")
8484

85-
g = function (t, u, du)
85+
g = function (du,u,p,t)
8686
for i in eachindex(u)
8787
du[i] = 0.1u[i]
8888
end

test/indexing_and_creation_tests.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ p/zero(t)
143143

144144
size(p)
145145

146-
f = function (t, u, du)
146+
f = function (du,u,p,t)
147147
for i in eachindex(u)
148148
du[i] = 0.42*u[i]
149149
end
150150
end
151-
g = function (t, u, du)
151+
g = function (du,u,p,t)
152152
for i in eachindex(u)
153153
du[i] = 0.42*u[i]
154154
end

0 commit comments

Comments
 (0)