Skip to content

Commit

Permalink
Merge pull request #244 from lxvm/kwargs
Browse files Browse the repository at this point in the history
Fix #242 : Pass IntegralProblem kwargs to solvers
  • Loading branch information
ChrisRackauckas committed Mar 3, 2024
2 parents c2f9429 + 113675a commit 278d70f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ IntegralsZygoteExt = ["Zygote", "ChainRulesCore"]
[compat]
Aqua = "0.8"
Arblib = "1"
ChainRulesCore = "1.16"
ChainRulesCore = "1.18"
CommonSolve = "0.2.4"
Cuba = "2.2"
Cubature = "1.5"
Expand All @@ -50,7 +50,7 @@ Pkg = "1.10"
QuadGK = "2.9"
Reexport = "1.0"
SafeTestsets = "0.1"
SciMLBase = "2.6"
SciMLBase = "2.24"
StaticArrays = "1"
Test = "1.10"
Zygote = "0.6.69"
Expand Down
3 changes: 2 additions & 1 deletion src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ init_cacheval(::SciMLBase.AbstractIntegralAlgorithm, args...) = nothing
function SciMLBase.init(prob::IntegralProblem{iip},
alg::SciMLBase.AbstractIntegralAlgorithm;
sensealg = ReCallVJP(ZygoteVJP()),
do_inf_transformation = nothing, kwargs...) where {iip}
do_inf_transformation = nothing, kws...) where {iip}
kwargs = pairs((; prob.kwargs..., kws...))
checkkwargs(kwargs...)
prob = transformation_if_inf(prob, do_inf_transformation)
cacheval = init_cacheval(alg, prob)
Expand Down
10 changes: 10 additions & 0 deletions test/interface_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -386,3 +386,13 @@ end
end
end
end

@testset "issue242" begin
f242(x, p) = p / (x^2 + p^2)
domain242 = (-1, 1)
p242 = 1e-3
for abstol in [1e-2, 1e-4, 1e-6, 1e-8]
@test solve(IntegralProblem(f242, domain242, p242; abstol), QuadGKJL()).u ==
solve(IntegralProblem(f242, domain242, p242), QuadGKJL(); abstol).u
end
end

0 comments on commit 278d70f

Please sign in to comment.