Skip to content

Commit 23231d6

Browse files
feat: add Base.show methods for LinearizationFunction and LinearizationProblem
1 parent 615c7fc commit 23231d6

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
@@ -148,6 +148,12 @@ function SymbolicIndexingInterface.parameter_values(f::LinearizationFunction)
148148
end
149149
SymbolicIndexingInterface.current_time(f::LinearizationFunction) = current_time(f.prob)
150150

151+
function Base.show(io::IO, mime::MIME"text/plain", lf::LinearizationFunction)
152+
printstyled(io, "LinearizationFunction"; bold = true, color = :blue)
153+
println(io, " which wraps:")
154+
show(io, mime, lf.prob)
155+
end
156+
151157
"""
152158
$(TYPEDSIGNATURES)
153159
@@ -265,6 +271,12 @@ mutable struct LinearizationProblem{F <: LinearizationFunction, T}
265271
t::T
266272
end
267273

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

0 commit comments

Comments
 (0)