Skip to content

Commit 9e2240f

Browse files
committed
fix doc issue
1 parent 2c1a46f commit 9e2240f

File tree

8 files changed

+23
-10
lines changed

8 files changed

+23
-10
lines changed

docs/src/model_creation/dsl_advanced.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Sometimes, one wishes to declare a large number of similar parameters or species
256256
using Catalyst # hide
257257
two_state_model = @reaction_network begin
258258
@parameters k[1:2]
259-
@species X(t)[1:2]
259+
@species (X(t))[1:2]
260260
(k[1],k[2]), X[1] <--> X[2]
261261
end
262262
```

docs/src/model_creation/examples/programmatic_generative_linear_pathway.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ t = default_t()
8484
@parameters τ
8585
function generate_lp(n)
8686
# Creates a vector `X` with n+1 species.
87-
@species X(t)[1:n+1]
87+
@species (X(t))[1:n+1]
8888
@species Xend(t)
8989
9090
# Generate

docs/src/model_creation/examples/smoluchowski_coagulation_equation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ for n = 1:nr
9898
[1, 1], [1]))
9999
end
100100
end
101-
@named rs = ReactionSystem(rx, t, collect(X), collect(k))
101+
@named rs = ReactionSystem(rx, t, collect(X), [k])
102102
rs = complete(rs)
103103
```
104104
We now convert the [`ReactionSystem`](@ref) into a `ModelingToolkit.JumpSystem`, and solve it using Gillespie's direct method. For details on other possible solvers (SSAs), see the [DifferentialEquations.jl](https://docs.sciml.ai/DiffEqDocs/stable/types/jump_types/) documentation

src/reactionsystem.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,8 @@ function make_ReactionSystem_internal(rxs_and_eqs::Vector, iv, us_in, ps_in;
502502

503503
# Initialises the new unknowns and parameter vectors.
504504
# Preallocates the `vars` set, which is used by `findvars!`
505-
us = OrderedSet{eltype(us_in)}(us_in)
506-
ps = OrderedSet{eltype(ps_in)}(ps_in)
505+
us = OrderedSet{Any}(us_in)
506+
ps = OrderedSet{Any}(ps_in)
507507
vars = OrderedSet()
508508

509509
# Extracts the reactions and equations from the combined reactions + equations input vector.

test/dsl/dsl_advanced_model_construction.jl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,23 @@ let
340340
k[1]*a+k[2], X[1] + V[1]*X[2] --> V[2]*W*Y + B*C
341341
end
342342

343-
@parameters k[1:3] a B
343+
@parameters k[1:2] a B
344344
@variables (V(t))[1:2] W(t)
345345
@species (X(t))[1:2] Y(t) C(t)
346346
rx = Reaction(k[1]*a+k[2], [X[1], X[2]], [Y, C], [1, V[1]], [V[2] * W, B])
347347
@named arrtest = ReactionSystem([rx], t)
348-
arrtest == rn
348+
@test arrtest == rn
349+
350+
rn = @reaction_network twostate begin
351+
@parameters k[1:2]
352+
@species (X(t))[1:2]
353+
(k[1],k[2]), X[1] <--> X[2]
354+
end
355+
356+
@parameters k[1:2]
357+
@species (X(t))[1:2]
358+
rx1 = Reaction(k[1], [X[1]], [X[2]])
359+
rx2 = Reaction(k[2], [X[2]], [X[1]])
360+
@named twostate = ReactionSystem([rx1, rx2], t)
361+
@test twostate == rn
349362
end

test/network_analysis/conservation_laws.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ end
343343
let
344344
# Prepares the model.
345345
t = default_t()
346-
@species X(t)[1:2]
346+
@species (X(t))[1:2]
347347
@parameters k[1:2]
348348
rxs = [
349349
Reaction(k[1], [X[1]], [X[2]]),

test/reactionsystem_core/reactionsystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ end
391391
# Needs fix for https://github.com/JuliaSymbolics/Symbolics.jl/issues/842.
392392
let
393393
@parameters a
394-
@species A(t) B(t) C(t)[1:2]
394+
@species A(t) B(t) (C(t))[1:2]
395395
rx1 = Reaction(a, [A, C[1]], [C[2], B], [1, 2], [2, 3])
396396
io = IOBuffer()
397397
show(io, rx1)

test/upstream/mtk_problem_inputs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ end
180180
begin
181181
# Declares the model (with vector species/parameters, with/without default values, and observables).
182182
t = default_t()
183-
@species X(t)[1:2] Y(t)[1:2] = [10.0, 20.0] XY(t)[1:2]
183+
@species (X(t))[1:2] (Y(t))[1:2] = [10.0, 20.0] (XY(t))[1:2]
184184
@parameters p[1:2] d[1:2] = [0.2, 0.5]
185185
rxs = [
186186
Reaction(p[1], [], [X[1]]),

0 commit comments

Comments
 (0)