Skip to content

Commit 0a52f6a

Browse files
Merge pull request #94 from SciML/build_module
set the built module for the functions to fix precompilation
2 parents a3f4362 + 9045453 commit 0a52f6a

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

lib/JumpProblemLibrary/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "JumpProblemLibrary"
22
uuid = "faf0f6d7-8cee-47cb-b27c-1eb80cef534e"
3-
version = "0.1.1"
3+
version = "0.1.2"
44

55
[deps]
66
Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83"

lib/JumpProblemLibrary/src/JumpProblemLibrary.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ end k1 k2 k3 k4 k5 k6
4040
rates = [0.5, (20 * log(2.0) / 120.0), (log(2.0) / 120.0), (log(2.0) / 600.0), 0.025, 1.0]
4141
tf = 1000.0
4242
u0 = [1, 0, 0, 0]
43-
prob = DiscreteProblem(dna_rs, u0, (0.0, tf), rates)
43+
prob = DiscreteProblem(dna_rs, u0, (0.0, tf), rates, eval_module = @__MODULE__)
4444
Nsims = 8000
4545
expected_avg = 5.926553750000000e+02
4646
prob_data = Dict("num_sims_for_mean" => Nsims, "expected_mean" => expected_avg)
@@ -56,7 +56,7 @@ end k1 k2
5656
rates = [1000.0, 10.0]
5757
tf = 1.0
5858
u0 = [0]
59-
prob = DiscreteProblem(bd_rs, u0, (0.0, tf), rates)
59+
prob = DiscreteProblem(bd_rs, u0, (0.0, tf), rates, eval_module = @__MODULE__)
6060
Nsims = 16000
6161
expected_avg = t -> rates[1] / rates[2] .* (1.0 - exp.(-rates[2] * t))
6262
prob_data = Dict("num_sims_for_mean" => Nsims, "expected_mean_at_t" => expected_avg)
@@ -75,7 +75,7 @@ end k1 k2 k3 k4 k5
7575
rates = [1.0, 2.0, 0.5, 0.75, 0.25]
7676
tf = 0.01
7777
u0 = [200, 100, 150]
78-
prob = DiscreteProblem(nonlin_rs, u0, (0.0, tf), rates)
78+
prob = DiscreteProblem(nonlin_rs, u0, (0.0, tf), rates, eval_module = @__MODULE__)
7979
Nsims = 32000
8080
expected_avg = 84.876015624999994
8181
prob_data = Dict("num_sims_for_mean" => Nsims, "expected_mean" => expected_avg)
@@ -98,7 +98,7 @@ oscil_rs = @reaction_network begin
9898
end
9999
u0 = [200.0, 60.0, 120.0, 100.0, 50.0, 50.0, 50.0] # Hill equations force use of floats!
100100
tf = 4000.0
101-
prob = DiscreteProblem(oscil_rs, u0, (0.0, tf))
101+
prob = DiscreteProblem(oscil_rs, u0, (0.0, tf), eval_module = @__MODULE__)
102102
"""
103103
Oscillatory system, uses a mixture of jump types.
104104
"""
@@ -144,7 +144,7 @@ u0[findfirst(isequal(:S1), statesyms)] = params[1]
144144
u0[findfirst(isequal(:S2), statesyms)] = params[2]
145145
u0[findfirst(isequal(:S3), statesyms)] = params[3]
146146
tf = 100.0
147-
prob = DiscreteProblem(rs, u0, (0.0, tf), rates)
147+
prob = DiscreteProblem(rs, u0, (0.0, tf), rates, eval_module = @__MODULE__)
148148
"""
149149
Multistate model from Gupta and Mendes,
150150
"An Overview of Network-Based and -Free Approaches for Stochastic Simulation of Biochemical Systems",
@@ -206,7 +206,7 @@ for i in 1:(2 * N)
206206
u0[findfirst(isequal(G[i]), states(rs))] = 1
207207
end
208208
tf = 2000.0
209-
prob = DiscreteProblem(rs, u0, (0.0, tf))
209+
prob = DiscreteProblem(rs, u0, (0.0, tf), eval_module = @__MODULE__)
210210
"""
211211
Twenty-gene model from McCollum et al,
212212
"The sorting direct method for stochastic simulation of biochemical systems with varying reaction execution behavior"
@@ -228,7 +228,7 @@ rnpar = [0.09, 0.05, 0.001, 0.0009, 0.00001, 0.0005, 0.005, 0.9]
228228
varlabels = ["G", "M", "P", "P2", "P2G"]
229229
u0 = [1000, 0, 0, 0, 0]
230230
tf = 4000.0
231-
prob = DiscreteProblem(rn, u0, (0.0, tf), rnpar)
231+
prob = DiscreteProblem(rn, u0, (0.0, tf), rnpar, eval_module = @__MODULE__)
232232
"""
233233
Negative feedback autoregulatory gene expression model. Dimer is the repressor.
234234
Taken from Marchetti, Priami and Thanh,

lib/ODEProblemLibrary/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ODEProblemLibrary"
22
uuid = "fdc4e326-1af4-4b90-96e7-779fcce2daa5"
3-
version = "0.1.1"
3+
version = "0.1.2"
44

55
[deps]
66
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"

lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ D = Differential(t)
5555
eqs = [D(y) ~ μ * ((1 - x^2) * y - x),
5656
D(x) ~ y]
5757
de = ODESystem(eqs; name = :van_der_pol)
58-
van = ODEFunction(de, [y, x], [μ], jac = true)
58+
van = ODEFunction(de, [y, x], [μ], jac = true, eval_module = @__MODULE__)
5959

6060
"""
6161
Van der Pol Equations
@@ -97,7 +97,7 @@ eqs = [D(y₁) ~ -k₁ * y₁ + k₃ * y₂ * y₃,
9797
D(y₂) ~ k₁ * y₁ - k₂ * y₂^2 - k₃ * y₂ * y₃,
9898
D(y₃) ~ k₂ * y₂^2]
9999
de = ODESystem(eqs; name = :rober)
100-
rober = ODEFunction(de, [y₁, y₂, y₃], [k₁, k₂, k₃], jac = true)
100+
rober = ODEFunction(de, [y₁, y₂, y₃], [k₁, k₂, k₃], jac = true, eval_module = @__MODULE__)
101101

102102
"""
103103
The Robertson biochemical reactions: (Stiff)
@@ -178,7 +178,7 @@ eqs = [D(y₁) ~ I₁ * y₂ * y₃,
178178
D(y₂) ~ I₂ * y₁ * y₃,
179179
D(y₃) ~ I₃ * y₁ * y₂]
180180
de = ODESystem(eqs; name = :rigid_body)
181-
rigid = ODEFunction(de, [y₁, y₂, y₃], [I₁, I₂, I₃], jac = true)
181+
rigid = ODEFunction(de, [y₁, y₂, y₃], [I₁, I₂, I₃], jac = true, eval_module = @__MODULE__)
182182

183183
"""
184184
Rigid Body Equations (Non-stiff)
@@ -372,7 +372,7 @@ u0[8] = 0.0057
372372
"""
373373
Hires Problem (Stiff)
374374
375-
It is in the form of
375+
It is in the form of
376376
377377
```math
378378
\\frac{dy}{dt} = f(y)
@@ -388,7 +388,7 @@ where ``f`` is defined by
388388
389389
``f(y) = \\begin{pmatrix} −1.71y_1 & +0.43y_2 & +8.32y_3 & +0.0007y_4 & \\\\ 1.71y_1 & −8.75y_2 & & & \\\\ −10.03y_3 & +0.43y_4 & +0.035y_5 & & \\\\ 8.32y_2 & +1.71y_3 & −1.12y_4 & & \\\\ −1.745y_5 & +0.43y_6 & +0.43y_7 & & \\\\ −280y_6y_8 & +0.69y_4 & +1.71y_5 & −0.43y_6 & +0.69y_7 \\\\ 280y_6y_8 & −1.81y_7 & & & \\\\ −280y_6y_8 & +1.81y_7 & & & \\end{pmatrix}``
390390
391-
Reference: [demohires.pdf](http://www.radford.edu/~thompson/vodef90web/problems/demosnodislin/Demos_Pitagora/DemoHires/demohires.pdf)
391+
Reference: [demohires.pdf](http://www.radford.edu/~thompson/vodef90web/problems/demosnodislin/Demos_Pitagora/DemoHires/demohires.pdf)
392392
Notebook: [Hires.ipynb](http://nbviewer.jupyter.org/github/JuliaDiffEq/DiffEqBenchmarks.jl/blob/master/StiffODE/Hires.ipynb)
393393
"""
394394
prob_ode_hires = ODEProblem(hires, u0, (0.0, 321.8122),
@@ -404,7 +404,7 @@ eqs = [D(y1) ~ p1 * (y2 + y1 * (1 - p2 * y1 - y2)),
404404
D(y3) ~ p3 * (y1 - y3)]
405405
de = ODESystem(eqs; name = :orego)
406406
jac = calculate_jacobian(de)
407-
orego = ODEFunction(de, [y1, y2, y3], [p1, p2, p3], jac = true)
407+
orego = ODEFunction(de, [y1, y2, y3], [p1, p2, p3], jac = true, eval_module = @__MODULE__)
408408

409409
"""
410410
Orego Problem (Stiff)

lib/SDEProblemLibrary/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "SDEProblemLibrary"
22
uuid = "c72e72a9-a271-4b2b-8966-303ed956772e"
3-
version = "0.1.1"
3+
version = "0.1.2"
44

55
[deps]
66
Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83"

lib/SDEProblemLibrary/src/SDEProblemLibrary.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,6 @@ p = (0.01, 3.0, 3.0, 4.5, 2.0, 15.0, 20.0, 0.005, 0.01, 0.05)
506506
An oscillatory chemical reaction system
507507
"""
508508
prob_sde_oscilreact = SDEProblem(network, [200.0, 60.0, 120.0, 100.0, 50.0, 50.0, 50.0],
509-
(0.0, 4000.0), p)
509+
(0.0, 4000.0), p, eval_module = @__MODULE__)
510510

511511
end # module

0 commit comments

Comments
 (0)