diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 71f27f8c..a75f4e85 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -19,7 +19,6 @@ jobs: - Core version: - '1' - - '1.6' steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 diff --git a/Project.toml b/Project.toml index ea68f6a9..8b70577a 100644 --- a/Project.toml +++ b/Project.toml @@ -28,20 +28,20 @@ FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898" JumpProcessFastBroadcastExt = "FastBroadcast" [compat] -ArrayInterface = "6, 7" -DataStructures = "0.17, 0.18" +ArrayInterface = "7" +DataStructures = "0.18" DiffEqBase = "6.122" -DocStringExtensions = "0.8.6, 0.9" +DocStringExtensions = "0.9" FunctionWrappers = "1.0" Graphs = "1.4" PoissonRandom = "0.4" RandomNumbers = "1.3" -RecursiveArrayTools = "2, 3" -Reexport = "0.2, 1.0" +RecursiveArrayTools = "3" +Reexport = "1.0" SciMLBase = "1.51, 2" -StaticArrays = "0.10, 0.11, 0.12, 1.0" +StaticArrays = "1.0" UnPack = "1.0.2" -julia = "1.6" +julia = "1.10" [extras] DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def" diff --git a/src/problem.jl b/src/problem.jl index 67f8045c..8423ec1c 100644 --- a/src/problem.jl +++ b/src/problem.jl @@ -122,9 +122,12 @@ end # when setindex! is used. function Base.setindex!(prob::JumpProblem, args...; kwargs...) SciMLBase.___internal_setindex!(prob.prob, args...; kwargs...) - if using_params(prob.massaction_jump) - update_parameters!(prob.massaction_jump, prob.prob.p) - end + + # since parameters are no longer allowed to be mutated and the preceding will error this + # isn't needed + # if using_params(prob.massaction_jump) + # update_parameters!(prob.massaction_jump, prob.prob.p) + # end end # when getindex is used. diff --git a/test/jprob_symbol_indexing.jl b/test/jprob_symbol_indexing.jl index 15a53f99..5428770c 100644 --- a/test/jprob_symbol_indexing.jl +++ b/test/jprob_symbol_indexing.jl @@ -6,14 +6,16 @@ affect1!(integ) = (integ.u[1] += 1) affect2!(integ) = (integ.u[2] += 1) crj1 = ConstantRateJump(rate1, affect1!) crj2 = ConstantRateJump(rate2, affect2!) -g = DiscreteFunction((du, u, p, t) -> nothing; syms = [:a, :b], paramsyms = [:p1, :p2]) +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]) jprob = JumpProblem(dprob, Direct(), crj1, crj2) # runs the tests @test jprob[:a] == 0 @test jprob[:b] == 10 -@test jprob[:p1] == 1.0 -@test jprob[:p2] == 2.0 -# tests for setindex (e.g. `jprob[:a] = 10`) not possible, this requires the problem to have a .f.sys filed., +# these are no longer supported by SciMLBase +@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