Skip to content

Commit 008b84b

Browse files
committed
style: fix formatting
1 parent b881cc3 commit 008b84b

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

src/Blocks/sources.jl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ function cached_interpolation(interpolation_type, u, x, args)
745745
# to update the cache if needed (and setindex! is not defined on ranges)
746746
# with a view from MTKParameters, so we collect to get a vector
747747
prev_x = DiffCache(collect(x))
748-
interp = GeneralLazyBufferCache() do (u,x)
748+
interp = GeneralLazyBufferCache() do (u, x)
749749
interpolation_type(get_tmp(prev_u, u), get_tmp(prev_x, x), args...)
750750
end
751751

@@ -758,16 +758,17 @@ function cached_interpolation(interpolation_type, u, x, args)
758758
if (u, x) (get_tmp(prev_u, u), get_tmp(prev_x, x))
759759
get_tmp(prev_u, u) .= u
760760
get_tmp(prev_x, x) .= x
761-
interp.bufs[(u,x)] = interpolation_type(
761+
interp.bufs[(u, x)] = interpolation_type(
762762
get_tmp(prev_u, u), get_tmp(prev_x, x), args...)
763763
else
764-
interp[(u,x)]
764+
interp[(u, x)]
765765
end
766766
end
767767
end
768768
end
769769

770-
@register_symbolic interpolation_builder(f::Function, u::AbstractArray, x::AbstractArray, args::Tuple)
770+
@register_symbolic interpolation_builder(
771+
f::Function, u::AbstractArray, x::AbstractArray, args::Tuple)
771772
interpolation_builder(f, u, x, args) = f(u, x, args)
772773

773774
"""
@@ -790,7 +791,8 @@ such as `LinearInterpolation`, `ConstantInterpolation` or `CubicSpline`.
790791
# Connectors:
791792
- `output`: a [`RealOutput`](@ref) connector corresponding to the interpolated value
792793
"""
793-
function ParametrizedInterpolation(interp_type::T, u::AbstractVector, x::AbstractVector, args...; name) where {T}
794+
function ParametrizedInterpolation(
795+
interp_type::T, u::AbstractVector, x::AbstractVector, args...; name) where {T}
794796
@parameters data[1:length(x)] = u
795797
@parameters ts[1:length(x)] = x
796798
@parameters interpolation_type::T=interp_type [tunable = false] interpolation_args::Tuple=args [tunable = false]
@@ -803,9 +805,11 @@ function ParametrizedInterpolation(interp_type::T, u::AbstractVector, x::Abstrac
803805

804806
eqs = [output.u ~ apply_interpolation(interpolator, t)]
805807

806-
ODESystem(eqs, t, [], [data, ts, interpolation_type, interpolation_args, interpolator, memoized_builder];
808+
ODESystem(eqs, t, [],
809+
[data, ts, interpolation_type, interpolation_args, interpolator, memoized_builder];
807810
parameter_dependencies = [
808-
interpolator => interpolation_builder(memoized_builder, data, ts, interpolation_args)
811+
interpolator => interpolation_builder(
812+
memoized_builder, data, ts, interpolation_args)
809813
],
810814
systems = [output],
811815
name)

src/Hydraulic/IsothermalCompressible/IsothermalCompressible.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Library to model iso-thermal compressible liquid fluid flow
2+
Library to model iso-thermal compressible liquid fluid flow
33
"""
44
module IsothermalCompressible
55

test/Blocks/sources.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ end
498498

499499
@test SciMLBase.successful_retcode(sol)
500500

501-
prob2 = remake(prob, p=[i.data => ones(15)])
501+
prob2 = remake(prob, p = [i.data => ones(15)])
502502
sol2 = solve(prob2)
503503

504504
@test SciMLBase.successful_retcode(sol2)
@@ -525,7 +525,8 @@ end
525525

526526
set_data! = setp(prob, i.data)
527527
of = OptimizationFunction(loss, AutoForwardDiff())
528-
op = OptimizationProblem(of, u, (prob, set_data!), lb = zeros(15), ub = fill(2.0, 15))
528+
op = OptimizationProblem(
529+
of, u, (prob, set_data!), lb = zeros(15), ub = fill(2.0, 15))
529530

530531
# check that type changing works
531532
@test length(ForwardDiff.gradient(x -> of(x, (prob, set_data!)), u)) == 15

0 commit comments

Comments
 (0)