Skip to content

Commit fc08efa

Browse files
author
SciML Bot
committed
Apply JuliaFormatter to fix code formatting
- Applied JuliaFormatter with SciML style guide - Formatted 20 files 🤖 Generated by OrgMaintenanceScripts.jl
1 parent 3d000f0 commit fc08efa

20 files changed

+143
-120
lines changed

docs/make.jl

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Documenter, DiffEqBase, SciMLBase, OrdinaryDiffEq, OrdinaryDiffEqBDF, OrdinaryDiffEqCore, StochasticDiffEq, DelayDiffEq, SteadyStateDiffEq, DiffEqCallbacks
1+
using Documenter, DiffEqBase, SciMLBase, OrdinaryDiffEq, OrdinaryDiffEqBDF,
2+
OrdinaryDiffEqCore, StochasticDiffEq, DelayDiffEq, SteadyStateDiffEq, DiffEqCallbacks
23
import ODEProblemLibrary,
34
SDEProblemLibrary, DDEProblemLibrary, DAEProblemLibrary, BVProblemLibrary
45
using Sundials, DASKR
@@ -18,19 +19,19 @@ if isdir(ordinartdiffeq_docs_path)
1819
# Create the OrdinaryDiffEq API directory in the docs
1920
ordinary_diffeq_dest = joinpath(@__DIR__, "src", "api", "ordinarydiffeq")
2021
mkpath(dirname(ordinary_diffeq_dest))
21-
22+
2223
# Copy all the docs from OrdinaryDiffEq.jl
23-
cp(ordinartdiffeq_docs_path, ordinary_diffeq_dest, force=true)
24-
24+
cp(ordinartdiffeq_docs_path, ordinary_diffeq_dest, force = true)
25+
2526
# Copy the pages.jl file from OrdinaryDiffEq.jl
2627
ordinary_diffeq_pages_dest = joinpath(@__DIR__, "ordinarydiffeq_pages.jl")
2728
ordinary_diffeq_pages_file = joinpath(ordinartdiffeq_docs_root, "pages.jl")
28-
cp(ordinary_diffeq_pages_file, ordinary_diffeq_pages_dest, force=true)
29-
29+
cp(ordinary_diffeq_pages_file, ordinary_diffeq_pages_dest, force = true)
30+
3031
# Copy the common_first_steps.jl file from OrdinaryDiffEq.jl
3132
common_first_steps_dest = joinpath(@__DIR__, "common_first_steps.jl")
3233
common_first_steps_file = joinpath(ordinartdiffeq_docs_root, "common_first_steps.jl")
33-
cp(common_first_steps_file, common_first_steps_dest, force=true)
34+
cp(common_first_steps_file, common_first_steps_dest, force = true)
3435
end
3536

3637
# Copy StochasticDiffEq.jl documentation
@@ -40,14 +41,14 @@ if isdir(stochasticdiffeq_docs_path)
4041
# Create the StochasticDiffEq API directory in the docs
4142
stochastic_diffeq_dest = joinpath(@__DIR__, "src", "api", "stochasticdiffeq")
4243
mkpath(dirname(stochastic_diffeq_dest))
43-
44+
4445
# Copy all the docs from StochasticDiffEq.jl
45-
cp(stochasticdiffeq_docs_path, stochastic_diffeq_dest, force=true)
46-
46+
cp(stochasticdiffeq_docs_path, stochastic_diffeq_dest, force = true)
47+
4748
# Copy the pages.jl file from StochasticDiffEq.jl
4849
stochastic_diffeq_pages_dest = joinpath(@__DIR__, "stochasticdiffeq_pages.jl")
4950
stochastic_diffeq_pages_file = joinpath(stochasticdiffeq_docs_root, "pages.jl")
50-
cp(stochastic_diffeq_pages_file, stochastic_diffeq_pages_dest, force=true)
51+
cp(stochastic_diffeq_pages_file, stochastic_diffeq_pages_dest, force = true)
5152
end
5253

5354
ENV["PLOTS_TEST"] = "true"
@@ -118,13 +119,13 @@ makedocs(
118119
"https://github.com/SciML/ColPrac/blob/master/README.md",
119120
"https://github.com/SciML/DiffEqDevTools.jl/blob/master/src/ode_tableaus.jl",
120121
"https://github.com/SciML/DiffEqProblemLibrary.jl/blob/master/lib/BVProblemLibrary/src/BVProblemLibrary.jl",
121-
"https://github.com/SciML/DiffEqProblemLibrary.jl/blob/master/lib/DDEProblemLibrary/src/DDEProblemLibrary.jl",
122+
"https://github.com/SciML/DiffEqProblemLibrary.jl/blob/master/lib/DDEProblemLibrary/src/DDEProblemLibrary.jl"
122123
],
123124
doctest = false, clean = true,
124125
warnonly = [:missing_docs, :docs_block],
125126
format = Documenter.HTML(assets = ["assets/favicon.ico"],
126127
canonical = "https://docs.sciml.ai/DiffEqDocs/stable/",
127-
size_threshold = 500 * 2^10),
128+
size_threshold = 500 * 2^10),
128129
sitename = "DifferentialEquations.jl",
129130
authors = "Chris Rackauckas",
130131
pages = pages)

docs/pages.jl

Lines changed: 77 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ stochastic_diffeq_pages_file = joinpath(@__DIR__, "stochasticdiffeq_pages.jl")
3131
stochastic_diffeq_pages = []
3232
if isfile(stochastic_diffeq_pages_file)
3333
include(stochastic_diffeq_pages_file)
34-
34+
3535
# Transform StochasticDiffEq pages to have the api/stochasticdiffeq prefix
3636
function transform_stochasticdiffeq_pages(pages_array)
3737
transformed = []
@@ -49,77 +49,83 @@ if isfile(stochastic_diffeq_pages_file)
4949
end
5050
return transformed
5151
end
52-
52+
5353
stochastic_diffeq_pages = transform_stochasticdiffeq_pages(pages)
5454
end
5555

5656
pages = Any["index.md",
57-
"getting_started.md",
58-
"Tutorials" => Any["tutorials/faster_ode_example.md",
59-
"tutorials/advanced_ode_example.md",
60-
"tutorials/sde_example.md",
61-
"tutorials/rode_example.md",
62-
"tutorials/dde_example.md",
63-
"tutorials/dae_example.md",
64-
"tutorials/jump_diffusion.md",
65-
"tutorials/bvp_example.md"],
66-
"Examples" => Any[
67-
"Beginner" => Any["examples/classical_physics.md",
68-
"examples/conditional_dosing.md",
69-
"examples/kepler_problem.md",
70-
"examples/outer_solar_system.md",
71-
"examples/min_and_max.md"],
72-
"Advanced" => Any["examples/spiking_neural_systems.md",
73-
"examples/beeler_reuter.md",
74-
"examples/diffusion_implicit_heat_equation.md"]],
75-
"Basics" => Any["basics/overview.md",
76-
"basics/common_solver_opts.md",
77-
"basics/solution.md",
78-
"basics/plot.md",
79-
"basics/integrator.md",
80-
"basics/problem.md",
81-
"basics/faq.md",
82-
"basics/compatibility_chart.md"],
83-
"Problem Types" => Any["types/discrete_types.md",
84-
"types/ode_types.md",
85-
"types/nonautonomous_linear_ode.md",
86-
"types/dynamical_types.md",
87-
"types/split_ode_types.md",
88-
"types/steady_state_types.md",
89-
"types/bvp_types.md",
90-
"types/sde_types.md",
91-
"types/sdae_types.md",
92-
"types/rode_types.md",
93-
"types/dde_types.md",
94-
"types/sdde_types.md",
95-
"types/dae_types.md"],
96-
"Solver Algorithms" => Any["solvers/discrete_solve.md",
97-
"solvers/ode_solve.md",
98-
"solvers/nonautonomous_linear_ode.md",
99-
"solvers/dynamical_solve.md",
100-
"solvers/split_ode_solve.md",
101-
"solvers/steady_state_solve.md",
102-
"solvers/bvp_solve.md",
103-
"solvers/sde_solve.md",
104-
"solvers/sdae_solve.md",
105-
"solvers/rode_solve.md",
106-
"solvers/dde_solve.md",
107-
"solvers/sdde_solve.md",
108-
"solvers/dae_solve.md",
109-
"solvers/benchmarks.md"],
110-
"Additional Features" => Any["features/performance_overloads.md",
111-
"features/diffeq_arrays.md",
112-
"features/diffeq_operator.md",
113-
"features/noise_process.md",
114-
"features/linear_nonlinear.md",
115-
"features/callback_functions.md",
116-
"features/callback_library.md",
117-
"features/ensemble.md",
118-
"features/io.md",
119-
"features/low_dep.md",
120-
"features/progress_bar.md"],
121-
"External Solver APIs" => Any["api/sundials.md",
122-
"api/daskr.md"],
123-
"OrdinaryDiffEq.jl API" => ordinary_diffeq_pages,
124-
"StochasticDiffEq.jl API" => stochastic_diffeq_pages,
125-
"Extra Details" => Any["extras/timestepping.md"]]
57+
"getting_started.md",
58+
"Tutorials" => Any[
59+
"tutorials/faster_ode_example.md",
60+
"tutorials/advanced_ode_example.md",
61+
"tutorials/sde_example.md",
62+
"tutorials/rode_example.md",
63+
"tutorials/dde_example.md",
64+
"tutorials/dae_example.md",
65+
"tutorials/jump_diffusion.md",
66+
"tutorials/bvp_example.md"],
67+
"Examples" => Any[
68+
"Beginner" => Any["examples/classical_physics.md",
69+
"examples/conditional_dosing.md",
70+
"examples/kepler_problem.md",
71+
"examples/outer_solar_system.md",
72+
"examples/min_and_max.md"],
73+
"Advanced" => Any["examples/spiking_neural_systems.md",
74+
"examples/beeler_reuter.md",
75+
"examples/diffusion_implicit_heat_equation.md"]],
76+
"Basics" => Any[
77+
"basics/overview.md",
78+
"basics/common_solver_opts.md",
79+
"basics/solution.md",
80+
"basics/plot.md",
81+
"basics/integrator.md",
82+
"basics/problem.md",
83+
"basics/faq.md",
84+
"basics/compatibility_chart.md"],
85+
"Problem Types" => Any[
86+
"types/discrete_types.md",
87+
"types/ode_types.md",
88+
"types/nonautonomous_linear_ode.md",
89+
"types/dynamical_types.md",
90+
"types/split_ode_types.md",
91+
"types/steady_state_types.md",
92+
"types/bvp_types.md",
93+
"types/sde_types.md",
94+
"types/sdae_types.md",
95+
"types/rode_types.md",
96+
"types/dde_types.md",
97+
"types/sdde_types.md",
98+
"types/dae_types.md"],
99+
"Solver Algorithms" => Any[
100+
"solvers/discrete_solve.md",
101+
"solvers/ode_solve.md",
102+
"solvers/nonautonomous_linear_ode.md",
103+
"solvers/dynamical_solve.md",
104+
"solvers/split_ode_solve.md",
105+
"solvers/steady_state_solve.md",
106+
"solvers/bvp_solve.md",
107+
"solvers/sde_solve.md",
108+
"solvers/sdae_solve.md",
109+
"solvers/rode_solve.md",
110+
"solvers/dde_solve.md",
111+
"solvers/sdde_solve.md",
112+
"solvers/dae_solve.md",
113+
"solvers/benchmarks.md"],
114+
"Additional Features" => Any[
115+
"features/performance_overloads.md",
116+
"features/diffeq_arrays.md",
117+
"features/diffeq_operator.md",
118+
"features/noise_process.md",
119+
"features/linear_nonlinear.md",
120+
"features/callback_functions.md",
121+
"features/callback_library.md",
122+
"features/ensemble.md",
123+
"features/io.md",
124+
"features/low_dep.md",
125+
"features/progress_bar.md"],
126+
"External Solver APIs" => Any[
127+
"api/sundials.md",
128+
"api/daskr.md"],
129+
"OrdinaryDiffEq.jl API" => ordinary_diffeq_pages,
130+
"StochasticDiffEq.jl API" => stochastic_diffeq_pages,
131+
"Extra Details" => Any["extras/timestepping.md"]]

docs/src/basics/faq.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ For guidelines on debugging ODE solve issues, see
1212
First of all, don't panic. You may have experienced one of the following warnings:
1313

1414
> dt <= dtmin. Aborting. There is either an error in your model specification or the true solution is unstable.
15-
>
15+
>
1616
> NaN dt detected. Likely a NaN value in the state, parameters, or derivative value caused this outcome.
17-
>
17+
>
1818
> Instability detected. Aborting
1919
2020
These are all pointing to a similar behavior: for some reason or another, the
@@ -572,7 +572,8 @@ though, an `Error: SingularException` is also possible if the linear solver fail
572572

573573
```julia
574574
import DifferentialEquations as DE, OrdinaryDiffEq as ODE, LinearSolve
575-
DE.solve(prob, ODE.Rodas4(linsolve = LinearSolve.KLUFactorization(; reuse_symbolic = false)))
575+
DE.solve(prob, ODE.Rodas4(linsolve = LinearSolve.KLUFactorization(;
576+
reuse_symbolic = false)))
576577
```
577578

578579
For more details about possible linear solvers, consult the [LinearSolve.jl documentation](https://docs.sciml.ai/LinearSolve/stable/)

docs/src/basics/integrator.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ For example, if one wants to iterate but only stop at specific values, one can
250250
choose:
251251

252252
```julia
253-
integrator = DE.init(prob, DE.Tsit5(); dt = 1 // 2^(4), tstops = [0.5], advance_to_tstop = true)
253+
integrator = DE.init(
254+
prob, DE.Tsit5(); dt = 1 // 2^(4), tstops = [0.5], advance_to_tstop = true)
254255
for (u, t) in tuples(integrator)
255256
@test t [0.5, 1.0]
256257
end

docs/src/basics/plot.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ xy = Plots.plot(sol, plotdensity = 10000, idxs = (1, 2))
160160
xz = Plots.plot(sol, plotdensity = 10000, idxs = (1, 3))
161161
yz = Plots.plot(sol, plotdensity = 10000, idxs = (2, 3))
162162
xyz = Plots.plot(sol, plotdensity = 10000, idxs = (1, 2, 3))
163-
Plots.plot(Plots.plot(xyzt, xyz), Plots.plot(xy, xz, yz, layout = (1, 3), w = 1), layout = (2, 1))
163+
Plots.plot(Plots.plot(xyzt, xyz), Plots.plot(xy, xz, yz, layout = (1, 3), w = 1), layout = (
164+
2, 1))
164165
```
165166

166167
An example using the functions:

docs/src/basics/solution.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# [Solution Handling](@id solution)
22

3-
The solution is an `RecursiveArrayTools.AbstractDiffEqArray`.
3+
The solution is an `RecursiveArrayTools.AbstractDiffEqArray`.
44
[See RecursiveArrayTools.jl for more information on the interface](https://docs.sciml.ai/RecursiveArrayTools/stable/).
55
The following is a more DiffEq-centric explanation of the interface.
66

@@ -19,7 +19,7 @@ derivative at each timestep `du` or the spatial discretization `x`, `y`, etc.
1919
## Array Interface
2020

2121
!!! note
22-
22+
2323
In 2023 the linear indexing `sol[i]` was deprecated. It previously had the behavior that
2424
`sol[i] = sol.u[i]`. However, this is incompatible with standard `AbstractArray` interfaces,
2525
Since if `A = VectorOfArray([[1,2],[3,4]])` and `A` is supposed to act like `[1 3; 2 4]`,
@@ -50,7 +50,7 @@ will address first by component and lastly by time, and thus
5050
sol[i, j]
5151
```
5252

53-
will be the `i`th component at timestep `j`. Hence, `sol[j][i] == sol[i, j]`. This is done because Julia is column-major,
53+
will be the `i`th component at timestep `j`. Hence, `sol[j][i] == sol[i, j]`. This is done because Julia is column-major,
5454
so the leading dimension should be contiguous in memory. If the independent variables had shape
5555
(for example, was a matrix), then `i` is the linear index. We can also access
5656
solutions with shape:
@@ -186,12 +186,14 @@ error state of the solution. Return codes are now implemented as an enum using E
186186
rather than symbols.
187187

188188
To check if a solution was successful, use:
189+
189190
```julia
190191
SciMLBase.successful_retcode(sol)
191192
```
192193

193194
!!! warning
194-
Previous iterations of the interface suggested using `sol.retcode == :Success`,
195+
196+
Previous iterations of the interface suggested using `sol.retcode == :Success`,
195197
however, that is now not advised because there are more than one return code that can be interpreted
196198
as successful. For example, `Terminated` is a successful run to a manual termination, and would be missed
197199
if only checking for Success. Therefore we highly recommend you use `SciMLBase.successful_retcode(sol)` instead.
@@ -214,7 +216,7 @@ following are major return codes to know:
214216
- `ConvergenceFailure`: The internal implicit solvers failed to converge.
215217
- `Failure`: General uncategorized failures or errors.
216218

217-
For a complete list of return codes and their properties, see the
219+
For a complete list of return codes and their properties, see the
218220
[SciMLBase ReturnCode documentation](https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#retcodes).
219221

220222
## Problem-Specific Features

docs/src/examples/beeler_reuter.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ end
9393
The finite-difference Laplacian is calculated in-place by a 5-point stencil. The Neumann boundary condition is enforced.
9494

9595
!!! note
96-
For more complex PDE discretizations, consider using [MethodOfLines.jl](https://docs.sciml.ai/MethodOfLines/stable/)
97-
which can automatically generate finite difference discretizations, or [SciMLOperators.jl](https://docs.sciml.ai/SciMLOperators/stable/)
96+
97+
For more complex PDE discretizations, consider using [MethodOfLines.jl](https://docs.sciml.ai/MethodOfLines/stable/)
98+
which can automatically generate finite difference discretizations, or [SciMLOperators.jl](https://docs.sciml.ai/SciMLOperators/stable/)
9899
for defining matrix-free linear operators.
99100

100101
```julia
@@ -632,7 +633,7 @@ function (f::BeelerReuterGpu)(du, u, p, t)
632633
ny, nx = size(u)
633634

634635
if Δt != 0 || t == 0
635-
@cuda blocks=(ny ÷ L, nx ÷ L) threads=(L, L) update_gates_gpu(f.d_u, f.d_XI, f.d_M,
636+
@cuda blocks=(ny÷L, nx÷L) threads=(L, L) update_gates_gpu(f.d_u, f.d_XI, f.d_M,
636637
f.d_H, f.d_J, f.d_D,
637638
f.d_F, f.d_C, Δt)
638639
f.t = t
@@ -641,7 +642,7 @@ function (f::BeelerReuterGpu)(du, u, p, t)
641642
laplacian(f.Δv, u)
642643

643644
# calculate the reaction portion
644-
@cuda blocks=(ny ÷ L, nx ÷ L) threads=(L, L) update_du_gpu(
645+
@cuda blocks=(ny÷L, nx÷L) threads=(L, L) update_du_gpu(
645646
f.d_du, f.d_u, f.d_XI, f.d_M,
646647
f.d_H, f.d_J, f.d_D, f.d_F,
647648
f.d_C)

docs/src/examples/classical_physics.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ Notice that we get the same results:
382382

383383
```@example physics
384384
# Plot the orbit
385-
Plots.plot(sol2, idxs = (3, 4), title = "The orbit of the Hénon-Heiles system", xaxis = "x",
385+
Plots.plot(
386+
sol2, idxs = (3, 4), title = "The orbit of the Hénon-Heiles system", xaxis = "x",
386387
yaxis = "y", leg = false)
387388
```
388389

docs/src/examples/kepler_problem.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ sol = ODE.solve(prob, ODE.KahanLi6(), dt = 1 // 10);
3333
Let's plot the orbit and check the energy and angular momentum variation. We know that energy and angular momentum should be constant, and they are also called first integrals.
3434

3535
```@example kepler
36-
plot_orbit(sol) = Plots.plot(sol, idxs = (3, 4), lab = "Orbit", title = "Kepler Problem Solution")
36+
function plot_orbit(sol)
37+
Plots.plot(sol, idxs = (3, 4), lab = "Orbit", title = "Kepler Problem Solution")
38+
end
3739
3840
function plot_first_integrals(sol, H, L)
3941
Plots.plot(initial_first_integrals[1] .- map(u -> H(u.x[2], u.x[1]), sol.u),

docs/src/features/ensemble.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ compute covariance matrices similarly:
574574

575575
```@example ensemble4
576576
DE.EnsembleAnalysis.timeseries_steps_meancov(sim) # Use the time steps, assume fixed dt
577-
DE.EnsembleAnalysis.timeseries_point_meancov(sim, 0:(1 // 2^(3)):1, 0:(1 // 2^(3)):1) # Use time points, interpolate
577+
DE.EnsembleAnalysis.timeseries_point_meancov(sim, 0:(1 // 2 ^ (3)):1, 0:(1 // 2 ^ (3)):1) # Use time points, interpolate
578578
```
579579

580580
For general analysis, we can build a `EnsembleSummary` type.

0 commit comments

Comments
 (0)