-
-
Notifications
You must be signed in to change notification settings - Fork 47
Add SciPy solver support for NonlinearSolve problems #632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…to NonlinearSolve Signed-off-by: AdityaPandeyCN <[email protected]>
Signed-off-by: AdityaPandeyCN <[email protected]>
Signed-off-by: AdityaPandeyCN <[email protected]>
For the docs it's missing its solver specific page, like https://docs.sciml.ai/NonlinearSolve/stable/api/fixedpointacceleration/ |
Set this up as a lib solver subpackage instead of an extension https://github.com/SciML/NonlinearSolve.jl/tree/master/lib. |
Project.toml
Outdated
@@ -19,12 +19,14 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | |||
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" | |||
NonlinearSolveBase = "be0214bd-f91f-a760-ac4e-3421ce2b2da0" | |||
NonlinearSolveFirstOrder = "5959db7a-ea39-4486-b5fe-2dd0bf03d60d" | |||
NonlinearSolveHomotopyContinuation = "2ac3b008-d579-4536-8c91-a1a5998c2f8b" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be there
Project.toml
Outdated
NonlinearSolveQuasiNewton = "9a2c21bd-3a47-402d-9113-8faf9a0ee114" | ||
NonlinearSolveSpectralMethods = "26075421-4e9a-44e1-8bd1-420ed7ad02b2" | ||
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" | ||
Preferences = "21216c6a-2e73-6563-6e65-726566657250" | ||
Reexport = "189a3867-3050-52da-a836-e630ba90ab69" | ||
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" | ||
SciMLJacobianOperators = "19f34311-ddf3-4b8b-af20-060888a46c0e" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't necessary?
Project.toml
Outdated
@@ -41,28 +43,11 @@ MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" | |||
NLSolvers = "337daf1e-9722-11e9-073e-8b9effe078ba" | |||
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" | |||
PETSc = "ace2c81b-2b5f-4b1e-a30d-d662738edfe0" | |||
PythonCall = "9d6bc502-a68f-5bec-b839-aff6a2a0a179" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PythonCall = "9d6bc502-a68f-5bec-b839-aff6a2a0a179" |
Project.toml
Outdated
@@ -117,6 +102,7 @@ Pkg = "1.10" | |||
PolyesterForwardDiff = "0.1.3" | |||
PrecompileTools = "1.2" | |||
Preferences = "1.4" | |||
PythonCall = "0.9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PythonCall = "0.9" |
src/NonlinearSolve.jl
Outdated
NonlinearSolveQuasiNewton, SimpleNonlinearSolve, BracketingNonlinearSolve, | ||
NonlinearSolveSciPy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NonlinearSolveQuasiNewton, SimpleNonlinearSolve, BracketingNonlinearSolve, | |
NonlinearSolveSciPy | |
NonlinearSolveQuasiNewton, SimpleNonlinearSolve, BracketingNonlinearSolve |
src/NonlinearSolve.jl
Outdated
FixedPointAccelerationJL, SpeedMappingJL, SIAMFANLEquationsJL, SciPyLeastSquares, | ||
SciPyLeastSquaresTRF, SciPyLeastSquaresDogbox, SciPyLeastSquaresLM, | ||
SciPyRoot, SciPyRootScalar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FixedPointAccelerationJL, SpeedMappingJL, SIAMFANLEquationsJL, SciPyLeastSquares, | |
SciPyLeastSquaresTRF, SciPyLeastSquaresDogbox, SciPyLeastSquaresLM, | |
SciPyRoot, SciPyRootScalar | |
FixedPointAccelerationJL, SpeedMappingJL, SIAMFANLEquationsJL |
src/NonlinearSolve.jl
Outdated
@@ -42,6 +42,7 @@ using NonlinearSolveFirstOrder: NonlinearSolveFirstOrder, GeneralizedFirstOrderA | |||
using NonlinearSolveQuasiNewton: NonlinearSolveQuasiNewton, QuasiNewtonAlgorithm | |||
using NonlinearSolveSpectralMethods: NonlinearSolveSpectralMethods, GeneralizedDFSane | |||
using SimpleNonlinearSolve: SimpleNonlinearSolve | |||
using NonlinearSolveSciPy: NonlinearSolveSciPy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using NonlinearSolveSciPy: NonlinearSolveSciPy |
Copy how https://github.com/SciML/NonlinearSolve.jl/blob/master/lib/NonlinearSolveQuasiNewton/test/runtests.jl sets up its tests and this is probably done. |
Thankyou, Will do it |
const scipy_optimize = try | ||
pyimport("scipy.optimize") | ||
catch | ||
nothing | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#Precompilation on how to import python packages in the global scope correctly
Signed-off-by: AdityaPandeyCN <[email protected]>
590a13d
to
f992be2
Compare
@avik-pal with this CI system is there a way to subset out the |
Awesome stuff @AdityaPandeyCN, feel free to follow the instructions to PR the website as completed and claim your reward. If you want to help another step, I think one other thing here that would be nice would be to add the new SciPy solvers to the benchmark set. https://docs.sciml.ai/SciMLBenchmarksOutput/dev/GlobalOptimization/blackbox_global_optimizers/ Just the global ones. You'd make a PR to update the generator script https://github.com/SciML/SciMLBenchmarks.jl/blob/master/benchmarks/GlobalOptimization/blackbox_global_optimizers.jmd which would then cause the update. |
Sure @ChrisRackauckas , I will start working on this. |
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
This PR adds SciPy-based solvers (SciPyLeastSquares, SciPyRoot, SciPyRootScalar) for NonlinearSolve problem types via a PythonCall extension, addressing the request that "NonlinearProblem, NonlinearLeastSquaresProblem, and IntervalNonlinearProblem methods should live in NonlinearSolve.jl since the solvers for those types of problems are all associated there." This is referenced to this PR