Skip to content

Commit d327817

Browse files
Merge pull request #459 from ChrisRackauckas-Claude/use-warn-on-resize
Use PreallocationTools warn_on_resize instead of NullLogger workaround
2 parents e15b181 + 82d776a commit d327817

3 files changed

Lines changed: 7 additions & 14 deletions

File tree

lib/BoundaryValueDiffEqCore/Project.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
1313
Integrals = "de52edbc-65ea-441a-8357-d3a637375a31"
1414
LineSearch = "87fe0de2-c867-4266-b59a-2f0a94fc965b"
1515
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
16-
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
1716
NonlinearSolveBase = "be0214bd-f91f-a760-ac4e-3421ce2b2da0"
1817
NonlinearSolveFirstOrder = "5959db7a-ea39-4486-b5fe-2dd0bf03d60d"
1918
OptimizationBase = "bca83a33-5cc9-4baa-983d-23429ab6bcbb"
@@ -40,11 +39,10 @@ Integrals = "4.7.1, 5"
4039
InteractiveUtils = "<0.0.1, 1"
4140
LineSearch = "0.1.4"
4241
LinearAlgebra = "1.10"
43-
Logging = "1.10"
4442
NonlinearSolveBase = "2.11.2"
4543
NonlinearSolveFirstOrder = "1.2, 2"
4644
OptimizationBase = "3.2.0, 4, 5"
47-
PreallocationTools = "0.4, 1"
45+
PreallocationTools = "1.2"
4846
RecursiveArrayTools = "3.27.0"
4947
Reexport = "1.2"
5048
SciMLBase = "2.152.1"

lib/BoundaryValueDiffEqCore/src/BoundaryValueDiffEqCore.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ using ConcreteStructs: @concrete
88
using DiffEqBase: DiffEqBase, solve
99
using ForwardDiff: ForwardDiff, pickchunksize
1010
using Integrals: Integrals, IntegralProblem
11-
using Logging: Logging
1211
using LinearAlgebra
1312
using LineSearch: BackTracking
1413
using NonlinearSolveFirstOrder: NonlinearSolvePolyAlgorithm

lib/BoundaryValueDiffEqCore/src/types.jl

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,19 +171,15 @@ end
171171
end
172172

173173
function __maybe_allocate_diffcache(x, chunksize, jac_alg)
174-
return __needs_diffcache(jac_alg) ? DiffCache(x, chunksize) : x
174+
return __needs_diffcache(jac_alg) ?
175+
DiffCache(x, chunksize; warn_on_resize = false) : x
175176
end
176-
__maybe_allocate_diffcache(x::DiffCache, chunksize) = DiffCache(zero(x.du), chunksize)
177-
178-
## get_tmp shows a warning as it should on cache expansion, this behavior however is
179-
## expected for adaptive BVP solvers so we write our own `get_tmp` and drop the warning logs
180-
181-
@inline function get_tmp(dc, u)
182-
return Logging.with_logger(Logging.NullLogger()) do
183-
PreallocationTools.get_tmp(dc, u)
184-
end
177+
function __maybe_allocate_diffcache(x::DiffCache, chunksize)
178+
return DiffCache(zero(x.du), chunksize; warn_on_resize = false)
185179
end
186180

181+
@inline get_tmp(dc, u) = dc
182+
187183
# DiffCache
188184
struct DiffCacheNeeded end
189185
struct NoDiffCacheNeeded end

0 commit comments

Comments
 (0)