Skip to content

Commit

Permalink
fix: properly implement SII fallbacks for AbstractJumpProblem
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Feb 19, 2024
1 parent 69c7776 commit 8fda165
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/problems/problem_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ Base.@propagate_inbounds function Base.getproperty(prob::AbstractSciMLProblem, s
end

SymbolicIndexingInterface.symbolic_container(prob::AbstractSciMLProblem) = prob.f
SymbolicIndexingInterface.symbolic_container(prob::AbstractJumpProblem) = prob.prob

Check warning on line 9 in src/problems/problem_interface.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/problem_interface.jl#L9

Added line #L9 was not covered by tests

SymbolicIndexingInterface.parameter_values(prob::AbstractSciMLProblem) = prob.p
SymbolicIndexingInterface.parameter_values(prob::AbstractJumpProblem) = prob.prob.p

Check warning on line 12 in src/problems/problem_interface.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/problem_interface.jl#L12

Added line #L12 was not covered by tests
SymbolicIndexingInterface.state_values(prob::AbstractSciMLProblem) = prob.u0
SymbolicIndexingInterface.state_values(prob::AbstractJumpProblem) = prob.prob.u0

Check warning on line 14 in src/problems/problem_interface.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/problem_interface.jl#L14

Added line #L14 was not covered by tests
SymbolicIndexingInterface.current_time(prob::AbstractSciMLProblem) = prob.tspan[1]
SymbolicIndexingInterface.current_time(prob::AbstractJumpProblem) = prob.prob.tspan[1]

Check warning on line 16 in src/problems/problem_interface.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/problem_interface.jl#L16

Added line #L16 was not covered by tests

Base.@propagate_inbounds function Base.getindex(prob::AbstractSciMLProblem, ::SymbolicIndexingInterface.SolvedVariables)
return getindex(prob, variable_symbols(prob))
Expand Down

0 comments on commit 8fda165

Please sign in to comment.