Skip to content

Commit

Permalink
use SII.finalize_parameters_hook
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacsas committed Mar 25, 2024
1 parent c045289 commit 2cd18fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Expand Up @@ -41,7 +41,7 @@ RecursiveArrayTools = "3.12"
Reexport = "1.0"
SciMLBase = "2.30.1"
StaticArrays = "1.9"
SymbolicIndexingInterface = "0.3.11"
SymbolicIndexingInterface = "0.3.13"
UnPack = "1.0.2"
julia = "1.10"

Expand Down
7 changes: 2 additions & 5 deletions src/problem.jl
Expand Up @@ -125,14 +125,11 @@ function Base.setindex!(prob::JumpProblem, args...; kwargs...)
end

# for updating parameters in JumpProblems to update MassActionJumps
function SII.set_parameter!(prob::JumpProblem, val, idx)
ans = SII.set_parameter!(SII.parameter_values(prob), val, idx)

function SII.finalize_parameters_hook!(prob::JumpProblem, p)
if using_params(prob.massaction_jump)
update_parameters!(prob.massaction_jump, prob.prob.p)
end

ans
nothing

Check warning on line 132 in src/problem.jl

View check run for this annotation

Codecov / codecov/patch

src/problem.jl#L132

Added line #L132 was not covered by tests
end

# when getindex is used.
Expand Down

0 comments on commit 2cd18fa

Please sign in to comment.