Skip to content

Commit ba08877

Browse files
author
SciML Bot
committed
Apply JuliaFormatter to fix code formatting
- Applied JuliaFormatter with SciML style guide - Formatted 28 files 🤖 Generated by OrgMaintenanceScripts.jl
1 parent 1fa4b8a commit ba08877

File tree

28 files changed

+132
-65
lines changed

28 files changed

+132
-65
lines changed

docs/make.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ dev_subpkg("DataDrivenDMD")
1212
dev_subpkg("DataDrivenSparse")
1313
dev_subpkg("DataDrivenSR")
1414

15-
1615
using Documenter
1716
using DataDrivenDiffEq
1817
using DataDrivenDMD
@@ -78,7 +77,7 @@ makedocs(sitename = "DataDrivenDiffEq.jl",
7877
"http://cwrowley.princeton.edu/papers/Hemati-2017a.pdf",
7978
"https://royalsocietypublishing.org/doi/10.1098/rspa.2020.0279",
8079
"https://www.pnas.org/doi/10.1073/pnas.1517384113",
81-
"https://link.springer.com/article/10.1007/s00332-015-9258-5",
80+
"https://link.springer.com/article/10.1007/s00332-015-9258-5"
8281
],
8382
format = Documenter.HTML(assets = ["assets/favicon.ico"],
8483
canonical = "https://docs.sciml.ai/DataDrivenDiffEq/stable/"),

lib/DataDrivenDMD/src/algorithms.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ K = Y / X
4545
where `Y` and `X` are data matrices. Returns a `Eigen` factorization of the operator.
4646
4747
# Fields
48+
4849
$(FIELDS)
4950
5051
# Signatures
52+
5153
$(SIGNATURES)
5254
"""
5355
mutable struct DMDPINV <: AbstractKoopmanAlgorithm end;
@@ -85,11 +87,12 @@ where `Y` and `X = U*Σ*V'` are data matrices. The singular value decomposition
8587
the `truncation` parameter, which can either be an `Int` indicating an index-based truncation or a `Real`
8688
indicating a tolerance-based truncation. Returns a `Eigen` factorization of the operator.
8789
88-
8990
# Fields
91+
9092
$(FIELDS)
9193
9294
# Signatures
95+
9396
$(SIGNATURES)
9497
"""
9598
mutable struct DMDSVD{T} <: AbstractKoopmanAlgorithm where {T <: Number}
@@ -153,9 +156,11 @@ entries bigger than `rtol*maximum(Σ)`. If `rtol` is an integer, the reduced SVD
153156
for computation.
154157
155158
# Fields
159+
156160
$(FIELDS)
157161
158162
# Signatures
163+
159164
$(SIGNATURES)
160165
"""
161166
mutable struct TOTALDMD{R, A} <:
@@ -187,17 +192,18 @@ end
187192
"""
188193
$(TYPEDEF)
189194
190-
191195
Approximates the Koopman operator `K` via the forward-backward DMD.
192196
It is assumed that `K = sqrt(K₁*inv(K₂))`, where `K₁` is the approximation via forward and `K₂` via [DMDSVD](@ref). Based on [this paper](https://arxiv.org/pdf/1507.02264).
193197
194198
If `truncation` ∈ (0, 1) is given, the singular value decomposition is reduced to include only
195199
entries bigger than `truncation*maximum(Σ)`. If `truncation` is an integer, the reduced SVD up to `truncation` is used for computation.
196200
197201
# Fields
202+
198203
$(FIELDS)
199204
200205
# Signatures
206+
201207
$(SIGNATURES)
202208
"""
203209
mutable struct FBDMD{R} <: AbstractKoopmanAlgorithm where {R <: Number}

lib/DataDrivenDMD/src/type.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
$(TYPEDEF)
33
44
# Fields
5+
56
$(FIELDS)
67
78
## Note
@@ -104,7 +105,8 @@ function operator(k::Koopman{<:Any, <:Any, <:Any, false})
104105
throw(AssertionError("Koopman is continuous."))
105106
end
106107

107-
"""_
108+
"""
109+
_
108110
$(SIGNATURES)
109111
110112
Return the approximation of the continuous Koopman generator stored in `k`.
@@ -131,8 +133,8 @@ $(SIGNATURES)
131133
132134
Returns `true` if either:
133135
134-
+ the Koopman operator has just eigenvalues with magnitude less than one or
135-
+ the Koopman generator has just eigenvalues with a negative real part
136+
- the Koopman operator has just eigenvalues with magnitude less than one or
137+
- the Koopman generator has just eigenvalues with a negative real part
136138
"""
137139
is_stable(k::Koopman{<:Any, true}) = all(real.(eigvals(k)) .< real.(one(eltype(k))))
138140
is_stable(k::Koopman{<:Any, false}) = all(real.(eigvals(k)) .< real.(zero(eltype(k))))

lib/DataDrivenLux/src/caches/cache.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ end
3232

3333
function init_cache(x::X where {X <: AbstractDAGSRAlgorithm},
3434
basis::Basis, problem::DataDrivenProblem; kwargs...)
35-
(; rng, keep, observed, populationsize, optimizer, optim_options, optimiser, loss) = x.options
35+
(; rng, keep, observed, populationsize, optimizer,
36+
optim_options, optimiser, loss) = x.options
3637
# Derive the model
3738
dataset = Dataset(problem)
3839
TData = eltype(dataset)

lib/DataDrivenLux/src/caches/candidate.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ A container holding all the information for the current candidate solution
4242
to the symbolic regression problem.
4343
4444
# Fields
45+
4546
$(FIELDS)
4647
"""
4748
@concrete struct Candidate <: StatsBase.StatisticalModel

lib/DataDrivenLux/src/lux/graph.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ A container for a layered directed acyclic graph consisting of
55
different [`DecisionLayer`](@ref)s.
66
77
# Fields
8+
89
$(FIELDS)
910
"""
1011
@concrete struct LayeredDAG <: AbstractLuxWrapperLayer{:layers}

lib/DataDrivenLux/src/lux/layer.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
"""
22
$(TYPEDEF)
33
4-
A container for multiple [`DecisionNodes`](@ref).
4+
A container for multiple [`DecisionNodes`](@ref).
55
It accumulates all outputs of the nodes.
66
77
# Fields
8+
89
$(FIELDS)
910
"""
1011
@concrete struct FunctionLayer <: AbstractLuxWrapperLayer{:nodes}

lib/DataDrivenLux/src/lux/node.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"""
33
$(TYPEDEF)
44
5-
A layer representing a decision node with a single function
5+
A layer representing a decision node with a single function
66
and a latent array of weights representing a probability distribution over the inputs.
77
88
# Fields
9-
$(FIELDS)
109
10+
$(FIELDS)
1111
"""
1212
@concrete struct FunctionNode <: AbstractLuxWrapperLayer{:node}
1313
node

lib/DataDrivenLux/src/lux/simplex.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ end
1616
"""
1717
$(TYPEDEF)
1818
19-
Maps an `AbstractVector` to the probability simplex by adding gumbel distributed
19+
Maps an `AbstractVector` to the probability simplex by adding gumbel distributed
2020
noise and using `softmax` on each row.
2121
2222
# Fields
23+
2324
$(FIELDS)
2425
"""
2526
struct GumbelSoftmax <: AbstractSimplex end
@@ -41,6 +42,7 @@ $(TYPEDEF)
4142
Assumes an `AbstractVector` is on the probability simplex.
4243
4344
# Fields
45+
4446
$(FIELDS)
4547
"""
4648
struct DirectSimplex <: AbstractSimplex end

lib/DataDrivenSR/src/DataDrivenSR.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ $(TYPEDEF)
2424
Options for using SymbolicRegression.jl within the `solve` function.
2525
Automatically creates [`Options`](https://ai.damtp.cam.ac.uk/symbolicregression/stable/api/#Options) with the given specification.
2626
Sorts the operators stored in `functions` into unary and binary operators on conversion.
27+
2728
# Fields
29+
2830
$(FIELDS)
2931
"""
3032
@with_kw struct EQSearch <: AbstractDataDrivenAlgorithm
@@ -131,7 +133,8 @@ end
131133
function convert_to_basis(paretofrontier, prob)
132134
@unpack alg, basis, problem, options = prob
133135
@unpack eq_options = alg
134-
@unpack maxiters, eval_expresssion, generate_symbolic_parameters, digits, roundingmode = options
136+
@unpack maxiters, eval_expresssion, generate_symbolic_parameters, digits,
137+
roundingmode = options
135138

136139
eqs_ = map(paretofrontier) do dom
137140
node_to_symbolic(dom[end].tree, eq_options)
@@ -205,9 +208,11 @@ end
205208

206209
function CommonSolve.solve!(ps::InternalDataDrivenProblem{EQSearch})
207210
@unpack alg, basis, testdata, traindata, kwargs = ps
208-
@unpack weights, numprocs, procs, addprocs_function, parallelism, runtests, eq_options = alg
211+
@unpack weights, numprocs, procs, addprocs_function, parallelism, runtests,
212+
eq_options = alg
209213
@unpack traindata, testdata, basis, options = ps
210-
@unpack maxiters, eval_expresssion, generate_symbolic_parameters, digits, roundingmode, selector = options
214+
@unpack maxiters, eval_expresssion, generate_symbolic_parameters,
215+
digits, roundingmode, selector = options
211216
@unpack problem = ps
212217

213218
results = map(traindata) do (X, Y)

0 commit comments

Comments
 (0)