Skip to content

Commit 08fc405

Browse files
Merge pull request #1711 from SciML/docstrings
Fix docstrings and docs
2 parents c65f71a + 2d55b45 commit 08fc405

File tree

9 files changed

+97
-66
lines changed

9 files changed

+97
-66
lines changed

docs/src/systems/JumpSystem.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ structural_simplify
2424
## Problem Constructors
2525

2626
```@docs
27-
DiscreteProblem
28-
JumpProblem
27+
DiscreteProblem(::JumpSystem,args...)
28+
JumpProblem(::JumpSystem,args...)
2929
```

docs/src/systems/NonlinearSystem.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,19 @@ jacobian_sparsity
3838
## Problem Constructors
3939

4040
```@docs
41-
NonlinearProblem
41+
NonlinearFunction(sys::ModelingToolkit.NonlinearSystem, args...)
42+
NonlinearProblem(sys::ModelingToolkit.NonlinearSystem, args...)
4243
```
4344

4445
## Torn Problem Constructors
4546

4647
```@docs
4748
BlockNonlinearProblem
4849
```
50+
51+
## Expression Constructors
52+
53+
```@docs
54+
NonlinearFunctionExpr
55+
NonlinearProblemExpr
56+
```

docs/src/systems/ODESystem.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,21 @@ jacobian_sparsity
4747
## Standard Problem Constructors
4848

4949
```@docs
50-
ODEFunction{iip}(sys::ModelingToolkit.AbstractODESystem, args...)
51-
ODEProblem{iip}(sys::ModelingToolkit.AbstractODESystem, args...)
52-
SteadyStateFunction{iip}(sys::ModelingToolkit.AbstractODESystem, args...)
53-
SteadyStateProblem{iip}(sys::ModelingToolkit.AbstractODESystem, args...)
50+
ODEFunction(sys::ModelingToolkit.AbstractODESystem, args...)
51+
ODEProblem(sys::ModelingToolkit.AbstractODESystem, args...)
52+
SteadyStateProblem(sys::ModelingToolkit.AbstractODESystem, args...)
5453
```
5554

5655
## Torn Problem Constructors
5756

5857
```@docs
59-
ODAEProblem{iip}(sys::ModelingToolkit.AbstractODESystem, args...)
58+
ODAEProblem(sys::ModelingToolkit.AbstractODESystem, args...)
59+
```
60+
61+
## Expression Constructors
62+
63+
```@docs
64+
ODEFunctionExpr
65+
DAEFunctionExpr
66+
SteadyStateProblemExpr
6067
```

docs/src/systems/OptimizationSystem.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,11 @@ hessian_sparsity
2929
## Problem Constructors
3030

3131
```@docs
32-
OptimizationProblem
32+
OptimizationProblem(sys::ModelingToolkit.OptimizationSystem, args...)
33+
```
34+
35+
## Expression Constructors
36+
37+
```@docs
38+
OptimizationProblemExpr
3339
```

docs/src/systems/SDESystem.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ jacobian_sparsity
4444
## Problem Constructors
4545

4646
```@docs
47-
SDEFunction
48-
SDEProblem
47+
SDEFunction(sys::ModelingToolkit.SDESystem, args...)
48+
SDEProblem(sys::ModelingToolkit.SDESystem, args...)
49+
```
50+
51+
## Expression Constructors
52+
53+
```@docs
54+
SDEFunctionExpr
55+
SDEProblemExpr
4956
```

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,6 @@ function isautonomous(sys::AbstractODESystem)
230230
all(iszero, tgrad)
231231
end
232232

233-
for F in [:ODEFunction, :DAEFunction]
234-
@eval function DiffEqBase.$F(sys::AbstractODESystem, args...; kwargs...)
235-
$F{true}(sys, args...; kwargs...)
236-
end
237-
end
238-
239233
"""
240234
```julia
241235
function DiffEqBase.ODEFunction{iip}(sys::AbstractODESystem, dvs = states(sys),
@@ -250,6 +244,10 @@ Create an `ODEFunction` from the [`ODESystem`](@ref). The arguments `dvs` and `p
250244
are used to set the order of the dependent variable and parameter vectors,
251245
respectively.
252246
"""
247+
function DiffEqBase.ODEFunction(sys::AbstractODESystem, args...; kwargs...)
248+
ODEFunction{true}(sys, args...; kwargs...)
249+
end
250+
253251
function DiffEqBase.ODEFunction{iip}(sys::AbstractODESystem, dvs = states(sys),
254252
ps = parameters(sys), u0 = nothing;
255253
version = nothing, tgrad = false,
@@ -365,6 +363,10 @@ Create an `DAEFunction` from the [`ODESystem`](@ref). The arguments `dvs` and
365363
`ps` are used to set the order of the dependent variable and parameter vectors,
366364
respectively.
367365
"""
366+
function DiffEqBase.DAEFunction(sys::AbstractODESystem, args...; kwargs...)
367+
DAEFunction{true}(sys, args...; kwargs...)
368+
end
369+
368370
function DiffEqBase.DAEFunction{iip}(sys::AbstractODESystem, dvs = states(sys),
369371
ps = parameters(sys), u0 = nothing;
370372
ddvs = map(diff2term Differential(get_iv(sys)), dvs),
@@ -606,12 +608,6 @@ function DAEFunctionExpr(sys::AbstractODESystem, args...; kwargs...)
606608
DAEFunctionExpr{true}(sys, args...; kwargs...)
607609
end
608610

609-
for P in [:ODEProblem, :DAEProblem]
610-
@eval function DiffEqBase.$P(sys::AbstractODESystem, args...; kwargs...)
611-
$P{true}(sys, args...; kwargs...)
612-
end
613-
end
614-
615611
"""
616612
```julia
617613
function DiffEqBase.ODEProblem{iip}(sys::AbstractODESystem,u0map,tspan,
@@ -627,6 +623,10 @@ function DiffEqBase.ODEProblem{iip}(sys::AbstractODESystem,u0map,tspan,
627623
Generates an ODEProblem from an ODESystem and allows for automatically
628624
symbolically calculating numerical enhancements.
629625
"""
626+
function DiffEqBase.ODEProblem(sys::AbstractODESystem, args...; kwargs...)
627+
ODEProblem{true}(sys, args...; kwargs...)
628+
end
629+
630630
function DiffEqBase.ODEProblem{iip}(sys::AbstractODESystem, u0map, tspan,
631631
parammap = DiffEqBase.NullParameters();
632632
callback = nothing,
@@ -660,6 +660,10 @@ function DiffEqBase.DAEProblem{iip}(sys::AbstractODESystem,du0map,u0map,tspan,
660660
Generates an DAEProblem from an ODESystem and allows for automatically
661661
symbolically calculating numerical enhancements.
662662
"""
663+
function DiffEqBase.DAEProblem(sys::AbstractODESystem, args...; kwargs...)
664+
DAEProblem{true}(sys, args...; kwargs...)
665+
end
666+
663667
function DiffEqBase.DAEProblem{iip}(sys::AbstractODESystem, du0map, u0map, tspan,
664668
parammap = DiffEqBase.NullParameters();
665669
check_length = true, kwargs...) where {iip}
@@ -774,11 +778,6 @@ function DAEProblemExpr(sys::AbstractODESystem, args...; kwargs...)
774778
DAEProblemExpr{true}(sys, args...; kwargs...)
775779
end
776780

777-
### Enables Steady State Problems ###
778-
function DiffEqBase.SteadyStateProblem(sys::AbstractODESystem, args...; kwargs...)
779-
SteadyStateProblem{true}(sys, args...; kwargs...)
780-
end
781-
782781
"""
783782
```julia
784783
function DiffEqBase.SteadyStateProblem(sys::AbstractODESystem,u0map,
@@ -792,6 +791,10 @@ function DiffEqBase.SteadyStateProblem(sys::AbstractODESystem,u0map,
792791
Generates an SteadyStateProblem from an ODESystem and allows for automatically
793792
symbolically calculating numerical enhancements.
794793
"""
794+
function DiffEqBase.SteadyStateProblem(sys::AbstractODESystem, args...; kwargs...)
795+
SteadyStateProblem{true}(sys, args...; kwargs...)
796+
end
797+
795798
function DiffEqBase.SteadyStateProblem{iip}(sys::AbstractODESystem, u0map,
796799
parammap = DiffEqBase.NullParameters();
797800
check_length = true, kwargs...) where {iip}

src/systems/diffeqs/sdesystem.jl

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -313,17 +313,6 @@ function Girsanov_transform(sys::SDESystem, u; θ0 = 1.0)
313313
name = name, checks = false)
314314
end
315315

316-
"""
317-
```julia
318-
function DiffEqBase.SDEFunction{iip}(sys::SDESystem, dvs = sys.states, ps = sys.ps;
319-
version = nothing, tgrad=false, sparse = false,
320-
jac = false, Wfact = false, kwargs...) where {iip}
321-
```
322-
323-
Create an `SDEFunction` from the [`SDESystem`](@ref). The arguments `dvs` and `ps`
324-
are used to set the order of the dependent variable and parameter vectors,
325-
respectively.
326-
"""
327316
function DiffEqBase.SDEFunction{iip}(sys::SDESystem, dvs = states(sys),
328317
ps = parameters(sys),
329318
u0 = nothing;
@@ -409,6 +398,17 @@ function DiffEqBase.SDEFunction{iip}(sys::SDESystem, dvs = states(sys),
409398
observed = observedfun)
410399
end
411400

401+
"""
402+
```julia
403+
function DiffEqBase.SDEFunction{iip}(sys::SDESystem, dvs = sys.states, ps = sys.ps;
404+
version = nothing, tgrad=false, sparse = false,
405+
jac = false, Wfact = false, kwargs...) where {iip}
406+
```
407+
408+
Create an `SDEFunction` from the [`SDESystem`](@ref). The arguments `dvs` and `ps`
409+
are used to set the order of the dependent variable and parameter vectors,
410+
respectively.
411+
"""
412412
function DiffEqBase.SDEFunction(sys::SDESystem, args...; kwargs...)
413413
SDEFunction{true}(sys, args...; kwargs...)
414414
end
@@ -488,21 +488,6 @@ function SDEFunctionExpr(sys::SDESystem, args...; kwargs...)
488488
SDEFunctionExpr{true}(sys, args...; kwargs...)
489489
end
490490

491-
"""
492-
```julia
493-
function DiffEqBase.SDEProblem{iip}(sys::SDESystem,u0map,tspan,p=parammap;
494-
version = nothing, tgrad=false,
495-
jac = false, Wfact = false,
496-
checkbounds = false, sparse = false,
497-
sparsenoise = sparse,
498-
skipzeros = true, fillzeros = true,
499-
linenumbers = true, parallel=SerialForm(),
500-
kwargs...)
501-
```
502-
503-
Generates an SDEProblem from an SDESystem and allows for automatically
504-
symbolically calculating numerical enhancements.
505-
"""
506491
function DiffEqBase.SDEProblem{iip}(sys::SDESystem, u0map, tspan,
507492
parammap = DiffEqBase.NullParameters();
508493
sparsenoise = nothing, check_length = true,
@@ -525,6 +510,21 @@ function DiffEqBase.SDEProblem{iip}(sys::SDESystem, u0map, tspan,
525510
kwargs...)
526511
end
527512

513+
"""
514+
```julia
515+
function DiffEqBase.SDEProblem{iip}(sys::SDESystem,u0map,tspan,p=parammap;
516+
version = nothing, tgrad=false,
517+
jac = false, Wfact = false,
518+
checkbounds = false, sparse = false,
519+
sparsenoise = sparse,
520+
skipzeros = true, fillzeros = true,
521+
linenumbers = true, parallel=SerialForm(),
522+
kwargs...)
523+
```
524+
525+
Generates an SDEProblem from an SDESystem and allows for automatically
526+
symbolically calculating numerical enhancements.
527+
"""
528528
function DiffEqBase.SDEProblem(sys::SDESystem, args...; kwargs...)
529529
SDEProblem{true}(sys, args...; kwargs...)
530530
end

src/systems/nonlinear/nonlinearsystem.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,6 @@ function hessian_sparsity(sys::NonlinearSystem)
181181
states(sys)) for eq in equations(sys)]
182182
end
183183

184-
function DiffEqBase.NonlinearFunction(sys::NonlinearSystem, args...; kwargs...)
185-
NonlinearFunction{true}(sys, args...; kwargs...)
186-
end
187-
188184
"""
189185
```julia
190186
function DiffEqBase.NonlinearFunction{iip}(sys::NonlinearSystem, dvs = states(sys),
@@ -199,6 +195,10 @@ Create an `NonlinearFunction` from the [`NonlinearSystem`](@ref). The arguments
199195
`dvs` and `ps` are used to set the order of the dependent variable and parameter
200196
vectors, respectively.
201197
"""
198+
function DiffEqBase.NonlinearFunction(sys::NonlinearSystem, args...; kwargs...)
199+
NonlinearFunction{true}(sys, args...; kwargs...)
200+
end
201+
202202
function DiffEqBase.NonlinearFunction{iip}(sys::NonlinearSystem, dvs = states(sys),
203203
ps = parameters(sys), u0 = nothing;
204204
version = nothing,
@@ -315,10 +315,6 @@ function process_NonlinearProblem(constructor, sys::NonlinearSystem, u0map, para
315315
return f, u0, p
316316
end
317317

318-
function DiffEqBase.NonlinearProblem(sys::NonlinearSystem, args...; kwargs...)
319-
NonlinearProblem{true}(sys, args...; kwargs...)
320-
end
321-
322318
"""
323319
```julia
324320
function DiffEqBase.NonlinearProblem{iip}(sys::NonlinearSystem,u0map,
@@ -332,6 +328,10 @@ function DiffEqBase.NonlinearProblem{iip}(sys::NonlinearSystem,u0map,
332328
Generates an NonlinearProblem from a NonlinearSystem and allows for automatically
333329
symbolically calculating numerical enhancements.
334330
"""
331+
function DiffEqBase.NonlinearProblem(sys::NonlinearSystem, args...; kwargs...)
332+
NonlinearProblem{true}(sys, args...; kwargs...)
333+
end
334+
335335
function DiffEqBase.NonlinearProblem{iip}(sys::NonlinearSystem, u0map,
336336
parammap = DiffEqBase.NullParameters();
337337
check_length = true, kwargs...) where {iip}

src/systems/optimization/optimizationsystem.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@ namespace_expr(sys::OptimizationSystem) = namespace_expr(get_op(sys), sys)
126126

127127
hessian_sparsity(sys::OptimizationSystem) = hessian_sparsity(get_op(sys), states(sys))
128128

129-
function DiffEqBase.OptimizationProblem(sys::OptimizationSystem, args...; kwargs...)
130-
DiffEqBase.OptimizationProblem{true}(sys::OptimizationSystem, args...; kwargs...)
131-
end
132-
133129
function rep_pars_vals!(e::Expr, p)
134130
rep_pars_vals!.(e.args, Ref(p))
135131
replace!(e.args, p...)
@@ -152,6 +148,10 @@ function DiffEqBase.OptimizationProblem{iip}(sys::OptimizationSystem,u0map,
152148
Generates an OptimizationProblem from an OptimizationSystem and allows for automatically
153149
symbolically calculating numerical enhancements.
154150
"""
151+
function DiffEqBase.OptimizationProblem(sys::OptimizationSystem, args...; kwargs...)
152+
DiffEqBase.OptimizationProblem{true}(sys::OptimizationSystem, args...; kwargs...)
153+
end
154+
155155
function DiffEqBase.OptimizationProblem{iip}(sys::OptimizationSystem, u0map,
156156
parammap = DiffEqBase.NullParameters();
157157
lb = nothing, ub = nothing,

0 commit comments

Comments
 (0)