Skip to content

Commit a18f040

Browse files
feat: add Base.show methods for LinearizationFunction and LinearizationProblem
1 parent 4fa67aa commit a18f040

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/linearization.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ function SymbolicIndexingInterface.parameter_values(f::LinearizationFunction)
146146
end
147147
SymbolicIndexingInterface.current_time(f::LinearizationFunction) = current_time(f.prob)
148148

149+
function Base.show(io::IO, mime::MIME"text/plain", lf::LinearizationFunction)
150+
printstyled(io, "LinearizationFunction"; bold = true, color = :blue)
151+
println(io, " which wraps:")
152+
show(io, mime, lf.prob)
153+
end
154+
149155
"""
150156
$(TYPEDSIGNATURES)
151157
@@ -263,6 +269,12 @@ mutable struct LinearizationProblem{F <: LinearizationFunction, T}
263269
t::T
264270
end
265271

272+
function Base.show(io::IO, mime::MIME"text/plain", prob::LinearizationProblem)
273+
printstyled(io, "LinearizationProblem"; bold = true, color = :blue)
274+
println(io, " at time ", prob.t, " which wraps:")
275+
show(io, mime, prob.f.prob)
276+
end
277+
266278
"""
267279
$(TYPEDSIGNATURES)
268280

0 commit comments

Comments
 (0)