Skip to content

Commit 37215a9

Browse files
committed
revert lattice reaction system changes
1 parent 730dbc0 commit 37215a9

File tree

3 files changed

+35
-16
lines changed

3 files changed

+35
-16
lines changed

src/spatial_reaction_systems/lattice_reaction_systems.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ struct LatticeReactionSystem{S,T} # <: MT.AbstractTimeDependentSystem
2525
All parameters related to the lattice reaction system
2626
(both with spatial and non-spatial effects).
2727
"""
28-
parameters::Vector{Any}
28+
parameters::Vector{BasicSymbolic{Real}}
2929
"""
3030
Parameters which values are tied to vertexes (adjacencies),
3131
e.g. (possibly) have an unique value at each vertex of the system.
3232
"""
33-
vertex_parameters::Vector{Any}
33+
vertex_parameters::Vector{BasicSymbolic{Real}}
3434
"""
3535
Parameters which values are tied to edges (adjacencies),
3636
e.g. (possibly) have an unique value at each edge of the system.
3737
"""
38-
edge_parameters::Vector{Any}
38+
edge_parameters::Vector{BasicSymbolic{Real}}
3939

4040
function LatticeReactionSystem(rs::ReactionSystem{S}, spatial_reactions::Vector{T},
4141
lattice::DiGraph; init_digraph = true) where {S, T}
@@ -52,7 +52,7 @@ struct LatticeReactionSystem{S,T} # <: MT.AbstractTimeDependentSystem
5252
num_species = length(unique([species(rs); spat_species]))
5353
rs_edge_parameters = filter(isedgeparameter, parameters(rs))
5454
if isempty(spatial_reactions)
55-
srs_edge_parameters = Vector{Any}[]
55+
srs_edge_parameters = Vector{BasicSymbolic{Real}}[]
5656
else
5757
srs_edge_parameters = setdiff(reduce(vcat, [parameters(sr) for sr in spatial_reactions]), parameters(rs))
5858
end

test/runtests.jl

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ using SafeTestsets
44
### Run the tests ###
55
@time begin
66

7+
### Tests the properties of ReactionSystems. ###
8+
@time @safetestset "Reactions" begin include("reactionsystem_structure/reactions.jl") end
9+
@time @safetestset "ReactionSystem" begin include("reactionsystem_structure/reactionsystem.jl") end
10+
@time @safetestset "Higher Order Reactions" begin include("reactionsystem_structure/higher_order_reactions.jl") end
11+
12+
### Tests model creation via the @reaction_network DSL. ###
13+
@time @safetestset "Basic DSL" begin include("dsl/dsl_basics.jl") end
14+
@time @safetestset "DSL Model Construction" begin include("dsl/dsl_model_construction.jl") end
15+
@time @safetestset "Custom CRN Functions" begin include("dsl/custom_functions.jl") end
16+
@time @safetestset "DSL Options" begin include("dsl/dsl_options.jl") end
17+
18+
### Non-DSL model creation and modification. ###
19+
@time @safetestset "ReactionSystem Components Based Creation" begin include("programmatic_model_creation/component_based_model_creation.jl") end
20+
@time @safetestset "Programmatic Model Expansion" begin include("programmatic_model_creation/programmatic_model_expansion.jl") end
21+
22+
# Runs various miscellaneous tests.
23+
@time @safetestset "API" begin include("miscellaneous_tests/api.jl") end
724
@time @safetestset "Symbolic Stoichiometry" begin include("miscellaneous_tests/symbolic_stoichiometry.jl") end
825
@time @safetestset "NonlinearProblems and Steady State Solving" begin include("miscellaneous_tests/nonlinear_solve.jl") end
926
@time @safetestset "Events" begin include("miscellaneous_tests/events.jl") end
@@ -25,8 +42,7 @@ using SafeTestsets
2542
### Tests Spatial Network Simulations. ###
2643
@time @safetestset "PDE Systems Simulations" begin include("spatial_reaction_systems/simulate_PDEs.jl") end
2744
@time @safetestset "Lattice Reaction Systems" begin include("spatial_reaction_systems/lattice_reaction_systems.jl") end
28-
# Requires internal rework due to permitting non-default parameter types. However, rework have already been carried out in a separate branch.
29-
# @time @safetestset "ODE Lattice Systems Simulations" begin include("spatial_reaction_systems/lattice_reaction_systems_ODEs.jl") end
45+
@time @safetestset "ODE Lattice Systems Simulations" begin include("spatial_reaction_systems/lattice_reaction_systems_ODEs.jl") end
3046

3147
### Tests network visualization. ###
3248
@time @safetestset "Latexify" begin include("visualization/latexify.jl") end

test/spatial_reaction_systems/lattice_reaction_systems.jl

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,12 @@ let
275275
@test_throws ErrorException LatticeReactionSystem(rs, [tr], grid)
276276
end
277277

278+
278279
### Test Designation of Parameter Types ###
280+
# Currently not supported. Won't be until the LatticeReactionSystem internal update is merged.
279281

280282
# Checks that parameter types designated in the non-spatial `ReactionSystem` is handled correctly.
281-
let
283+
@test_broken let
282284
# Declares LatticeReactionSystem with designated parameter types.
283285
rs = @reaction_network begin
284286
@parameters begin
@@ -326,7 +328,7 @@ end
326328

327329
# Checks that programmatically declared parameters (with types) can be used in `TransportReaction`s.
328330
# Checks that LatticeReactionSystem with non-default parameter types can be simulated.
329-
let
331+
@test_broken let
330332
rs = @reaction_network begin
331333
@parameters p::Float32
332334
(p,d), 0 <--> X
@@ -354,11 +356,12 @@ end
354356

355357
# Tests that LatticeReactionSystem cannot be generated where transport reactions depend on parameters
356358
# that have a type designated in the non-spatial `ReactionSystem`.
357-
let
358-
rs = @reaction_network begin
359-
@parameters D::Int64
360-
(p,d), 0 <--> X
361-
end
362-
tr = @transport_reaction D X
363-
@test_throws Exception LatticeReactionSystem(rs, tr, grid)
364-
end
359+
@test_broken false
360+
# let
361+
# rs = @reaction_network begin
362+
# @parameters D::Int64
363+
# (p,d), 0 <--> X
364+
# end
365+
# tr = @transport_reaction D X
366+
# @test_throws Exception LatticeReactionSystem(rs, tr, grid)
367+
# end

0 commit comments

Comments
 (0)