Skip to content

Commit

Permalink
refactor: use reexports
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 22, 2024
1 parent 3ded2fa commit 621c1b4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
9 changes: 6 additions & 3 deletions docs/src/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@

### Breaking Changes in `NonlinearSolve.jl` v4

- See [common breaking changes](@ref common-breaking-changes-v4v2) below.

### Breaking Changes in `SimpleNonlinearSolve.jl` v2

- `Auto*` structs are no longer exported. Load `ADTypes` to access them.
- See [common breaking changes](@ref common-breaking-changes-v4v2) below.

### [Common Breaking Changes](@id common-breaking-changes-v4v2)

- Use of termination conditions from `DiffEqBase` has been removed. Use the termination
conditions from `NonlinearSolveBase` instead.
- We no longer export the entire `SciMLBase`. Instead selected functionality relevant to
`SimpleNonlinearSolve` has been exported.
- If no autodiff is provided, we now choose from a list of autodiffs based on the packages
loaded. For example, if `Enzyme` is loaded, we will default to that. In general, we
don't guarantee the exact autodiff selected if `autodiff` is not provided (i.e.
Expand Down
2 changes: 2 additions & 0 deletions lib/SimpleNonlinearSolve/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MaybeInplace = "bb5d69b7-63fc-4a16-80bd-7e42200c7bdb"
NonlinearSolveBase = "be0214bd-f91f-a760-ac4e-3421ce2b2da0"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"

Expand Down Expand Up @@ -60,6 +61,7 @@ Pkg = "1.10"
PolyesterForwardDiff = "0.1"
PrecompileTools = "1.2"
Random = "1.10"
Reexport = "1.2"
ReverseDiff = "1.15"
SciMLBase = "2.50"
StaticArrays = "1.9"
Expand Down
9 changes: 3 additions & 6 deletions lib/SimpleNonlinearSolve/src/SimpleNonlinearSolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ using LineSearch: LiFukushimaLineSearch
using LinearAlgebra: LinearAlgebra, dot
using MaybeInplace: @bb, setindex_trait, CannotSetindex, CanSetindex
using PrecompileTools: @compile_workload, @setup_workload
using Reexport: @reexport
using SciMLBase: SciMLBase, AbstractNonlinearAlgorithm, NonlinearFunction, NonlinearProblem,
NonlinearLeastSquaresProblem, IntervalNonlinearProblem, ReturnCode, remake
using StaticArraysCore: StaticArray, SArray, SVector, MArray
Expand All @@ -18,7 +19,6 @@ using DifferentiationInterface: DifferentiationInterface
using FiniteDiff: FiniteDiff
using ForwardDiff: ForwardDiff

using BracketingNonlinearSolve: Alefeld, Bisection, Brent, Falsi, ITP, Ridder
using NonlinearSolveBase: NonlinearSolveBase, ImmutableNonlinearProblem, L2_NORM,
nonlinearsolve_forwarddiff_solve, nonlinearsolve_dual_solution

Expand Down Expand Up @@ -138,11 +138,8 @@ function solve_adjoint_internal end
end
end

export IntervalNonlinearProblem

export Alefeld, Bisection, Brent, Falsi, ITP, Ridder

export NonlinearFunction, NonlinearProblem, NonlinearLeastSquaresProblem
# Rexexports
@reexport using ADTypes, SciMLBase, BracketingNonlinearSolve, NonlinearSolveBase

export SimpleBroyden, SimpleKlement, SimpleLimitedMemoryBroyden
export SimpleDFSane
Expand Down
5 changes: 3 additions & 2 deletions src/NonlinearSolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ using SparseArrays: AbstractSparseMatrix, SparseMatrixCSC
using SparseMatrixColorings: ConstantColoringAlgorithm, GreedyColoringAlgorithm,
LargestFirst

@reexport using SciMLBase, SimpleNonlinearSolve, NonlinearSolveBase

const DI = DifferentiationInterface

const True = Val(true)
Expand Down Expand Up @@ -157,6 +155,9 @@ include("default.jl")
end
end

# Rexexports
@reexport using SciMLBase, SimpleNonlinearSolve, NonlinearSolveBase

# Core Algorithms
export NewtonRaphson, PseudoTransient, Klement, Broyden, LimitedMemoryBroyden, DFSane
export GaussNewton, LevenbergMarquardt, TrustRegion
Expand Down

0 comments on commit 621c1b4

Please sign in to comment.