Skip to content

Commit f5b6ba7

Browse files
Merge pull request #950 from AayushSabharwal/as/format
refactor: format
2 parents 23f6936 + a26c52b commit f5b6ba7

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

docs/src/interfaces/Problems.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ defaults `Dict(:a => :(2b), :c => 0.1)`. Then:
130130
`3.0` for `:a`, `:b` and `:c` respectively. Note how the explicitly specified value for
131131
`:a` overrides the dependent default.
132132

133-
134133
### Aliasing Specification
134+
135135
An `AbstractAliasSpecifier` is associated with each SciMLProblem type. Each holds fields specifying which variables to alias
136136
when solving. For example, to tell an ODE solver to alias the `u0` array, you can use an `ODEAliases` object,
137137
and the `alias_u0` keyword argument, e.g. `solve(prob,alias = ODEAliases(alias_u0 = true))`.

src/problems/problem_utils.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ function Base.summary(io::IO, prob::AbstractDEProblem)
2929
no_color,
3030
". In-place: ", type_color, isinplace(prob), no_color)
3131
init = initialization_status(prob)
32-
!isnothing(init) && begin
32+
!isnothing(init) && begin
3333
println(io)
34-
print(io, "Initialization status: ", type_color, initialization_status(prob), no_color)
34+
print(io, "Initialization status: ", type_color,
35+
initialization_status(prob), no_color)
3536
end
3637

3738
hasproperty(prob.f, :mass_matrix) && begin
3839
println(io)
39-
print(io, "Non-trivial mass matrix: ", type_color, !(prob.f.mass_matrix isa LinearAlgebra.UniformScaling{Bool}), no_color)
40+
print(io, "Non-trivial mass matrix: ", type_color,
41+
!(prob.f.mass_matrix isa LinearAlgebra.UniformScaling{Bool}), no_color)
4042
end
4143
end
4244

src/problems/sde_problems.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,12 @@ function ConstructionBase.constructorof(::Type{P}) where {P <: SDEProblem}
132132
if g !== f.g
133133
f = remake(f; g)
134134
end
135-
return SDEProblem{iip}(f, u0, tspan, p; kw..., noise, noise_rate_prototype, seed)
135+
return SDEProblem{iip}(
136+
f, u0, tspan, p; kw..., noise, noise_rate_prototype, seed)
136137
else
137138
iip = isinplace(f, 4)
138-
return SDEProblem{iip}(f, g, u0, tspan, p; kw..., noise, noise_rate_prototype, seed)
139+
return SDEProblem{iip}(
140+
f, g, u0, tspan, p; kw..., noise, noise_rate_prototype, seed)
139141
end
140142
end
141143
end

src/solutions/save_idxs.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ function as_diffeq_array(vt::Vector{VectorTemplate}, t)
4545
end
4646

4747
function get_root_indp(indp)
48-
if hasmethod(symbolic_container, Tuple{typeof(indp)}) && (sc = symbolic_container(indp)) !== indp
48+
if hasmethod(symbolic_container, Tuple{typeof(indp)}) &&
49+
(sc = symbolic_container(indp)) !== indp
4950
return get_root_indp(sc)
5051
end
5152
return indp
@@ -125,7 +126,8 @@ function SavedSubsystem(indp, pobj, saved_idxs::Union{AbstractArray, Tuple})
125126
end
126127
if eltype(saved_idxs) == Int
127128
state_map = Dict{Int, Int}(v => k for (k, v) in enumerate(saved_idxs))
128-
return SavedSubsystem(state_map, nothing, nothing, nothing, nothing, nothing, nothing)
129+
return SavedSubsystem(
130+
state_map, nothing, nothing, nothing, nothing, nothing, nothing)
129131
end
130132

131133
# array state symbolics must be scalarized

test/downstream/modelingtoolkit_remake.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ k = ShiftIndex(t)
7373
discprob = DiscreteProblem(discsys, [], (0, 10), p)
7474
for (var, v) in u0
7575
discprob[var] = v
76-
discprob[var(k-1)] = 0.0
76+
discprob[var(k - 1)] = 0.0
7777
end
7878
push!(syss, discsys)
7979
push!(probs, discprob)
@@ -268,7 +268,7 @@ end
268268
newval = ModelingToolkit.fixpoint_sub(sym, varmap; maxiters = 10)
269269
vs = ModelingToolkit.vars(newval)
270270
if !isempty(vars) && any(in(Set(vars)), vs)
271-
NotSymbolic()
271+
NotSymbolic()
272272
return true
273273
end
274274
end

0 commit comments

Comments
 (0)