From f32d74ca68b6a37c6e1e5b17256e78fc9f581464 Mon Sep 17 00:00:00 2001 From: agchesebro <76024790+agchesebro@users.noreply.github.com> Date: Mon, 15 Jan 2024 09:22:33 -0500 Subject: [PATCH] Remove old component tests * Deleted `jansen_rit_component_tests.jl`. * Renamed `jansen_rit_component_tests_new_timing.jl` to `jansen_rit_component_tests.jl` (removing old examples in favor of updated blocks with ms timing defaults). * Deleted `temp_test.jl` * Deleted `jansen_rit_hemodynamic_tests.jl` * Deleted `test/old_component_tests/*`. These were all old neural mass model tests from pre-`BloxConnector` days that I kept around just in case. Seem redundant now. * @hstrey I think `test/ode_from_graph.jl` can be deleted - looks like old Jansen Rit code that we've incorporated elsewhere or removed entirely. --- test/jansen_rit_component_tests.jl | 60 ++++----- test/jansen_rit_component_tests_new_timing.jl | 126 ------------------ test/jansen_rit_hemodynamic_tests.jl | 43 ------ test/old_component_tests/jansen_rit_tests.jl | 79 ----------- .../larter_breakspear_tests.jl | 21 --- .../old_component_tests/wilson_cowan_tests.jl | 21 --- test/temp_test.jl | 17 --- 7 files changed, 28 insertions(+), 339 deletions(-) delete mode 100644 test/jansen_rit_component_tests_new_timing.jl delete mode 100644 test/jansen_rit_hemodynamic_tests.jl delete mode 100644 test/old_component_tests/jansen_rit_tests.jl delete mode 100644 test/old_component_tests/larter_breakspear_tests.jl delete mode 100644 test/old_component_tests/wilson_cowan_tests.jl delete mode 100644 test/temp_test.jl diff --git a/test/jansen_rit_component_tests.jl b/test/jansen_rit_component_tests.jl index 8f77e5c0..a809737a 100644 --- a/test/jansen_rit_component_tests.jl +++ b/test/jansen_rit_component_tests.jl @@ -1,23 +1,19 @@ -""" -DEPRECATED - -This file uses the old blocks before timing update to be consistent. Use jansen_rit_component_tests_new_timing.jl instead. -""" - using Neuroblox, DifferentialEquations, DataFrames, Test, Distributions, Statistics, LinearAlgebra, Graphs, MetaGraphs, Random +τ_factor = 1000 #needed because the old units were in seconds, and we need ms to be consistent + # Create Regions -@named Str = jansen_ritC(τ=0.0022, H=20, λ=300, r=0.3) -@named GPe = jansen_ritC(τ=0.04, H=20, λ=400, r=0.1) -@named STN = jansen_ritC(τ=0.01, H=20, λ=500, r=0.1) -@named GPi = jansen_ritSC(τ=0.014, H=20, λ=400, r=0.1) -@named Th = jansen_ritSC(τ=0.002, H=10, λ=20, r=5) -@named EI = jansen_ritSC(τ=0.01, H=20, λ=5, r=5) -@named PY = jansen_ritSC(τ=0.001, H=20, λ=5, r=0.15) -@named II = jansen_ritSC(τ=2.0, H=60, λ=5, r=5) +@named Str = jansen_ritC(τ=0.0022*τ_factor, H=20, λ=300, r=0.3) +@named gpe = jansen_ritC(τ=0.04*τ_factor, H=20, λ=400, r=0.1) +@named stn = jansen_ritC(τ=0.01*τ_factor, H=20, λ=500, r=0.1) +@named gpi = jansen_ritSC(τ=0.014*τ_factor, H=20, λ=400, r=0.1) +@named Th = jansen_ritSC(τ=0.002*τ_factor, H=10, λ=20, r=5) +@named EI = jansen_ritSC(τ=0.01*τ_factor, H=20, λ=5, r=5) +@named PY = jansen_ritSC(τ=0.001*τ_factor, H=20, λ=5, r=0.15) +@named II = jansen_ritSC(τ=2.0*τ_factor, H=60, λ=5, r=5) # Connect Regions through Adjacency Matrix -blox = [Str, GPe, STN, GPi, Th, EI, PY, II] +blox = [Str, gpe, stn, gpi, Th, EI, PY, II] sys = [s.odesystem for s in blox] connect = [s.connector for s in blox] @@ -34,10 +30,10 @@ adj_matrix_lin = [0 0 0 0 0 0 0 0; @named CBGTC_Circuit_lin = LinearConnections(sys=sys, adj_matrix=adj_matrix_lin, connector=connect) -sim_dur = 10.0 # Simulate for 10 Seconds +sim_dur = 2000.0 # Simulate for 2 seconds mysys = structural_simplify(CBGTC_Circuit_lin) -sol = simulate(mysys, [], (0.0, sim_dur), [], Vern7(); saveat=0.001) -@test sol[!, "GPi₊x(t)"][4] ≈ -0.48421810231972134 +sol = simulate(mysys, [], (0.0, sim_dur), [], Vern7(); saveat=1) +@test sol[!, "gpi₊x(t)"][4] ≈ -2219.2560209502685 #updated to new value in ms """ Testing new Jansen-Rit blox @@ -50,15 +46,15 @@ same thing as the old simulate call with AutoVern7(Rodas4() since there are no d """ # test new Jansen-Rit blox -@named Str = JansenRit(τ=0.0022, H=20, λ=300, r=0.3) -@named GPe = JansenRit(τ=0.04, cortical=false) # all default subcortical except τ -@named STN = JansenRit(τ=0.01, H=20, λ=500, r=0.1) -@named GPi = JansenRit(cortical=false) # default parameters subcortical Jansen Rit blox -@named Th = JansenRit(τ=0.002, H=10, λ=20, r=5) -@named EI = JansenRit(τ=0.01, H=20, λ=5, r=5) +@named Str = JansenRit(τ=0.0022*τ_factor, H=20, λ=300, r=0.3) +@named gpe = JansenRit(τ=0.04*τ_factor, cortical=false) # all default subcortical except τ +@named stn = JansenRit(τ=0.01*τ_factor, H=20, λ=500, r=0.1) +@named gpi = JansenRit(cortical=false) # default parameters subcortical Jansen Rit blox +@named Th = JansenRit(τ=0.002*τ_factor, H=10, λ=20, r=5) +@named EI = JansenRit(τ=0.01*τ_factor, H=20, λ=5, r=5) @named PY = JansenRit(cortical=true) # default parameters cortical Jansen Rit blox -@named II = JansenRit(τ=2.0, H=60, λ=5, r=5) -blox = [Str, GPe, STN, GPi, Th, EI, PY, II] +@named II = JansenRit(τ=2.0*τ_factor, H=60, λ=5, r=5) +blox = [Str, gpe, stn, gpi, Th, EI, PY, II] # test graphs g = MetaDiGraph() @@ -99,16 +95,16 @@ add_edge!(g, 8, 8, Dict(:weight => 3.3*C_Cor)) @named final_system = system_from_graph(g, params) final_delays = graph_delays(g) -sim_dur = 10.0 # Simulate for 10 Seconds +sim_dur = 2000.0 # Simulate for 2 Seconds final_system_sys = structural_simplify(final_system) prob = DDEProblem(final_system_sys, [], (0.0, sim_dur), constant_lags = final_delays) alg = MethodOfSteps(Vern7()) -sol_dde_no_delays = solve(prob, alg, saveat=0.001) +sol_dde_no_delays = solve(prob, alg, saveat=1) sol2 = DataFrame(sol_dde_no_delays) -@test isapprox(sol2[!, "GPi₊x(t)"][500:1000], sol[!, "GPi₊x(t)"][500:1000], rtol=1e-8) +@test isapprox(sol2[!, "gpi₊x(t)"][500:1000], sol[!, "gpi₊x(t)"][500:1000], rtol=1e-8) # Alternative version using adjacency matrix @@ -118,13 +114,13 @@ create_adjacency_edges!(g2, adj_matrix_lin) @named final_system = system_from_graph(g2, params) final_delays = graph_delays(g2) -sim_dur = 600.0 # Simulate for 10 Seconds +sim_dur = 2000.0 # Simulate for 2 Seconds final_system_sys = structural_simplify(final_system) prob = DDEProblem(final_system_sys, [], (0.0, sim_dur), constant_lags = final_delays) alg = MethodOfSteps(Vern7()) -sol_dde_no_delays = solve(prob, alg, saveat=0.001) +sol_dde_no_delays = solve(prob, alg, saveat=1) sol3 = DataFrame(sol_dde_no_delays) -@test isapprox(sol3[!, "GPi₊x(t)"][500:1000], sol[!, "GPi₊x(t)"][500:1000], rtol=1e-8) \ No newline at end of file +@test isapprox(sol3[!, "gpi₊x(t)"][500:1000], sol[!, "gpi₊x(t)"][500:1000], rtol=1e-8) \ No newline at end of file diff --git a/test/jansen_rit_component_tests_new_timing.jl b/test/jansen_rit_component_tests_new_timing.jl deleted file mode 100644 index a809737a..00000000 --- a/test/jansen_rit_component_tests_new_timing.jl +++ /dev/null @@ -1,126 +0,0 @@ -using Neuroblox, DifferentialEquations, DataFrames, Test, Distributions, Statistics, LinearAlgebra, Graphs, MetaGraphs, Random - -τ_factor = 1000 #needed because the old units were in seconds, and we need ms to be consistent - -# Create Regions -@named Str = jansen_ritC(τ=0.0022*τ_factor, H=20, λ=300, r=0.3) -@named gpe = jansen_ritC(τ=0.04*τ_factor, H=20, λ=400, r=0.1) -@named stn = jansen_ritC(τ=0.01*τ_factor, H=20, λ=500, r=0.1) -@named gpi = jansen_ritSC(τ=0.014*τ_factor, H=20, λ=400, r=0.1) -@named Th = jansen_ritSC(τ=0.002*τ_factor, H=10, λ=20, r=5) -@named EI = jansen_ritSC(τ=0.01*τ_factor, H=20, λ=5, r=5) -@named PY = jansen_ritSC(τ=0.001*τ_factor, H=20, λ=5, r=0.15) -@named II = jansen_ritSC(τ=2.0*τ_factor, H=60, λ=5, r=5) - -# Connect Regions through Adjacency Matrix -blox = [Str, gpe, stn, gpi, Th, EI, PY, II] -sys = [s.odesystem for s in blox] -connect = [s.connector for s in blox] - -@parameters C_Cor=60 C_BG_Th=60 C_Cor_BG_Th=5 C_BG_Th_Cor=5 - -adj_matrix_lin = [0 0 0 0 0 0 0 0; - -0.5*C_BG_Th -0.5*C_BG_Th C_BG_Th 0 0 0 0 0; - 0 -0.5*C_BG_Th 0 0 0 0 C_Cor_BG_Th 0; - 0 -0.5*C_BG_Th C_BG_Th 0 0 0 0 0; - 0 0 0 -0.5*C_BG_Th 0 0 0 0; - 0 0 0 0 C_BG_Th_Cor 0 6*C_Cor 0; - 0 0 0 0 0 4.8*C_Cor 0 -1.5*C_Cor; - 0 0 0 0 0 0 1.5*C_Cor 3.3*C_Cor] - -@named CBGTC_Circuit_lin = LinearConnections(sys=sys, adj_matrix=adj_matrix_lin, connector=connect) - -sim_dur = 2000.0 # Simulate for 2 seconds -mysys = structural_simplify(CBGTC_Circuit_lin) -sol = simulate(mysys, [], (0.0, sim_dur), [], Vern7(); saveat=1) -@test sol[!, "gpi₊x(t)"][4] ≈ -2219.2560209502685 #updated to new value in ms - -""" -Testing new Jansen-Rit blox - -This sets up the exact same system as above, but using the JansenRit with different flags cortical/subcortical flags. - -The purpose of this test is to make sure that setting up everything using System rather than ODESystem works as expected. -It also shows test code for the new system_from_graph calls and handling delays when everything is 0 (MethodOfSteps returns the -same thing as the old simulate call with AutoVern7(Rodas4() since there are no delays.) -""" - -# test new Jansen-Rit blox -@named Str = JansenRit(τ=0.0022*τ_factor, H=20, λ=300, r=0.3) -@named gpe = JansenRit(τ=0.04*τ_factor, cortical=false) # all default subcortical except τ -@named stn = JansenRit(τ=0.01*τ_factor, H=20, λ=500, r=0.1) -@named gpi = JansenRit(cortical=false) # default parameters subcortical Jansen Rit blox -@named Th = JansenRit(τ=0.002*τ_factor, H=10, λ=20, r=5) -@named EI = JansenRit(τ=0.01*τ_factor, H=20, λ=5, r=5) -@named PY = JansenRit(cortical=true) # default parameters cortical Jansen Rit blox -@named II = JansenRit(τ=2.0*τ_factor, H=60, λ=5, r=5) -blox = [Str, gpe, stn, gpi, Th, EI, PY, II] - -# test graphs -g = MetaDiGraph() -add_blox!.(Ref(g), blox) - -# Store parameters to be passed later on -params = @parameters C_Cor=60 C_BG_Th=60 C_Cor_BG_Th=5 C_BG_Th_Cor=5 - -add_edge!(g, 2, 1, Dict(:weight => -0.5*C_BG_Th)) -add_edge!(g, 2, 2, Dict(:weight => -0.5*C_BG_Th)) -add_edge!(g, 2, 3, Dict(:weight => C_BG_Th)) -add_edge!(g, 3, 2, Dict(:weight => -0.5*C_BG_Th)) -add_edge!(g, 3, 7, Dict(:weight => C_Cor_BG_Th)) -add_edge!(g, 4, 2, Dict(:weight => -0.5*C_BG_Th)) -add_edge!(g, 4, 3, Dict(:weight => C_BG_Th)) -add_edge!(g, 5, 4, Dict(:weight => -0.5*C_BG_Th)) -add_edge!(g, 6, 5, Dict(:weight => C_BG_Th_Cor)) -add_edge!(g, 6, 7, Dict(:weight => 6*C_Cor)) -add_edge!(g, 7, 6, Dict(:weight => 4.8*C_Cor)) -add_edge!(g, 7, 8, Dict(:weight => -1.5*C_Cor)) -add_edge!(g, 8, 7, Dict(:weight => 1.5*C_Cor)) -add_edge!(g, 8, 8, Dict(:weight => 3.3*C_Cor)) - -# add_edge!(g, 2, 1, Dict(:weight => -0.5*60, :delay => 0.01)) -# add_edge!(g, 2, 2, Dict(:weight => -0.5*60, :delay => 0.01)) -# add_edge!(g, 2, 3, Dict(:weight => 60, :delay => 0.01)) -# add_edge!(g, 3, 2, Dict(:weight => -0.5*60, :delay => 0.01)) -# add_edge!(g, 3, 7, Dict(:weight => 5, :delay => 0.01)) -# add_edge!(g, 4, 2, Dict(:weight => -0.5*60, :delay => 0.01)) -# add_edge!(g, 4, 3, Dict(:weight => 60, :delay => 0.01)) -# add_edge!(g, 5, 4, Dict(:weight => -0.5*60, :delay => 0.01)) -# add_edge!(g, 6, 5, Dict(:weight => 5, :delay => 0.01)) -# add_edge!(g, 6, 7, Dict(:weight => 6*60, :delay => 0.01)) -# add_edge!(g, 7, 6, Dict(:weight => 4.8*60, :delay => 0.01)) -# add_edge!(g, 7, 8, Dict(:weight => -1.5*60, :delay => 0.01)) -# add_edge!(g, 8, 7, Dict(:weight => 1.5*60, :delay => 0.01)) -# add_edge!(g, 8, 8, Dict(:weight => 3.3*60, :delay => 0.01)) - -@named final_system = system_from_graph(g, params) -final_delays = graph_delays(g) -sim_dur = 2000.0 # Simulate for 2 Seconds -final_system_sys = structural_simplify(final_system) -prob = DDEProblem(final_system_sys, - [], - (0.0, sim_dur), - constant_lags = final_delays) -alg = MethodOfSteps(Vern7()) -sol_dde_no_delays = solve(prob, alg, saveat=1) -sol2 = DataFrame(sol_dde_no_delays) -@test isapprox(sol2[!, "gpi₊x(t)"][500:1000], sol[!, "gpi₊x(t)"][500:1000], rtol=1e-8) - - -# Alternative version using adjacency matrix -g2 = MetaDiGraph() -add_blox!.(Ref(g2), blox) -create_adjacency_edges!(g2, adj_matrix_lin) - -@named final_system = system_from_graph(g2, params) -final_delays = graph_delays(g2) -sim_dur = 2000.0 # Simulate for 2 Seconds -final_system_sys = structural_simplify(final_system) -prob = DDEProblem(final_system_sys, - [], - (0.0, sim_dur), - constant_lags = final_delays) -alg = MethodOfSteps(Vern7()) -sol_dde_no_delays = solve(prob, alg, saveat=1) -sol3 = DataFrame(sol_dde_no_delays) -@test isapprox(sol3[!, "gpi₊x(t)"][500:1000], sol[!, "gpi₊x(t)"][500:1000], rtol=1e-8) \ No newline at end of file diff --git a/test/jansen_rit_hemodynamic_tests.jl b/test/jansen_rit_hemodynamic_tests.jl deleted file mode 100644 index 42c796e3..00000000 --- a/test/jansen_rit_hemodynamic_tests.jl +++ /dev/null @@ -1,43 +0,0 @@ -using Neuroblox, DifferentialEquations, DataFrames, Test, Distributions, Statistics, LinearAlgebra, Graphs, MetaGraphs, Random - -# Store parameters to be passed later on -params = @parameters C_Cor=60 C_BG_Th=60 C_Cor_BG_Th=5 C_BG_Th_Cor=5 - -adj_matrix_lin = [0 0 0 0 0 0 0 0 1; - -0.5*C_BG_Th -0.5*C_BG_Th C_BG_Th 0 0 0 0 0 0; - 0 -0.5*C_BG_Th 0 0 0 0 C_Cor_BG_Th 0 0; - 0 -0.5*C_BG_Th C_BG_Th 0 0 0 0 0 0; - 0 0 0 -0.5*C_BG_Th 0 0 0 0 0; - 0 0 0 0 C_BG_Th_Cor 0 6*C_Cor 0 0; - 0 0 0 0 0 4.8*C_Cor 0 -1.5*C_Cor 0; - 0 0 0 0 0 0 1.5*C_Cor 3.3*C_Cor 0; - 0 0 0 0 0 0 0 0 0] - -# test new Jansen-Rit blox -@named Str = JansenRit(τ=0.0022, H=20, λ=300, r=0.3) -@named GPe = JansenRit(τ=0.04, cortical=false) # all default subcortical except τ -@named STN = JansenRit(τ=0.01, H=20, λ=500, r=0.1) -@named GPi = JansenRit(cortical=false) # default parameters subcortical Jansen Rit blox -@named Th = JansenRit(τ=0.002, H=10, λ=20, r=5) -@named EI = JansenRit(τ=0.01, H=20, λ=5, r=5) -@named PY = JansenRit(cortical=true) # default parameters cortical Jansen Rit blox -@named II = JansenRit(τ=2.0, H=60, λ=5, r=5) -@named hemo = AlternativeBalloonModel() -blox = [Str, GPe, STN, GPi, Th, EI, PY, II, hemo] - -# Alternative version using adjacency matrix -g = MetaDiGraph() -add_blox!.(Ref(g), blox) -create_adjacency_edges!(g, adj_matrix_lin) - -@named final_system = system_from_graph(g, params) -final_delays = graph_delays(g) -sim_dur = 600.0 # Simulate for 10 Seconds -final_system_sys = structural_simplify(final_system) -prob = DDEProblem(final_system_sys, - [], - (0.0, sim_dur), - constant_lags = final_delays) -alg = MethodOfSteps(Vern7()) -sol_dde_no_delays = solve(prob, alg, saveat=0.001) -sol3 = DataFrame(sol_dde_no_delays) \ No newline at end of file diff --git a/test/old_component_tests/jansen_rit_tests.jl b/test/old_component_tests/jansen_rit_tests.jl deleted file mode 100644 index 289820aa..00000000 --- a/test/old_component_tests/jansen_rit_tests.jl +++ /dev/null @@ -1,79 +0,0 @@ -using Neuroblox, DifferentialEquations, DataFrames, Test, Distributions, Statistics, LinearAlgebra, Graphs, MetaGraphs, Random - -""" -Tests formerly in components.jl -""" -# Create Regions -@named Str = jansen_ritC(τ=0.0022, H=20, λ=300, r=0.3) -@named GPe = jansen_ritC(τ=0.04, H=20, λ=400, r=0.1) -@named STN = jansen_ritC(τ=0.01, H=20, λ=500, r=0.1) -@named GPi = jansen_ritSC(τ=0.014, H=20, λ=400, r=0.1) -@named Th = jansen_ritSC(τ=0.002, H=10, λ=20, r=5) -@named EI = jansen_ritSC(τ=0.01, H=20, λ=5, r=5) -@named PY = jansen_ritSC(τ=0.001, H=20, λ=5, r=0.15) -@named II = jansen_ritSC(τ=2.0, H=60, λ=5, r=5) - -# Connect Regions through Adjacency Matrix -blox = [Str, GPe, STN, GPi, Th, EI, PY, II] -sys = [s.odesystem for s in blox] -connect = [s.connector for s in blox] - -@parameters C_Cor=60 C_BG_Th=60 C_Cor_BG_Th=5 C_BG_Th_Cor=5 - -adj_matrix_lin = [0 0 0 0 0 0 0 0; - -0.5*C_BG_Th -0.5*C_BG_Th C_BG_Th 0 0 0 0 0; - 0 -0.5*C_BG_Th 0 0 0 0 C_Cor_BG_Th 0; - 0 -0.5*C_BG_Th C_BG_Th 0 0 0 0 0; - 0 0 0 -0.5*C_BG_Th 0 0 0 0; - 0 0 0 0 C_BG_Th_Cor 0 6*C_Cor 0; - 0 0 0 0 0 4.8*C_Cor 0 -1.5*C_Cor; - 0 0 0 0 0 0 1.5*C_Cor 3.3*C_Cor] - -@named CBGTC_Circuit_lin = LinearConnections(sys=sys, adj_matrix=adj_matrix_lin, connector=connect) - -sim_dur = 10.0 # Simulate for 10 Seconds -mysys = structural_simplify(CBGTC_Circuit_lin) -sol = simulate(mysys, [], (0.0, sim_dur), [], Vern7(); saveat=0.001) -@test sol[!, "GPi₊x(t)"][4] ≈ -0.48421810231972134 - -sol = simulate(mysys, random_initials(mysys,blox),(0.0, sim_dur), []) -@test size(sol)[2] == 17 # make sure that all the states are simulated (16 + timestamp) - -""" -Components Test for Cortical-Subcortical Jansen-Rit blox - Cortical: PFC (Just Pyramidal Cells (PY), no Exc. Interneurons or Inh. Interneurons) - Subcortical: Basal Ganglia (GPe, STN, GPi) + Thalamus -""" - -# Create Regions -@named GPe = JansenRitCBlox(τ=0.04, H=20, λ=400, r=0.1) -@named STN = JansenRitCBlox(τ=0.01, H=20, λ=500, r=0.1) -@named GPi = JansenRitCBlox(τ=0.014, H=20, λ=400, r=0.1) -@named Thalamus = JansenRitSCBlox(τ=0.002, H=10, λ=20, r=5) -@named PFC = JansenRitSCBlox(τ=0.001, H=20, λ=5, r=0.15) - -# Connect Regions through Adjacency Matrix -blox = [GPe, STN, GPi, Thalamus, PFC] -sys = [s.odesystem for s in blox] -connect = [s.connector for s in blox] - -@parameters C_Cor=60 C_BG_Th=60 C_Cor_BG_Th=5 C_BG_Th_Cor=5 - -adj_matrix_lin = [0 C_BG_Th 0 0 0; - -0.5*C_BG_Th 0 0 0 C_Cor_BG_Th; - -0.5*C_BG_Th C_BG_Th 0 0 0; - 0 0 -0.5*C_BG_Th 0 0; - 0 0 0 C_BG_Th_Cor 0] - -@named CBGTC_Circuit_lin = LinearConnections(sys=sys, adj_matrix=adj_matrix_lin, connector=connect) -sim_dur = 10.0 # Simulate for 10 Seconds -mysys = structural_simplify(CBGTC_Circuit_lin) -sol = simulate(mysys, [], (0.0, sim_dur), []) - -""" -New tests for JansenRit blox - -These are to make sure the new JansenRit blox works identically to the former one. -""" - -# see jansen_rit_component_tests.jl \ No newline at end of file diff --git a/test/old_component_tests/larter_breakspear_tests.jl b/test/old_component_tests/larter_breakspear_tests.jl deleted file mode 100644 index ea622124..00000000 --- a/test/old_component_tests/larter_breakspear_tests.jl +++ /dev/null @@ -1,21 +0,0 @@ -using Neuroblox, DifferentialEquations, DataFrames, Test, Distributions, Statistics, LinearAlgebra, Graphs, MetaGraphs, Random - -""" -Tests formerly in components.jl -""" - -""" -Larter-Breakspear model test -""" -@named lb = LarterBreakspearBlox() -sys = [lb.odesystem] -eqs = [sys[1].jcn ~ 0] -@named lb_connect = ODESystem(eqs,systems=sys) -lb_simpl = structural_simplify(lb_connect) - -@test length(states(lb_simpl)) == 3 - -prob = ODEProblem(lb_simpl,[0.5,0.5,0.5],(0,10.0),[]) -sol = solve(prob,Tsit5()) - -@test sol[1,10] ≈ -0.6246710908910991 \ No newline at end of file diff --git a/test/old_component_tests/wilson_cowan_tests.jl b/test/old_component_tests/wilson_cowan_tests.jl deleted file mode 100644 index 2f6ae827..00000000 --- a/test/old_component_tests/wilson_cowan_tests.jl +++ /dev/null @@ -1,21 +0,0 @@ -using Neuroblox, DifferentialEquations, DataFrames, Test, Distributions, Statistics, LinearAlgebra, Graphs, MetaGraphs, Random - - -""" -Tests formerly in components.jl -""" - -""" -wilson_cowan test - -Test for Wilson-Cowan model -""" -sim_dur = 10.0 #unsure where the sim_dur came from originally because it wasn't part of the test, so this is arbitrary -@named WC = WilsonCowanBlox() -sys = [WC.odesystem] -eqs = [sys[1].jcn ~ 0.0, sys[1].P ~ 0.0] -@named WC_sys = ODESystem(eqs,systems=sys) -WC_sys_s = structural_simplify(WC_sys) -prob = ODEProblem(WC_sys_s, [], (0,sim_dur), []) -sol = solve(prob,AutoVern7(Rodas4()),saveat=0.01) -#@test sol[1,end] ≈ 0.17513685727060388 \ No newline at end of file diff --git a/test/temp_test.jl b/test/temp_test.jl deleted file mode 100644 index b332e252..00000000 --- a/test/temp_test.jl +++ /dev/null @@ -1,17 +0,0 @@ -using Neuroblox, DifferentialEquations, DataFrames, Test, Distributions, Statistics, LinearAlgebra, Graphs, MetaGraphs, Random - -@named LB1 = LarterBreakspear() -@named LB2 = LarterBreakspear() - -adj = [0 1; 1 0] -g = MetaDiGraph() -add_blox!.(Ref(g), [LB1, LB2]) -create_adjacency_edges!(g, adj) - -@named sys = system_from_graph(g) -sys = structural_simplify(sys) - -sim_dur = 1e2 -prob = ODEProblem(sys, [], (0.0, sim_dur), []) -sol = solve(prob, AutoVern7(Rodas4()), saveat=0.1) -@test sol.retcode == ReturnCode.Success \ No newline at end of file