From 968c305b0a1d1d915a323913a0313774a514fa4c Mon Sep 17 00:00:00 2001 From: Sam Isaacson Date: Tue, 26 Mar 2024 13:19:20 -0400 Subject: [PATCH] format --- src/aggregators/coevolve.jl | 2 +- test/jprob_symbol_indexing.jl | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/aggregators/coevolve.jl b/src/aggregators/coevolve.jl index 9aca9480..82e8beb9 100644 --- a/src/aggregators/coevolve.jl +++ b/src/aggregators/coevolve.jl @@ -69,7 +69,7 @@ end # executing jump at the next jump time function (p::CoevolveJumpAggregation)(integrator::I) where {I <: - AbstractSSAIntegrator} + AbstractSSAIntegrator} if !accept_next_jump!(p, integrator, integrator.u, integrator.p, integrator.t) return nothing end diff --git a/test/jprob_symbol_indexing.jl b/test/jprob_symbol_indexing.jl index efe67bfb..4cad845c 100644 --- a/test/jprob_symbol_indexing.jl +++ b/test/jprob_symbol_indexing.jl @@ -6,7 +6,7 @@ affect1!(integ) = (integ.u[1] += 1) affect2!(integ) = (integ.u[2] += 1) crj1 = ConstantRateJump(rate1, affect1!) crj2 = ConstantRateJump(rate2, affect2!) -maj = MassActionJump([[1 => 1], [1 => 1]], [[1 => -1], [1 => -1]]; param_idxs = [1,2]) +maj = MassActionJump([[1 => 1], [1 => 1]], [[1 => -1], [1 => -1]]; param_idxs = [1, 2]) g = DiscreteFunction((du, u, p, t) -> nothing; sys = SymbolicIndexingInterface.SymbolCache([:a, :b], [:p1, :p2], :t)) dprob = DiscreteProblem(g, [0, 10], (0.0, 10.0), [1.0, 2.0]) @@ -15,8 +15,8 @@ jprob = JumpProblem(dprob, Direct(), crj1, crj2, maj) # test basic querying of u0 and p @test jprob[:a] == 0 @test jprob[:b] == 10 -@test getp(jprob,:p1)(jprob) == 1.0 -@test getp(jprob,:p2)(jprob) == 2.0 +@test getp(jprob, :p1)(jprob) == 1.0 +@test getp(jprob, :p2)(jprob) == 2.0 @test jprob.ps[:p1] == 1.0 @test jprob.ps[:p2] == 2.0 @@ -51,14 +51,14 @@ reset_aggregated_jumps!(integ) # remake tests dprob = DiscreteProblem(g, [0, 10], (0.0, 10.0), [1.0, 2.0]) jprob = JumpProblem(dprob, Direct(), crj1, crj2, maj) -jprob = remake(jprob; u0 = [:a => -10, :b => 100], p = [:p2 => 3.5, :p1 => .5]) +jprob = remake(jprob; u0 = [:a => -10, :b => 100], p = [:p2 => 3.5, :p1 => 0.5]) @test jprob.prob.u0 == [-10, 100] -@test jprob.prob.p == [.5, 3.5] -@test jprob.massaction_jump.scaled_rates == [.5, 3.5] +@test jprob.prob.p == [0.5, 3.5] +@test jprob.massaction_jump.scaled_rates == [0.5, 3.5] jprob = remake(jprob; u0 = [:b => 10], p = [:p2 => 4.5]) @test jprob.prob.u0 == [-10, 10] -@test jprob.prob.p == [.5, 4.5] -@test jprob.massaction_jump.scaled_rates == [.5, 4.5] +@test jprob.prob.p == [0.5, 4.5] +@test jprob.massaction_jump.scaled_rates == [0.5, 4.5] # test updating problems via regular indexing still updates the mass action jump dprob = DiscreteProblem(g, [0, 10], (0.0, 10.0), [1.0, 2.0]) @@ -86,11 +86,11 @@ reset_aggregated_jumps!(integ) # remake tests for regular indexing dprob = DiscreteProblem(g, [0, 10], (0.0, 10.0), [1.0, 2.0]) jprob = JumpProblem(dprob, Direct(), crj1, crj2, maj) -jprob = remake(jprob; u0 = [-10, 100], p = [.5, 3.5]) +jprob = remake(jprob; u0 = [-10, 100], p = [0.5, 3.5]) @test jprob.prob.u0 == [-10, 100] -@test jprob.prob.p == [.5, 3.5] -@test jprob.massaction_jump.scaled_rates == [.5, 3.5] +@test jprob.prob.p == [0.5, 3.5] +@test jprob.massaction_jump.scaled_rates == [0.5, 3.5] jprob = remake(jprob; u0 = [2 => 10], p = [2 => 4.5]) @test jprob.prob.u0 == [-10, 10] -@test jprob.prob.p == [.5, 4.5] -@test jprob.massaction_jump.scaled_rates == [.5, 4.5] +@test jprob.prob.p == [0.5, 4.5] +@test jprob.massaction_jump.scaled_rates == [0.5, 4.5]