From d11bf413853aaad3d24ed96bdaf10ef0a7d578b5 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Wed, 30 Nov 2022 16:47:29 +0100 Subject: [PATCH 1/2] Reduce reliance on DiffEqBase NLsolver --- src/StochasticDiffEq.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/StochasticDiffEq.jl b/src/StochasticDiffEq.jl index 19954c637..231f747c6 100644 --- a/src/StochasticDiffEq.jl +++ b/src/StochasticDiffEq.jl @@ -51,15 +51,15 @@ using DocStringExtensions using DiffEqBase: check_error!, is_diagonal_noise, @.. - using DiffEqBase: nlsolvefail, isnewton, set_new_W!, get_W, iipnlsolve, oopnlsolve, _vec, _reshape +using OrdinaryDiffEq: nlsolvefail, isnewton, set_new_W!, get_W, _vec, _reshape - using DiffEqBase: NLSolver +using OrdinaryDiffEq: NLSolver - using DiffEqBase: FastConvergence, Convergence, SlowConvergence, VerySlowConvergence, Divergence +using OrdinaryDiffEq: + FastConvergence, Convergence, SlowConvergence, VerySlowConvergence, Divergence - import DiffEqBase: calculate_residuals, calculate_residuals!, nlsolve_f, unwrap_cache, islinear - - import DiffEqBase: iip_get_uf, oop_get_uf, build_jac_config +import OrdinaryDiffEq: + calculate_residuals, calculate_residuals!, nlsolve_f, unwrap_cache, islinear import SciMLBase From 7c582985623f48cd57771bff0451077c45d7de56 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Wed, 30 Nov 2022 17:07:21 +0100 Subject: [PATCH 2/2] backwards compatability --- src/StochasticDiffEq.jl | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/StochasticDiffEq.jl b/src/StochasticDiffEq.jl index 231f747c6..794f53138 100644 --- a/src/StochasticDiffEq.jl +++ b/src/StochasticDiffEq.jl @@ -55,11 +55,19 @@ using OrdinaryDiffEq: nlsolvefail, isnewton, set_new_W!, get_W, _vec, _reshape using OrdinaryDiffEq: NLSolver -using OrdinaryDiffEq: - FastConvergence, Convergence, SlowConvergence, VerySlowConvergence, Divergence - -import OrdinaryDiffEq: - calculate_residuals, calculate_residuals!, nlsolve_f, unwrap_cache, islinear +if isdefined(OrdinaryDiffEq,:FastConvergence) + using OrdinaryDiffEq: + FastConvergence, Convergence, SlowConvergence, VerySlowConvergence, Divergence + + import OrdinaryDiffEq: + calculate_residuals, calculate_residuals!, nlsolve_f, unwrap_cache, islinear +else + using DiffEqBase: + FastConvergence, Convergence, SlowConvergence, VerySlowConvergence, Divergence + + import DiffEqBase: + calculate_residuals, calculate_residuals!, nlsolve_f, unwrap_cache, islinear +end import SciMLBase