Skip to content
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

Trust Region docstrings improvement #197

Merged
merged 6 commits into from
Jul 30, 2023
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions src/trustRegion.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
EnumX.@enumx RadiusUpdateSchemes begin
Simple
Hei
Yuan
Bastin
Fan
end

"""
```julia
TrustRegion(; chunk_size = Val{0}(), autodiff = Val{true}(),
Expand Down Expand Up @@ -58,6 +50,11 @@ for large-scale and numerically-difficult nonlinear systems.
preconditioners. For more information on specifying preconditioners for LinearSolve
algorithms, consult the
[LinearSolve.jl documentation](https://docs.sciml.ai/LinearSolve/stable/).
- `radius_update_scheme`: the choice of radius update scheme to be used. Defaults to `RadiusUpdateSchemes.Simple`
which follows the conventional approach. Other available schemes are `RadiusUpdateSchemes.Hei`,
`RadiusUpdateSchemes.Yuan`, `RadiusUpdateSchemes.Bastin`, `RadiusUpdateSchemes.Fan`. These schemes
have the trust region radius converging to zero that is seen to improve convergence. For more details, see the
[Yuan, Yx](https://link.springer.com/article/10.1007/s10107-015-0893-2#Sec4).
- `max_trust_radius`: the maximal trust region radius.
Defaults to `max(norm(fu), maximum(u) - minimum(u))`.
- `initial_trust_radius`: the initial trust region radius. Defaults to
Expand Down Expand Up @@ -88,6 +85,14 @@ for large-scale and numerically-difficult nonlinear systems.
Currently, the linear solver and chunk size choice only applies to in-place defined
`NonlinearProblem`s. That is expected to change in the future.
"""
EnumX.@enumx RadiusUpdateSchemes begin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this moved? This puts the docstrong on the wrong object.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umm right now I dont see the trust region docstring on the main docs: https://docs.sciml.ai/NonlinearSolve/stable/api/nonlinearsolve/ . I thought it is because the docstring is not at the beginning.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So should the Enum definition be on the main src/NonlinearSolve.jl file instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because the docstring wasn't right before the function. It has to be exactly the line before the function definition, no space.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already working on the dev version: https://docs.sciml.ai/NonlinearSolve/dev/api/nonlinearsolve/

Simple
Hei
Yuan
Bastin
Fan
end

struct TrustRegion{CS, AD, FDT, L, P, ST, CJ, MTR} <:
AbstractNewtonAlgorithm{CS, AD, FDT, ST, CJ}
linsolve::L
Expand Down