Skip to content

Commit 278d70f

Browse files
Merge pull request #244 from lxvm/kwargs
Fix #242 : Pass IntegralProblem kwargs to solvers
2 parents c2f9429 + 113675a commit 278d70f

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ IntegralsZygoteExt = ["Zygote", "ChainRulesCore"]
3434
[compat]
3535
Aqua = "0.8"
3636
Arblib = "1"
37-
ChainRulesCore = "1.16"
37+
ChainRulesCore = "1.18"
3838
CommonSolve = "0.2.4"
3939
Cuba = "2.2"
4040
Cubature = "1.5"
@@ -50,7 +50,7 @@ Pkg = "1.10"
5050
QuadGK = "2.9"
5151
Reexport = "1.0"
5252
SafeTestsets = "0.1"
53-
SciMLBase = "2.6"
53+
SciMLBase = "2.24"
5454
StaticArrays = "1"
5555
Test = "1.10"
5656
Zygote = "0.6.69"

src/common.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ init_cacheval(::SciMLBase.AbstractIntegralAlgorithm, args...) = nothing
1717
function SciMLBase.init(prob::IntegralProblem{iip},
1818
alg::SciMLBase.AbstractIntegralAlgorithm;
1919
sensealg = ReCallVJP(ZygoteVJP()),
20-
do_inf_transformation = nothing, kwargs...) where {iip}
20+
do_inf_transformation = nothing, kws...) where {iip}
21+
kwargs = pairs((; prob.kwargs..., kws...))
2122
checkkwargs(kwargs...)
2223
prob = transformation_if_inf(prob, do_inf_transformation)
2324
cacheval = init_cacheval(alg, prob)

test/interface_tests.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,3 +386,13 @@ end
386386
end
387387
end
388388
end
389+
390+
@testset "issue242" begin
391+
f242(x, p) = p / (x^2 + p^2)
392+
domain242 = (-1, 1)
393+
p242 = 1e-3
394+
for abstol in [1e-2, 1e-4, 1e-6, 1e-8]
395+
@test solve(IntegralProblem(f242, domain242, p242; abstol), QuadGKJL()).u ==
396+
solve(IntegralProblem(f242, domain242, p242), QuadGKJL(); abstol).u
397+
end
398+
end

0 commit comments

Comments
 (0)