Skip to content

Commit d156fad

Browse files
Merge pull request #72 from SciML/massinstallaction/set-up-GitHubActionsCI
MassInstallAction: Install the GitHubActionsCI workflow on this repository
2 parents f971d5a + 371003b commit d156fad

File tree

6 files changed

+66
-102
lines changed

6 files changed

+66
-102
lines changed

.github/workflows/CI.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
push:
7+
branches:
8+
- master
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: julia-actions/setup-julia@v1
15+
with:
16+
version: 1
17+
- uses: actions/cache@v1
18+
env:
19+
cache-name: cache-artifacts
20+
with:
21+
path: ~/.julia/artifacts
22+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
23+
restore-keys: |
24+
${{ runner.os }}-test-${{ env.cache-name }}-
25+
${{ runner.os }}-test-
26+
${{ runner.os }}-
27+
- uses: julia-actions/julia-buildpkg@v1
28+
- uses: julia-actions/julia-runtest@v1
29+
- uses: julia-actions/julia-processcoverage@v1
30+
- uses: codecov/codecov-action@v1
31+
with:
32+
file: lcov.info

.travis.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1616
Catalyst = "5.1, 6.0"
1717
DiffEqBase = "6"
1818
DiffEqOperators = "4"
19-
ModelingToolkit = "0.9, 0.10, 1.0, 2.0, 3.0, 4.0"
19+
ModelingToolkit = "4"
2020
julia = "1"
2121

2222
[extras]

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# DiffEqProblemLibrary.jl
22

33
[![Join the chat at https://gitter.im/JuliaDiffEq/Lobby](https://badges.gitter.im/JuliaDiffEq/Lobby.svg)](https://gitter.im/JuliaDiffEq/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4-
[![Build Status](https://travis-ci.com/SciML/DiffEqProblemLibrary.jl.svg?branch=master)](https://travis-ci.com/SciML/DiffEqProblemLibrary.jl)
5-
[![Build status](https://ci.appveyor.com/api/projects/status/eampqfcm4c3b2ad9?svg=true)](https://ci.appveyor.com/project/ChrisRackauckas/diffeqproblemlibrary-jl)
4+
[![Build Status](https://github.com/SciML/DiffEqProblemLibrary.jl/workflows/CI/badge.svg)](https://github.com/SciML/DiffEqProblemLibrary.jl/actions?query=workflow%3ACI)
65

76
DiffEqProblemLibrary.jl is a component package in the DifferentialEquations ecosystem. It premade
87
problems for the differential equations solvers. These can either be used as tests

appveyor.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/jump_premade_problems.jl

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ end kon kAon koff kAoff kAp kAdp
137137
rsi = rates_sym_to_idx
138138
rates = params[[rsi[:kon], rsi[:kAon], rsi[:koff], rsi[:kAoff], rsi[:kAp], rsi[:kAdp]]]
139139
u0 = zeros(Int,9)
140-
u0[ findfirst(isequal(Variable(:S1)), rs.states)] = params[1]
141-
u0[ findfirst(isequal(Variable(:S2)), rs.states)] = params[2]
142-
u0[ findfirst(isequal(Variable(:S3)), rs.states)] = params[3]
140+
statesyms = ModelingToolkit.tosymbol.(ModelingToolkit.operation.(rs.states))
141+
u0[ findfirst(isequal(:S1), statesyms)] = params[1]
142+
u0[ findfirst(isequal(:S2), statesyms)] = params[2]
143+
u0[ findfirst(isequal(:S3), statesyms)] = params[3]
143144
tf = 100.
144145
prob = DiscreteProblem(rs, u0, (0., tf), rates)
145146
"""
@@ -154,53 +155,49 @@ prob_jump_multistate = JumpProblemNetwork(rs, rates, tf, u0, prob,
154155

155156
# generate the network
156157
N = 10 # number of genes
158+
@parameters t
159+
@variables G[1:2N](t) M[1:2N](t) P[1:2N](t) G_ind[1:2N](t)
160+
157161
function construct_genenetwork(N)
158-
genenetwork = make_empty_network()
159-
@parameters t
162+
genenetwork = make_empty_network()
160163
for i in 1:N
161-
G₂ᵢ₋₁ = Variable(Symbol("G",2*i-1))(t)
162-
M₂ᵢ₋₁ = Variable(Symbol("M",2*i-1))(t)
163-
P₂ᵢ₋₁ = Variable(Symbol("P",2*i-1))(t)
164-
addspecies!(genenetwork,G₂ᵢ₋₁)
165-
addspecies!(genenetwork,M₂ᵢ₋₁)
166-
addspecies!(genenetwork,P₂ᵢ₋₁)
167-
addreaction!(genenetwork, Reaction(10.0, [G₂ᵢ₋₁], [G₂ᵢ₋₁,M₂ᵢ₋₁]))
168-
addreaction!(genenetwork, Reaction(10.0, [M₂ᵢ₋₁], [M₂ᵢ₋₁,P₂ᵢ₋₁]))
169-
addreaction!(genenetwork, Reaction(1.0, [M₂ᵢ₋₁], nothing))
170-
addreaction!(genenetwork, Reaction(1.0, [P₂ᵢ₋₁], nothing))
164+
addspecies!(genenetwork,G[2*i-1])
165+
addspecies!(genenetwork,M[2*i-i])
166+
addspecies!(genenetwork,P[2*i-i])
167+
addreaction!(genenetwork, Reaction(10.0, [G[2*i-i]], [G[2*i-i],M[2*i-i]]))
168+
addreaction!(genenetwork, Reaction(10.0, [M[2*i-i]], [M[2*i-i],P[2*i-i]]))
169+
addreaction!(genenetwork, Reaction(1.0, [M[2*i-i]], nothing))
170+
addreaction!(genenetwork, Reaction(1.0, [P[2*i-i]], nothing))
171171
# genenetwork *= "\t 10.0, G$(2*i-1) --> G$(2*i-1) + M$(2*i-1)\n"
172172
# genenetwork *= "\t 10.0, M$(2*i-1) --> M$(2*i-1) + P$(2*i-1)\n"
173173
# genenetwork *= "\t 1.0, M$(2*i-1) --> 0\n"
174174
# genenetwork *= "\t 1.0, P$(2*i-1) --> 0\n"
175175

176-
G₂ᵢ = Variable(Symbol("G",2*i))(t)
177-
M₂ᵢ = Variable(Symbol("M",2*i))(t)
178-
P₂ᵢ = Variable(Symbol("P",2*i))(t)
179-
addspecies!(genenetwork,G₂ᵢ)
180-
addspecies!(genenetwork,M₂ᵢ)
181-
addspecies!(genenetwork,P₂ᵢ)
182-
addreaction!(genenetwork, Reaction(5.0, [G₂ᵢ], [G₂ᵢ,M₂ᵢ]))
183-
addreaction!(genenetwork, Reaction(5.0, [M₂ᵢ], [M₂ᵢ,P₂ᵢ]))
184-
addreaction!(genenetwork, Reaction(1.0, [M₂ᵢ], nothing))
185-
addreaction!(genenetwork, Reaction(1.0, [P₂ᵢ], nothing))
176+
addspecies!(genenetwork,G[2*i])
177+
addspecies!(genenetwork,M[2*i])
178+
addspecies!(genenetwork,P[2*i])
179+
addreaction!(genenetwork, Reaction(5.0, [G[2*i]], [G[2*i],M[2*i]]))
180+
addreaction!(genenetwork, Reaction(5.0, [M[2*i]], [M[2*i],P[2*i]]))
181+
addreaction!(genenetwork, Reaction(1.0, [M[2*i]], nothing))
182+
addreaction!(genenetwork, Reaction(1.0, [P[2*i]], nothing))
186183
# genenetwork *= "\t 5.0, G$(2*i) --> G$(2*i) + M$(2*i)\n"
187184
# genenetwork *= "\t 5.0, M$(2*i) --> M$(2*i) + P$(2*i)\n"
188185
# genenetwork *= "\t 1.0, M$(2*i) --> 0\n"
189186
# genenetwork *= "\t 1.0, P$(2*i) --> 0\n"
190187

191-
G₂ᵢ_ind = Variable(Symbol("G",2*i,"_ind"))(t)
192-
addspecies!(genenetwork, G₂ᵢ_ind)
193-
addreaction!(genenetwork, Reaction(0.0001, [G₂ᵢ,P₂ᵢ₋₁], [G₂ᵢ_ind]))
194-
addreaction!(genenetwork, Reaction(100.0, [G₂ᵢ_ind], [G₂ᵢ_ind,M₂ᵢ]))
188+
addspecies!(genenetwork, G_ind[2*i])
189+
addreaction!(genenetwork, Reaction(0.0001, [G[2*i],P[2*i-i]], [G_ind[2*i]]))
190+
addreaction!(genenetwork, Reaction(100.0, [G_ind[2*i]], [G_ind[2*i],M[2*i]]))
195191
# genenetwork *= "\t 0.0001, G$(2*i) + P$(2*i-1) --> G$(2*i)_ind \n"
196192
# genenetwork *= "\t 100., G$(2*i)_ind --> G$(2*i)_ind + M$(2*i)\n"
197193
end
198194
genenetwork
199195
end
200196
rs = construct_genenetwork(N)
201197
u0 = zeros(Int, length(rs.states))
198+
statesyms = ModelingToolkit.tosymbol.(ModelingToolkit.operation.(rs.states))
202199
for i = 1:(2*N)
203-
u0[findfirst(isequal(Variable(Symbol("G$(i)"))),rs.states)] = 1
200+
u0[findfirst(isequal(G[i]),rs.states)] = 1
204201
end
205202
tf = 2000.0
206203
prob = DiscreteProblem(rs, u0, (0.0, tf))
@@ -238,16 +235,15 @@ prob_jump_dnadimer_repressor = JumpProblemNetwork(rn, rnpar, tf, u0, prob,
238235

239236
# diffusion model
240237
function getDiffNetwork(N)
241-
diffnetwork = make_empty_network()
238+
diffnetwork = make_empty_network()
242239
@parameters t K
240+
@variables X[1:N](t)
243241
for i = 1:N
244-
addspecies!(diffnetwork, Variable("X",i)(t))
242+
addspecies!(diffnetwork, X[i])
245243
end
246244
for i in 1:(N-1)
247-
Xᵢ = Variable("X",i)(t)
248-
Xᵢ₊₁ = Variable("X",i+1)(t)
249-
addreaction!(diffnetwork, Reaction(K, [Xᵢ], [Xᵢ₊₁]))
250-
addreaction!(diffnetwork, Reaction(K, [Xᵢ₊₁], [Xᵢ]))
245+
addreaction!(diffnetwork, Reaction(K, [X[i]], [X[i+1]]))
246+
addreaction!(diffnetwork, Reaction(K, [X[i+1]], [X[i]]))
251247
end
252248
diffnetwork
253249
end

0 commit comments

Comments
 (0)